This was working fine in Asterisk 1.8.32.3 - I'm testing with Asterisk 13.22.0 on Centos 7 running as root (already - as you'll see below):
same=>n,System(/usr/src/bash/setData.sh ${CHANNEL(accountcode)})
The script's permissions:
[root@localhost bash]# ls -l
-rwxr-xr-x 1 root root 1493 Jan 20 2016 setData.sh
[root@localhost bash]# pwd
/usr/src/bash
[root@localhost bash]#
I've upgraded to Asterisk 13, and Asterisk is now incapable of executing the setData.sh script:
[Jul 25 10:33:21] WARNING[30982][C-00000238] app_system.c: Unable to execute '/usr/src/bash/setData.sh'
I've looked at numerous posts about this, but none are applicable or end blind with no solution.
I've tried running asterisk as root, no luck - see above.
I've set permissions on the script to executable by everybody, not working.
I've changed the dialplan code to
same=>n,System(/bin/bash /usr/src/bash/setData.sh ${CHANNEL(accountcode)})
also no effect.
I've also tried completely disabling / deactivating SELinux in Centos 7 - no effect, error persists.
If you run the script from the shell / xterm, it works correctly.
How does one get Asterisk 13 to execute a simple BASH script via the System() dialplan application as worked in previous Asterisk versions such as 1.6 and 1.8?
Thanks!
Stefan
1) check selinux
2) try run under same user as you pbx(see asterisk.conf)
if not help, stop asterisk, start asterisk in console mode
see error