Sunday, 24 September 2017

Manage FreePBX calls in custom dial plan of Asterisk


How to get FreePBX incoming call to custom dial plan of asterisk

Sometimes we need to route incoming call from FreeePBX to custom dial plan of Asterisk server. For that we can make custom destination in FreePBX, below is information given how to create custom destination,


Create Custom Incoming Destination in FreePBX

To create custom destination login in FreePBX and goto Admin->Custom Destinations as shown below


Now fill form as shown below and submit it followed by Apply config button to take changes in effect

Above in Target field we placed mycustom-context,s,1 which is the context we can receive in extensions_custom.conf file as below,

[mycustom-context]
exten => s,1,Answer()
same => n,Verbose(This is my Test Custom Context)
same => n,Playback(hello-world)
same => n,Hangup()


just add above in, nano /etc/asterisk/extensions_custom.conf and save it, then reload

dialplan reload


Once, we created custom context and added dial plan as above we can patch Inbound route to this custom context

Add Inbound route as below, click on Connectivity -> Inbound Routes













Add inbound route description and your DID number to match incoming call, set destination to Custom Destinations application and it will let you set your created custom destination in above steps. Submit and apply config.




How to get FreePBX outgoing call to custom dial plan of asterisk

Suppose we created outbound route in FreePBX, but then we need some customizations to do with call, then we can manage that via below custom dial plan. We can receive Freepbx outbound call to this custom context [from-internal-custom]
Add below code in, nano /etc/asterisk/extensions_custom.conf and save it, then reload

[from-internal-custom]
exten => _9X.,1,Answer()
same => n,Verbose(This is custom outbound route)
same => n,Dial(SIP/OutboundTrunk/${EXTEN:1})

dialplan reload

No comments:

Post a Comment