text
stringlengths
0
152
[MainMenu]
exten => s,1,Verbose(1, Caller ${CALLERID(all)} has entered the auto attendant)
same => n,Answer()
; this sets the inter-digit timer
same => n,Set(TIMEOUT(digit)=2)
; wait one second to establish audio
same => n,Wait(1)
; If Mon-Fri 9-5 goto label daygreeting
same => n,GotoIfTime(9:00-17:00,mon-fri,*,*?daygreeting:afterhoursgreeting)
same => n(afterhoursgreeting),Background(nightgreeting) ; AFTER HOURS GREETING
Building Your AA
|
255
same => n,Goto(menuprompt)
same => n(daygreeting),Background(daygreeting) ; DAY GREETING
same => n,Goto(menuprompt)
same => n(menuprompt),Background(mainmenu) ; MAIN MENU PROMPT
same => n,WaitExten(4) ; more than 4 seconds is probably
; too much
same => n,Goto(0,1) ; Treat as if caller has pressed '0'
exten => 1,1,Verbose(1, Caller ${CALLERID(all)} has entered the sales queue)
same => n,Goto(sets,610,1) ; Sales Queue - see Chapter 13 for details
exten => 2,1,Verbose(1, Caller ${CALLERID(all)} has entered the service queue)
same => n,Goto(sets,611,1) ; Service Queue - see Chapter 13 for details
exten => 3,1,Verbose(1, Caller ${CALLERID(all)} has requested address and fax info)
same => n,Background(faxandaddress) ; Address and fax info
same => n,Goto(s,menuprompt) ; Take caller back to main menu prompt
exten => #,1,Verbose(1, Caller ${CALLERID(all)} is entering the directory)
same => n,Directory(default) ; Send the caller to the directory.
; Use InternalSets as the dialing context
exten => 0,1,Verbose(1, Caller ${CALLERID(all)} is calling the operator)
same => n,Goto(sets,611,1) ; Service Queue - see Chapter 13 for details
exten => i,1,Verbose(1, Caller ${CALLERID(all)} has entered an invalid selection)
same => n,Playback(invalid)
same => n,Goto(s,menuprompt)
exten => t,1,Verbose(1, Caller ${CALLERID(all)} has timed out)
same => n,Goto(0,1)
; You will want to have a pattern match for the various extensions
; that you'll allow external callers to dial
; BUT DON'T JUST INCLUDE THE LocalSets CONTEXT
; OR EXTERNAL CALLERS WILL BE ABLE TO MAKE CALLS OUT OF YOUR SYSTEM
; WHATEVER YOU DO HERE, TEST IT CAREFULLY TO ENSURE EXTERNAL CALLERS
; WILL NOT BE ABLE TO DO ANYTHING BUT DIAL INTERNAL EXTENSIONS
exten => _1XX,1,Verbose(1,Call to an extension starting with '1')
same => n,Goto(sets,${EXTEN},1)
Delivering Incoming Calls to the AA
Any call coming into the system will enter the dialplan in the context defined for
whatever channel the call arrives on. In many cases this will be a context named
[incoming], or [from-pstn], or something similar. The calls will arrive either with
an extension (as would be the case with a DID) or without one (which would be the
case with a traditional analog line).
Whatever the name of the context, and whatever the name of the extension, you will
want to send each incoming call to the menu.
256
|
Chapter 14: The Automated Attendant
[incoming] ; a DID coming in on a channel with
; context=incoming
exten => 4169671111,1,Goto(MainMenu,s,1)
Depending on how you configure your incoming channels, you will generally want to
use the Goto() application if you want to send the call to an AA. This is far neater
than just coding your whole AA in the incoming context.
Since we don’t have any incoming circuits in our lab,7 we’re going to create a simple
extension that’ll deliver us to our fancy new AA:
exten => 613,1,Noop()
same => n,Goto(MainMenu,s,1)
same => n,Hangup()
And that’s it! A simple automated attendant that is easy to manage, and will handle