Hello, 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.
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.