I’m wanting to use the above with FreePBX - is that possible - using the GUI still but just inserting the agi-mqtt into /etc/asterisk/extensions_custom.conf ? Will it break every time I amend something in the GUI?
To be clear, I want to still manage everything about my Asterisk from the GUI, with the exception of passing incoming call info silently to MQTT. IF that’s possible?!
Instructions
Edit /etc/asterisk/extensions_custom.conf and add: [from-pstn-custom] exten => _X.,1,AGI(/opt/agi-mqtt/mqtt,/opt/agi-mqtt/mqtt.cfg,calls/pstn-in)
Thanks, Dicko, and I can make those changes to extensions_custom and I can continue to manage the rest of my setup using the GUI and it won’t overwrite or wreck things?
Hmmm, so far, unless I’m doing something wrong (I’ve made the script executable) - I can see no evidence that Asterisk is even looking at my /etc/asterisk/extensions_custom.conf file. Do I need to do any kind of reboot after modifying the file? I clicked the big red rebuild button in the GUI but that doesn’t seem to have helped.
There’s nothing in the Asterisk log that suggests the file is even being parsed.
Sorry to be a pain…
Thanks for that @PitzKey - & sorry @dicko - have replaced with a proper paste from the log. For interest, piping to pastebin didn’t work, but I installed pastebinit, and that worked.
Executing [01639628847@from-trunk:1] AGI("SIP/1-pstn-00000016", "/opt/agi-mqtt/mqtt,/opt/agi-mqtt/mqtt.cfg,calls/pstn-in") in new stack
-- Launched AGI Script /opt/agi-mqtt/mqtt
-- <SIP/1-pstn-00000016>AGI Script /opt/agi-mqtt/mqtt completed, returning 0
however my broker is showing NO attempted connections from the script/pi. This is probably the limit of where this wonderful forum can help really. I’ve reached out to the developer but he’s not responded yet. I use no authentication on my MQTT broker and I’m not sure how to do that with this script. I’ve left the fields in the config file totally blank but that doesn’t seem to be doing the trick. Oh well, it was great to get this far and I’m sure with a bit more fiddling I’ll get all the way.
The only other thing I can think of is that I am running node-red on the same Pi - and listening out for MQTT commands on that - perhaps they might not be able to be run concurrently?