System don't work

I using

exten => 0001,1,System(bash ./

When I run
asterisk -vvvvgc
everything works fine, but when I run the asterisk normally it either fails to execute [exten => 0001,1,System(bash /etc/asterisk/]
or error unable to execute [exten => 0001,1,System(bash ./].

Processes are started by the same users
-rwx------ 1 asterisk asterisk

system(echo 123)
Don’t work too

Yous should give the complete PATH eg /etc/asterisk/ or /usr/bin/echo

I tried it, script do nothing

Did you try:

exten => 0001,1,System(/bin/bash /etc/asterisk/

Have you tried running the exact command as the Asterisk user manually, from a shell?


yourusername@host:~$ sudo su - asterisk -s $SHELL
asterisk@host:~$ /bin/bash /etc/asterisk/

on a different note clean it up with changing the premissing and remove the /bin/bash

chmod +x /etc/asterisk/
exten => 0001,1,System(/etc/asterisk/

Only works if an appropriate shebang line is present. I’ve seen shell scripts where this is NOT the case, or where it was pointing to something not present on every system the script were intended to run on.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.