[Freeswitch-users] Run Bash script in Dialplan

Abel Monzon abelcubano at gmail.com
Fri Nov 15 22:36:18 UTC 2019


Hello.


I am trying to run a bash script when dialplan is generate.

I have tested this bash script in CLI and is working as expected, but when
is called from dialplan I don't see any error and looks like the bash was
never runned.


api = freeswitch.API();
rotation = api:executeString("system sh
/opt/ASTPP/freeswitch/scripts/rotation.sh"); --> this rotate between 2x
gateway name and save the name to a file, but looks like never run.
gateway = api:executeString("system sh
/opt/ASTPP/freeswitch/scripts/random2.sh"); ---> this script read the name
of the gateway from the file, and works perfect.

table.insert(xml, [[<action application="bridge"
data="[]]..chan_var..[[]sofia/gateway/]]..*gateway*
..[[/]]..destination_number..[["/>]]);




Here is the result on console:


EXECUTE sofia/default/14254358039 at 198.50.167.93
bridge([leg_timeout=0,absolute_codec_string=^^:PCMA:PCMU:G729]sofia/gateway/GATEWAY-01/38227043)



I don't any way to troubleshoot why 1x script run perfectly and the other
one is not running.


Thank You in advance.
Abel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20191115/f3f8b714/attachment-0001.html>


More information about the FreeSWITCH-users mailing list