I'm working on an IVR that gives the users the option (number 5 in the main menu) to dial by extension: exten => 5,1,Set(TIMEOUT(digit)=5) ; Dial Extension exten => 5,2,Set(TIMEOUT(response)=10) exten => 5,3,Background(LCL/prompt-60) exten => 5,4,WaitExten(15) When going option 5 you can dial some extensions such as 2802, it goes to the extension (all extens start with 28 on the system). However, just dialing something random like 2929 sends the caller to option 2 of the main menu or 1010 sends the caller to menu option 1 from the main menu. Dialing something like 8080 returns the user to the top of the main menu as defined by the exten => i of the main menu. How can I ensure that only valid extensions can be dialed and anything except a number starting with say 28 can be dialed? The entire IVR is: [lcl-ivr-main] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; This is the main number IVR menu system ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include => lcl-extensions exten => s,1,Answer exten => s,2,NoOp exten => s,3,NoOp exten => s,4,NoOp exten => s,5,Wait(1) exten => s,6,Background(LCL/prompt-00) ; You've reached xxxxx exten => s,7,Background(LCL/prompt-01) ; dial 1 for sales exten => s,8,Background(LCL/prompt-02) ; dial 2 for support exten => s,9,Background(LCL/prompt-03) ; dial 3 for accounts exten => s,10,Background(LCL/prompt-04) ; dial 4 for reception exten => s,11,Background(LCL/prompt-05) ; dial 5 to enter extension exten => s,12,Background(LCL/prompt-09) ; dial 9 to hear menu again exten => s,13,Set(TIMEOUT(digit)=5) exten => s,14,Set(TIMEOUT(response)=30) exten => s,15,WaitExten(15) ; ; exten => 1,1,Background(LCL/prompt-20) ; transfering to Sales exten => 1,2,Goto(lcl-extensions,2863,1) ; exten => 2,1,Background(LCL/prompt-30) ; transfering to Support exten => 2,2,Goto(lcl-extensions,2883,1) ; exten => 3,1,Background(LCL/prompt-40) ; transfering to Accounts exten => 3,2,Goto(lcl-extensions,2847,1) ; exten => 4,1,Background(LCL/prompt-50) ; transfering to Reception exten => 4,2,Goto(lcl-extensions,2856,1) ; exten => 5,1,Set(TIMEOUT(digit)=5) ; Dial Extension exten => 5,2,Set(TIMEOUT(response)=10) exten => 5,3,Background(LCL/prompt-60) exten => 5,4,WaitExten(15) ; exten => 9,1,Goto(s,7) ; Play menu again ; exten => i,1,Background(LCL/prompt-10) ; didn't understand, play menu again exten => i,2,Wait(1) exten => i,3,Goto(s,7) ; Return to menu after a time out ; exten => t,1,Goto(s,7) ; Return to menu after a time out -- Robert P. McKenzie, CSTA, MBCS | GammaRay Technical Services Ltd rmckenzi@rpmdp.com | rob@gammaray-tech.com http://www.uk-experience.com | http://www.gammaray-tech.com Fancy some fun? http://www.thewetwilly.com Ecademy Profile: http://www.ecademy.com/user/robertmckenzie
> When going option 5 you can dial some extensions such as 2802, it goes to the extension (all extens start with 28 on the > system). However, just dialing something random like 2929 sends the caller to option 2 of the main menu or 1010 sends > the caller to menu option 1 from the main menu. Dialing something like 8080 returns the user to the top of the main > menu as defined by the exten => i of the main menu. > > How can I ensure that only valid extensions can be dialed and anything except a number starting with say 28 can be dialed?Remove your include of extensions definition from you main menu (include => lcl-extensions) Change your option 5 to something like this: exten => 5,1,Goto(lcl-ivr-dialext,s,1) exten => 5,2,Hangup Now, create a new context to dial by extension [lcl-ivr-dialext] include => lcl-extensions exten => s,1,Set(TIMEOUT(digit)=5) ; Dial Extension exten => s,2,Set(TIMEOUT(response)=10) exten => s,3,Background(LCL/prompt-60) ; This prompt should tell to press * to return to the main menu exten => s,4,WaitExten(15) exten => *,1,Goto(lcl-ivr-main,s,7) ; Return to main menu exten => i,1,Playback(pbx-invalid) ; invalid exten exten => i,2,Wait(1) exten => i,3,Goto(s,3) ; Return to menu after a time out exten => t,1,Goto(lcl-ivr-main,s,7) ; Return to main menu after a time out hth
Brillian, thanks very much. I had actually tried the second context myself but looking back at my attempts I can see where I went wrong. Thanks again for the help. Cheers!!! Time Bandit wrote:>>When going option 5 you can dial some extensions such as 2802, it goes to the extension (all extens start with 28 on the >>system). However, just dialing something random like 2929 sends the caller to option 2 of the main menu or 1010 sends >>the caller to menu option 1 from the main menu. Dialing something like 8080 returns the user to the top of the main >>menu as defined by the exten => i of the main menu. >> >>How can I ensure that only valid extensions can be dialed and anything except a number starting with say 28 can be dialed? > > > Remove your include of extensions definition from you main menu > (include => lcl-extensions) > > Change your option 5 to something like this: > exten => 5,1,Goto(lcl-ivr-dialext,s,1) > exten => 5,2,Hangup > > Now, create a new context to dial by extension > > [lcl-ivr-dialext] > include => lcl-extensions > exten => s,1,Set(TIMEOUT(digit)=5) ; Dial Extension > exten => s,2,Set(TIMEOUT(response)=10) > exten => s,3,Background(LCL/prompt-60) ; This prompt should tell to > press * to return to the main menu > exten => s,4,WaitExten(15) > > exten => *,1,Goto(lcl-ivr-main,s,7) ; Return > to main menu > > exten => i,1,Playback(pbx-invalid) ; invalid exten > exten => i,2,Wait(1) > exten => i,3,Goto(s,3) ; Return to menu after > a time out > > exten => t,1,Goto(lcl-ivr-main,s,7) ; Return > to main menu after a time out > > hth > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Robert P. McKenzie, CSTA, MBCS | GammaRay Technical Services Ltd rmckenzi@rpmdp.com | rob@gammaray-tech.com http://www.uk-experience.com | http://www.gammaray-tech.com Fancy some fun? http://www.thewetwilly.com Ecademy Profile: http://www.ecademy.com/user/robertmckenzie