Script bash on call not work


I have a script that work calling it manually it in bash.
I have done a lot of tests and I have no mistakes to use a Dialplan that execute a bash script.
I view in Asterisk the result of the “echo” command in the script file.

(cd /home/pi/FOLDER && ./script “arg1,arg2”)

ALL TEST IN extensions.conf
exten => 201,1,NoOp(${CALLERID} ${DATETIME})
exten => 201,2,System(/var/lib/asterisk/scripts/
exten => 201,2,Set(result=${SHELL(/var/lib/asterisk/scripts/})
exten => 201,2,System(sudo -u asterisk /var/lib/asterisk/scripts/
exten => 201,2,TrySystem(/var/lib/asterisk/scripts/
exten => 201,2,AGI(
exten => 201,2,System(/bin/bash /var/lib/asterisk/scripts/
exten => 201,2,System(exec /var/lib/asterisk/scripts/
exten => 201,2,System(echo “test” >> /var/log/asterisk/calls)

I have not other ideas.

What diagnostics do you get when you turn up verbosity and debugging?

Is the script executable and the path traversable to the user running Asterisk?

Does the script have SELINUX tagging that is incompatible.


I’ve solved, the problem was a permission on a file called from script.

Thank you for your help.