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@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