How to add 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 just plays Hello world when called:
extensions_custom.conf
[from-internal-additional-custom]
exten => 999,1,Answer()
exten => 999,n,Wait(1)
exten => 999,n,Playback(hello-world)
exten => 999,n,Wait(1)
exten => 999,n,Hangup()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.
How the dialplan routing works
Note that we have added this in the [from-internal-additional-custom] context, which is included at the beginning of the [from-internal-additional] context by FreePBX in extensions_additional.conf:
extensions_additional.conf
[from-internal-additional]
include => from-internal-additional-customThe [from-internal-additional] context in turn is included in [from-internal]. In other words, our custom extension999 will be active for all phones calling from the[from-internal] context - which is, by default, all internal extensions.
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