Script bash on call not work


#1

Hi,

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.

SCRIPT CallRoom.sh
#!/bin/bash
(cd /home/pi/FOLDER && ./script “arg1,arg2”)

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

I have not other ideas.


#2

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.


#3

Hi,

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

Thank you for your help.