Monday, June 20, 2016

IVR for conference bridges with FreePBX in asterisk

This is a quick IVR to send callers to who want to access the conference bridges.

Create your bridges in FreePBX conference.

Send callers into your system to the number in the example below.  It will ask them the conference number they wish to join, then upon confirming the number, it will send them to the standard FreePBX code that is built by the system.

Its not perfect, if the user enters in a non existent conference bridge, when the system attempts to connect to it, and it doesn't exist, they get rudely hung up on.

open up your /etc/asterisk/extension_custom.conf file, find "FROM-INTERNAL-CUSTOM" and drop this code in and save your changes.

I created a Miscellaneous Destination in FreePBX and pointed it to 12345.  Then I pointed an inbound route for external callers, pointed it to this miscellaneous destinations and was done.


exten => 12345,1,Answer
exten => 12345,n(being),NoOp(&&& conference IVR called  &&&&&&)
exten => 12345,n,Read(confnumber,enter-conf-call-number,7,,1,10)
;enter the conference number they want to join.

exten => 12345,n,ExecIf($["${confnumber}"=""]?goto(from-internal-custom,12345,1))
;if user doesn't enter anything after 10 seconds, it restarts the script

exten => 12345,n,Playback(you-entered)
exten => 12345,n,SayDigits(${confnumber})
;plays back the conf number they entered

exten => 12345,n,Playback(if-this-is-correct-press)
exten => 12345,n,SayDigits(1)
exten => 12345,n,Read(digi,,1)
exten => 12345,n,ExecIf($["${digi}"="1"]?goto(ext-meetme,${confnumber},1))
;if they press 1 to confirm, then the script sends them to the normal spot in FREEPBX gui, passing the conf number to that script automatically

exten => 12345,n,goto(from-internal-custom,12345,1)