How to run HTTP request on call to extension using FreePBX
This post is based on our previous post How to add custom action on call to custom extension in FreePBX
In FreePBX, add the following config to /etc/asterisk/extensions_custom.conf in order to add a custom extension 999 that uses System() to run curlon a fixed URL.
extensions_custom.conf
[from-internal-additional-custom]
exten => 999,1,Answer()
exten => 999,n,Wait(1)
exten => 999,n,System(curl http://mydomain.com/myurl)
exten => 999,n,Wait(1)
exten => 999,n,Hangup()extensions_custom.conf
Don’t forget to reload Asterisk e.g. using the core reload command from the Administrator menu => Asterisk CLI in order for the changes to take effect.
For details on how [from-internal-additional-custom] works, see our previous post How to add action on call to custom extension in FreePBX
Check out similar posts by category:
FreePBX
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow