The System menu
System Menu;******************************************************************** ; BEGIN - System Menu ;******************************************************************** ; ; [system-menu-main] ; ; provide user access to their voice mail inbox ; let user leave voice mail for another user ; provide user access to find me ; ; 1 = user gets voice mail ; 2 = user leaves voice mail for another user ; 3 = user tracks down another user at any number ; 4 = user performs menu diagnostics ; ; exten => s,1,Background(custom/system-menu) exten => s,2,NoOp exten => s,3,Background(custom/your-voicemail) exten => s,4,Background(custom/leave-voicemail) exten => s,5,Background(custom/find-me) exten => s,6,Background(custom/system-menu-diag) exten => s,7,Background(custom/2repeat) ; play the menu messages exten => s,8,Background(custom/2hangup) ; play the menu messages exten => s,9,DigitTimeout,1 ; give them 1 seconds between digits exten => s,10,ResponseTimeout,60 ; give them 60 seconds to make a choice ; exten => _1,1,Goto(select-get-vmail-by-name,s,1) ; exten => _2,1,Goto(select-vmail-by-name,s,1) ; exten => _3,1,Goto(select-find-by-name,s,1) ; exten => _4,1,Goto(menu-diag,s,1) ; ; Repeat the previous menu exten => *,1,Goto(s,1) ; ; #=hangup exten => #,1,Background(goodbye) exten => #,2,NoOp exten => #,3,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Wait(1) exten => i,3,Goto(s,1) ; ; [menu-diag] ; ; ; select via menu ; 1 = house-day ; 2 = house-night ; 3 = office-day ; 4 = office-night ; 5 = transfer-to-extension-by-name ; 6 = transfer-to-voicemail-by-name ; 7 = user-access-to-voicemail-by-name ; 8 = transfer-to-remote-phone-1 ; 9 = transfer-to-remote-phone-2 ; 0 = round-robin-find-me ; exten => s,1,Background(custom/this-function-offers) exten => s,2,Background(silence/1) ; exten => s,3,Background(custom/house-line) exten => s,4,Background(custom/day-time-menu-select) exten => s,5,Background(custom/press-the) exten => s,6,Background(custom/one-key) exten => s,7,Background(silence/1) ; exten => s,8,NoOp exten => s,9,NoOp exten => s,10,NoOp exten => s,11,NoOp exten => s,12,NoOp exten => s,13,NoOp ; exten => s,14,Background(custom/house-line) exten => s,15,Background(custom/night-time-menu-select) exten => s,16,Background(custom/press-the) exten => s,17,Background(custom/two-key) exten => s,18,Background(silence/1) ; exten => s,19,Background(custom/office-line) exten => s,20,Background(custom/day-time-menu-select) exten => s,21,Background(custom/press-the) exten => s,22,Background(custom/three-key) exten => s,23,Background(silence/1) ; exten => s,24,Background(custom/office-line) exten => s,25,Background(custom/night-time-menu-select) exten => s,26,Background(custom/press-the) exten => s,27,Background(custom/four-key) exten => s,28,Background(silence/1) ; exten => s,29,NoOp exten => s,30,NoOp exten => s,31,NoOp exten => s,32,NoOp ; exten => s,33,Background(custom/inbound-find) exten => s,34,Background(custom/press-the) exten => s,35,Background(custom/six-key) exten => s,36,Background(silence/1) ; exten => s,37,Background(custom/inbound-find) exten => s,38,Background(custom/press-the) exten => s,39,Background(custom/seven-key) exten => s,40,Background(silence/1) ; exten => s,41,Background(custom/2repeat) ; play the menu messages exten => s,42,Background(custom/2return) ; play the menu messages exten => s,43,Background(silence/1) exten => s,44,DigitTimeout,1 ; give them 1 seconds between digits exten => s,45,ResponseTimeout,60 ; give them 60 seconds to make a choice ; exten => _1,1,Goto(house-day,s,4) ; exten => _2,1,Goto(house-night,s,4) ; exten => _3,1,Goto(office-day,s,4) ; exten => _4,1,Goto(office-night,s,4) ; exten => _5,1,Goto(select-ext-by-name,s,1) ; exten => _6,1,Goto(select-vmail-by-name,s,1) ; exten => _7,1,Goto(select-get-vmail-by-name,s,1) ; exten => _8,1,Goto(select-remote1-by-name,s,1) ; exten => _9,1,Goto(select-remote2-by-name,s,1) ; exten => _0,1,Goto(select-find-by-name,s,1) ; ; Repeat the previous menu exten => *,1,Goto(s,1) ; ; #=hangup exten => #,1,NoOp exten => #,2,Goto(${FLOWCONTROL}) ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Wait(1) exten => i,3,Goto(s,1) ; ; ;******************************************************************** ; END - System Menu ;******************************************************************** ; ; ;************************************************************* ; BEGIN - Route by user name contexts ;************************************************************* ; ; [select-ext-by-name] ; ; Transfer inbound call to user's internal extension ; exten => s,1,SetGlobalVar(FLOWCONTROL=select-ext-by-name,s,5) exten => s,2,Background(custom/emergency-menu-announce) exten => s,3,Background(custom/trans-to-cell-announce) exten => s,4,Goto(set-vars-by-name,s,1) exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:12) exten => s,6,GotoIf($[${LEN(${EXT})} < 2]?7:8) exten => s,7,Goto(i,1) exten => s,8,GotoIf($[${LEN(${EXT})} > 2]?9:12) exten => s,9 Dial(${EXT},${SHORTTIMEOUT}) exten => s,10,VoiceMail(u${VM}) exten => s,11,Goto(s,16) ; exten => s,12,NoOp exten => s,13,Macro(pana-announce,${EXT},${NMFILE},${RINGINGLINE}) exten => s,14,Macro(pana-announce,${PAGE},${NMFILE},${RINGINGLINE}) exten => s,15,VoiceMail(u${VM}) exten => s,16,Background(goodbye) exten => s,17,Hangup ; ; returns here on a busy SIP extension ; exten => s,101,VoiceMail(b${VM}) exten => s,102,Background(goodbye) exten => s,103,Hangup ; ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [select-vmail-by-name] ; ; Transfer inbound call to user's voice mail ; exten => s,1,Background(custom/emergency-menu-announce) exten => s,2,Background(custom/trans-to-cell-announce) exten => s,3,SetGlobalVar(FLOWCONTROL=select-vmail-by-name,s,5) exten => s,4,Goto(set-vars-by-name,s,1) exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:7) exten => s,6,VoiceMail(u${VM}) exten => s,7,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [select-get-vmail-by-name] ; ; Local user retrieves voice mail ; exten => s,1,Background(custom/emergency-menu-announce) exten => s,2,Background(custom/trans-to-cell-announce) exten => s,3,SetGlobalVar(FLOWCONTROL=select-get-vmail-by-name,s,5) exten => s,4,Goto(set-vars-by-name,s,1) exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:7) exten => s,6,VoiceMailMain(${VM}) exten => s,7,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [select-remote1-by-name] ; ; Transfer inbound call to user's first remote (cell) number ; exten => s,1,Background(custom/emergency-menu-announce) exten => s,2,Background(custom/trans-to-cell-announce) exten => s,3,SetGlobalVar(FLOWCONTROL=select-remote1-by-name,s,5) exten => s,4,Goto(set-vars-by-name,s,1) exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:10) exten => s,6,Background(custom/standby-for-cell-bridge) exten => s,7,Background(${NMFILE}) exten => s,8,Macro(pstn-sip-iax,${REM1},${SHORTTIMEOUT},RT) exten => s,9,VoiceMail(u${VM}) exten => s,10,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [select-remote2-by-name] ; ; Transfer inbound call to user's second remote (home) number ; exten => s,1,Background(custom/emergency-menu-announce) exten => s,2,Background(custom/trans-to-cell-announce) exten => s,3,SetGlobalVar(FLOWCONTROL=select-remote2-by-name,s,5) exten => s,4,Goto(set-vars-by-name,s,1) exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:10) exten => s,6,Background(custom/standby-for-cell-bridge) exten => s,7,Background(${NMFILE}) exten => s,8,Macro(pstn-sip-iax,${REM2},${SHORTTIMEOUT},RT) exten => s,9,VoiceMail(u${VM}) exten => s,10,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [select-find-by-name] ; ; ; Locate a user ; First try local extension ; Second try a page all ; Third try remote phone 1 ; Fourth try remote phone 2 ; Fifth drop caller in voicemail ; exten => s,1,Background(custom/emergency-menu-announce) exten => s,2,Background(custom/trans-to-cell-announce) exten => s,3,SetGlobalVar(FLOWCONTROL=select-find-by-name,s,5) exten => s,4,Goto(set-vars-by-name,s,1) ; exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:31) ; exten => s,6,GotoIf($[${LEN(${EXT})} < 2]?18:8) exten => s,7,NoOp exten => s,8,Background(custom/standby-for-cell-bridge) exten => s,9,Background(${NMFILE}) exten => s,10,GotoIf($[${LEN(${EXT})} > 2]?11:13) ; exten => s,11 Dial(${EXT},${SHORTTIMEOUT}) exten => s,12,GotoIf($[${DIALSTATUS} = BUSY]?28:18) ; exten => s,13,Macro(pana-announce,${EXT},${NMFILE},${RINGINGLINE}) exten => s,14,GotoIf($[${FOUNDME} = BUSY]?28:15) ; exten => s,15,Background(custom/standby-for-cell-bridge) exten => s,16,Background(${NMFILE}) exten => s,17,Macro(pana-announce,${PAGE},${NMFILE},${RINGINGLINE}) ; exten => s,18,GotoIf($[${LEN(${REM1})} < 10]?23:19) exten => s,19,Background(custom/standby-for-cell-bridge) exten => s,20,Background(${NMFILE}) exten => s,21,Macro(pstn-sip-iax,${REM1},${SHORTTIMEOUT},RT) exten => s,22,GotoIf($[${FOUNDME} = BUSY]?28:23) ; exten => s,23,GotoIf($[${LEN(${REM2})} < 10]?30:24) exten => s,24,Background(custom/standby-for-cell-bridge) exten => s,25,Background(${NMFILE}) exten => s,26,Macro(pstn-sip-iax,${REM2},${SHORTTIMEOUT},RT) exten => s,27,GotoIf($[${FOUNDME} = BUSY]?28:30) ; exten => s,28,VoiceMail(b${VM}) exten => s,29,Goto(s,31) exten => s,30,VoiceMail(u${VM}) exten => s,31,Background(goodbye) exten => s,32,Hangup ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,Goto(s,1) ; ; [set-vars-by-name] ; ; exten => s,1,SetGlobalVar(ReturnTo=${FLOWCONTROL}) exten => s,2,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s,2) exten => s,3,SetGlobalVar(FLOWCONFIRM=foo) exten => s,4,Background(custom/begin-process-by-name) ; exten => s,5,Background(custom/2repeat) exten => s,6,Background(custom/2return) ; exten => s,7,DigitTimeout,2 ; give them 2 seconds between digits exten => s,8,ResponseTimeout,30 ; give them 30 seconds to make a choice ; ; include => set-global-vars ; ; ; get confirmation of selection ; ; Macro returns with FLOWCONFIRM set ; to either PROCEED or ABORT code ; exten => s-CONFIRM,1,SetGlobalVar(FLOWCONFIRM=foo) exten => s-CONFIRM,2,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s-CONFIRM,5) exten => s-CONFIRM,3,SetGlobalVar(CONFIRM=${NMFILE}) exten => s-CONFIRM,4,Goto(confirmation,s,1) exten => s-CONFIRM,5,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s,4) exten => s-CONFIRM,6,Goto(s-${FLOWCONFIRM},1) ; exten => s-PROCEED,1,SetGlobalVar(FLOWCONTROL=${ReturnTo})) exten => s-PROCEED,2,Goto(${FLOWCONTROL}) ; ; the caller aborted the selection process ; loop them back to the top and let them ; try again ; ; ABORT = confirmation process ended with a rejection of selection exten => s-ABORT,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting exten => s-ABORT,2,SetGlobalVar(VM=${DEFVM}) exten => s-ABORT,3,SetGlobalVar(ID=${DEFCID}) exten => s-ABORT,4,SetGlobalVar(EXT=${DEFEXTEN}) exten => s-ABORT,5,SetGlobalVar(REM1=${DEFREM1}) exten => s-ABORT,6,SetGlobalVar(REM2=${DEFREM2}) exten => s-ABORT,7,SetGlobalVar(NMFILE=${DEFNMFILE}) exten => s-ABORT,8,SetGlobalVar(FLOWCONFIRM=foo) exten => s-ABORT,9,Goto(${FLOWCONTROL}) ; let them make another selection ; ; somehow we got back with an invalid ; selection. loop back and let them ; try again. ; ; INVALID = invalid key while making confirmation ; exten => s-INVALID,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting exten => s-INVALID,2,SetGlobalVar(VM=${DEFVM}) exten => s-INVALID,3,SetGlobalVar(ID=${DEFCID}) exten => s-INVALID,4,SetGlobalVar(EXT=${DEFEXTEN}) exten => s-INVALID,5,SetGlobalVar(REM1=${DEFREM1}) exten => s-INVALID,6,SetGlobalVar(REM2=${DEFREM2}) exten => s-INVALID,7,SetGlobalVar(NMFILE=${DEFNMFILE}) exten => s-INVALID,8,SetGlobalVar(FLOWCONFIRM=foo) exten => s-INVALID,9,Background(custom/select-invalid-try-again) exten => s-INVALID,10,Goto(${FLOWCONTROL}) ; ; ; foo = something odd happend during the selection process ; exten => s-foo,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting exten => s-foo,2,SetGlobalVar(VM=${DEFVM}) exten => s-foo,3,SetGlobalVar(ID=${DEFCID}) exten => s-foo,4,SetGlobalVar(EXT=${DEFEXTEN}) exten => s-foo,5,SetGlobalVar(REM1=${DEFREM1}) exten => s-foo,6,SetGlobalVar(REM2=${DEFREM2}) exten => s-foo,7,SetGlobalVar(NMFILE=${DEFNMFILE}) exten => s-foo,8,Background(something-Usr2bly-wrong) exten => s-foo,9,Goto({FLOWCONTROL}) ; loop back to selections ; ; TIMEOUT = timed out making confirmation ; exten => s-TIMEOUT,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting exten => s-TIMEOUT,2,SetGlobalVar(VM=${DEFVM}) exten => s-TIMEOUT,3,SetGlobalVar(ID=${DEFCID}) exten => s-TIMEOUT,4,SetGlobalVar(EXT=${DEFEXTEN}) exten => s-TIMEOUT,5,SetGlobalVar(REM1=${DEFREM1}) exten => s-TIMEOUT,6,SetGlobalVar(REM2=${DEFREM2}) exten => s-TIMEOUT,7,SetGlobalVar(NMFILE=${DEFNMFILE}) exten => s-TIMEOUT,8,SetGlobalVar(FLOWCONFIRM=foo) exten => s-TIMEOUT,9,Background(custom/select-invalid-try-again) exten => s-TIMEOUT,10,Goto(${FLOWCONTROL}) ; exten => s-CLEANEXIT,1,SetGlobalVar(FLOWCONFIRM=foo) ; set vars back to default setting exten => s-CLEANEXIT,2,SetGlobalVar(ReturnTo=foo) exten => s-CLEANEXIT,3,SetGlobalVar(NM=${DEFCIDNAME}) exten => s-CLEANEXIT,4,SetGlobalVar(VM=${DEFVM}) exten => s-CLEANEXIT,5,SetGlobalVar(ID=${DEFCID}) exten => s-CLEANEXIT,6,SetGlobalVar(EXT=${DEFEXTEN}) exten => s-CLEANEXIT,7,SetGlobalVar(REM1=${DEFREM1}) exten => s-CLEANEXIT,8,SetGlobalVar(REM2=${DEFREM2}) exten => s-CLEANEXIT,9,SetGlobalVar(NMFILE=${DEFNMFILE}) exten => s-CLEANEXIT,10,SetGlobalVar(FOUNDME=foo) exten => s-CLEANEXIT,11,SetGlobalVar(FLOWCONTROL=${ReturnTo}) exten => s-CLEANEXIT,12,SetGlobalVar(ReturnTo=) exten => s-CLEANEXIT,13,Goto(${FLOWCONTROL}) ; exten => s-.,1,Goto(s-foo,1) ; ; Repeat the previous menu exten => *,1,Goto(${FLOWCONTROL}) exten => *,2,Goto(s-CLEANEXIT,1) ; ; # = hangup/abort return to calling process exten => #,1,SetGlobalVar(FLOWCONTROL=${ReturnTo}) exten => #,2,SetGlobalVar(ReturnTo= ) exten => #,3,Goto(${FLOWCONTROL}) exten => #,4,Goto(s-CLEANEXIT,1) ; exten => t,1,Goto(i,1) ; If they take too long, give up ; exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again" exten => i,2,NoOp exten => i,3,Goto(${FLOWCONTROL}) exten => i,4,Goto(s-CLEANEXIT,1) ; ; [confirmation] ; ; simple yes/no, go/no-go decision routine ; ; enter with ; ; ARG1 = sound file name describing the item selected that ; requires confirmation ; ; returns with FLOWCONFIRM set to ; PROCEED - selection confirmed ; ABORT - want to make another selection ; TIMEOUT - took to much time with a simple decision ; exten => s,1,Background(custom/you-selected) exten => s,2,Background(${CONFIRM}) exten => s,3,Background(silence/1) exten => s,4,Background(custom/confirm-about-selection) ; exten => s,5,DigitTimeout,1 ; give them 1 seconds between digits exten => s,6,ResponseTimeout,5 ; give them 5 seconds to make a choice ; ; * = Confirm selection exten => *,1,SetGlobalVar(FLOWCONFIRM=PROCEED) exten => *,2,NoOp(${FLOWCONFIRM}) exten => *,3,Goto(${FLOWCONTROL}) ; ; # = Reject selection exten => #,1,SetGlobalVar(FLOWCONFIRM=ABORT) exten => #,2,NoOp(${FLOWCONFIRM}) exten => #,3,Goto(${FLOWCONTROL}) ; ; t=timeout exten => t,1,SetGlobalVar(FLOWCONFIRM=TIMEOUT) exten => t,2,NoOp(${FLOWCONFIRM}) exten => t,3,Goto(${FLOWCONTROL}) ; ; i=invalid selection exten => i,1,Background(custom/select-invalid-try-again) exten => i,2,Goto(s,1) ; invalid choice, loop them back ; ; ;************************************************************* ; END - Route by user name contexts ;************************************************************* ; ; |
手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )
GMT-8, 2026-10-12 02:37 , Processed in 0.006135 second(s), 18 queries .
Supported by BestDeal Online X5.0
© 2001-2026 Discuz! Team.