1
votes

I installed Asterisk 13 on Raspberry Pi 3 and recently I'm trying to call Python script from Asterisk dialplan. The script contains email sending function and call of that function. I put it in /var/lib/asterisk/agi-bin/ and I gave permission to execute with chmod 777 to whole folder. In dialplan I've got this simply example: exten => 190,1,AGI(sendemail.py). When I try to call this extension I'm receiving error like that:

Executing [190@default:1] AGI("SIP/1235-00000003", "sendemail.py") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/sendemail.py sendemail.py: Failed to execute '/var/lib/asterisk/agi-bin/sendemail.py': No such file or directory -- Auto fallthrough, channel 'SIP/1235-00000003' status is 'UNKNOWN'

What does mean "No such file or directory"? I just want to execute python script from asterisk dialplan, nothing more. We are not talking about programming asterisk from python. From console level of RPi python script works well. When I do the same with bash file: exten => 88,1,AGI(/home/pi/opendoor.sh) it executes without any error! Opendoor script is changing state of GPIO pin to turn on/off relay for door.

Any help would be appreciated.

1
Maybe asterisk don't has read rights and execute rights. Make sure that file exists.os11k

1 Answers

0
votes

Maybe you have to add a trailing space in the first line of your script: http://sysout.twoday.net/stories/1022617818/