exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})})
exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start
exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,Return() ; If they press #, return to start
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return()
[stdPrivacyexten]
; Standard extension subroutine:
; ${ARG1} - Extension
; ${ARG2} - Device(s) to ring
; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
; ${ARG5} - Context in voicemail (if empty, then "default")
exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten)
exten => _X.,n,Set(LOCAL(ext)=${ARG1})
exten => _X.,n,Set(LOCAL(dev)=${ARG2})
exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3})
exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4})
exten => _X.,n,Set(LOCAL(cntx)=${ARG5})
exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening
; option (or use P for databased call _X.creening)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start
exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
exten => stdexten-BUSY,n,Return() ; If they press #, return to start
exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite "Don't call again" script.
exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script.
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return
[macro-page];
; ${ARG1} - Device to page
exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call
exten => s,n,GoToIf($[${AVAILSTATUS} = "1"]?autoanswer:fail)
exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!!
exten => s,n,Dial(${ARG1})
exten => s,n(fail),Hangup
[demo]
include => stdexten
exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(CHANNEL(language)=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations
exten => 1000,1,Goto(default,s,1)
exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
; (but skip if channel is not up)
exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}) )
exten => 1234,n,Goto(default,s,1) ; exited Voicemail
exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
exten => 1236,1,Dial(Console/dsp) ; Ring forever
exten => 1236,n,Voicemail(1234,b) ; Unless busy
exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
exten => #,n,Hangup ; Hang them up.
exten => t,1,Goto(#,1) ; If they take too long, give up
exten => i,1,Playback(invalid) ; "That's not valid, try again"
exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
exten => 500,n,Goto(s,6) ; Return to the start over message.
exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
exten => 600,n,Echo ; Do the echo test
exten => 600,n,Playback(demo-echodone) ; Let them know it's over
exten => 600,n,Goto(s,6) ; Start over
exten => 76245,1,Macro(page,SIP/Grandstream1)
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
exten => 7999,1,Set(TIMEOUT(absolute)=60)
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
exten => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)
;exten => 1265,1,Dial(Phone/phone0,15)
;exten => 1265,n,Goto(s,5)
[page]
exten => _X.,1,Macro(page,SIP/${EXTEN})
;[mainmenu]
;exten => s,1,Answer
;exten => s,n,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
;exten => s,n,WaitExten
;exten => 1,1,Goto(submenu,s,1)
;exten => 2,1,Hangup
;include => default
;[submenu]
;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
;exten => s,n,Wait,2
;exten => s,n,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
;exten => s,n,WaitExten
;exten => 1,1,Goto(default,steve,1)
;exten => 2,1,Goto(default,mark,2)
[public]
; ATTENTION: If your Asterisk is connected to the internet and you do
; not have allowguest=no in sip.conf, everybody out there may use your
; public context without authentication. In that case you want to
; double check which services you offer to the world.
;
include => demo
[default]
[local]
exten => _1XX, 1, Dial(SIP/${EXTEN}, 15) ; Compose 101 appelle franky etc
exten => _1XX, n, VoiceMail(${EXTEN}) ; Voicemail apres 15 secondes
exten => 90,1,VoiceMailMain(${CALLERID(num)}) ; Messagerie
exten => 300, 1, Meetme(300)
include => demo
;exten => _41X.,1,Dial(SIP/${FILTER(0-9,${EXTEN:2})}@sipprovider,,r)
;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1(Joe Schmoe) ; Channel hints for presence
;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer
;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed
;exten => 6245,n,Voicemail(6245,u) ; Voicemail (unavailable)
;exten => 6245,s+1,Hangup ; s+1, same as n
;exten => 6245,dial+101,Voicemail(6245,b) ; Voicemail (busy)
;exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit
;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14)
;exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels
;exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman.
;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK}
;exten => 6275,1,Gosub(${EXTEN},stdexten(${MARK}))
; assuming ${MARK} is something like DAHDI/2
;exten => 6275,n,Goto(default,s,1) ; exited Voicemail
;exten => mark,1,Goto(6275,1) ; alias mark to 6275
;exten => 6536,1,Gosub(${EXTEN},stdexten(${WIL}))
; Ditto for wil
;exten => 6536,n,Goto(default,s,1) ; exited Voicemail
;exten => wil,1,Goto(6236,1)
;exten => 6600,hint,park:701@parkedcalls
;exten => 6600,1,noop
; You can also monitor the status of a queue by providing a hint for a
; particular queue name.
;exten => 8502,hint,Queue:markq
;exten => 8502,1,Queue(markq)
;To subscribe to the availability of a free member in the 'markq' queue.
;Note: '_avail' is added to the QueueName
;exten => 8501,hint,Queue:markq_avail
;exten => 8501,1,Queue(markq)
; Some other handy things are an extension for checking voicemail via
; voicemailmain
;exten => 8500,1,VoicemailMain
;exten => 8500,n,Hangup
;exten => 8600,1,Meetme(1234)
;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
;[acme-incoming]
;exten => s,1,Wait(1)
;exten => s,n,Answer()
;exten => s,n(menu),Playback(acme/vm-brief-menu)
;exten => s,n(exten),Background(vm-enter-num-to-call)
;exten => s,n,WaitExten(5)
;exten => s,n(goodbye),Playback(vm-goodbye)
;exten => s,n(end),Hangup()
;include => acme-extens
;exten => i,1,Playback(vm-invalid)
;exten => i,n,Goto(s,exten) ; optionally, transfer to operator
;exten => t,1,Goto(s,goodbye)
; this is the context our internal SIP hardphones use (see sip.conf)
;[acme-internal]
;exten => s,1,Answer()
;exten => s,n(exten),Background(vm-enter-num-to-call)
;exten => s,n,WaitExten(5)
;exten => s,n(goodbye),Playback(vm-goodbye)
;exten => s,n(end),Hangup()
;include => trunkint
;include => trunkld
;include => trunklocal
;include => acme-extens
;exten => 777,1,DISA(no-password,acme-incoming)
;[acme-extens]
;include => stdexten
;exten => 111,1,Gosub(111,stdexten(SIP/pete_1,acme))
;exten => 111,n,Goto(s,exten)
;exten => 112,1,Gosub(112,stdexten(SIP/nancy_1,acme))
;exten => 112,n,Goto(s,end)