Hello there! I’m a total n00b to FreePBX, but I am a decent web and systems programmer. I’m currently at the stage of attempting to figure out FreePBX / Asterisk via endless googling
What I’m trying to do
Set up an instance of FreePBX so that calls to a given number (say, 9001) results in playback of an MP3 file or stream to the caller, chosen at random from a list.
What I’ve tried so far
- Written a Python AGI script, using the pyst2 library, which returns an AGI command to run MP3Player and passes it a file path. Copied the script to
- Added the following block to
/etc/asterisk/extensions_custom.conf(which I just copypasted from a post on this forum about AGI scripting):
[agi-jukebox-trigger] exten => s,1,noop(entering context [agi-jukebox-trigger] in extensions_custom.conf) exten => s,n,AGI(jukebox.py) exten => s,n,Return
- Set up a Custom Destination in FreePBX admin with the following Target (again, just copied from the same post as above)
- Added a Custom Extension in FreePBX Admin > Applications > Extensions with the number 9001, and in the Advanced tab, set the Not Reachable Custom Destination to the Custom Destination set up above.
Where I’m stuck
It seems like neither my Python script, nor the entry in
extensions_custom.conf are executing. When I call 9001, I can see a reference to the dialplan entry in the logs, but I can’t see the
noop from the block in
extensions_custom.conf or one that I added to the Python script appear in the logs.
- Is there a better way of invoking the block in
extensions_custom.conf/ AGI script when a given number is dialled than my current bodge?
- What might be causing the block to not execute?
- What are some good debugging strategies that I can use so I don’t have to bother you all again?