[sipphones]
exten => 6968,1,Macro(support|phone1)
exten => 6969,1,Macro(support|phone2)
[macro-stdexten]
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
[macro-support]
;Arg1=Extension
;0 "Unknown", Valid, but unknown state
;1 "Not in use", Not used
;2 "In use", In use
;3 "Busy", Busy
;4 "Invalid", Invalid - not known to Asterisk
;5 "Unavailable", Unavailable (not registred)
;6 "Ringing", "Ring, ring, ring"
exten => s,1,ChanIsAvail(SIP/${ARG1}|s)
exten => s,2,NoOp(Channel ${ARG1} has a status of ${AVAILSTATUS})
exten => s,3,Goto(s-${AVAILSTATUS},1)
exten => s,103,NoOp(Channel ${ARG1} has a status of ${AVAILSTATUS})
;exten => s-1,1,Dial(Sip/${ARG1},60) ;Channel is available
;exten => s-1,n,Goto(s-${DIALSTATUS}) ;We still want fail over.
exten => s-1,1,Macro(stdexten|${Arg1}|SIP/${Arg1})
exten => s-2,1,Answer()
exten => s-2,n,Set(Timeout=30)
exten => s-2,n,Wait(1)
exten => s-2,n,Festival("That user is on the phone")
;exten => s-2,n,Background(useronphone)
exten => s-2,n,Festival("Press 1 to wait for that user")
;exten => s-2,n,Background(press1towait)
exten => s-2,n,Festival("Press 2 to wait in the support queue and wait for another support technician.")
;exten => s-2,n,Background(press2forqueue)
exten => s-2,n,Festival("Press 3 to leave a voice mail message.")
;exten => s-2,n,Background(press3forvm)
exten => s-2,n,Festival("Press 4 to induce a high level of voltage from the user's handset directly into their brain, forcing them to hangup so they will be available to take your call.")
exten => s-2,n,Wait(10)
exten => s-3,1,Goto(s-2,1)
exten => s-5,1,Goto(s-2,1)
exten => s-4,1,Playback(somethingiswrong)
exten => s-4,n,Playback(tt-weasels)
exten => s-4,n,Playback(thankyouforcalling)
exten => s-4,n,Playback(goodbye)
exten => s-4,n,Hangup()
exten => s-0,1,Macro(stdexten|${Arg1}|SIP/${Arg1})
exten => 1,1,Queue(q${Arg1})
exten => 2,1,macro(support-tree)
exten => 3,1,Voicemail(u${Arg1})
exten => 3,n,Hangup()
[macro-support-tree]
exten => s,1,Answer()
exten => s,n,Set(Timeout=30)
exten => s,n,Wait(1)
exten => s,n,Background(press1forwinops)
exten => s,n,Background(press2forpershing)
exten => s,n,Background(press3foralbridge)
exten => s,n,Background(press4forinvestigo)
exten => s,n,Background(press5foremail)
exten => s,n,Background(press6foritsupport)
exten => s,n,Wait(10)
exten => 1,1,SetCIDName("WinOps Support"|a)
exten => 1,n,Goto(s-queueme)
exten => 2,1,SetCIDName("Pershing Support"|a)
exten => 2,n,Goto(s-queueme)
exten => 3,1,SetCIDName("Albridge Support"|a)
exten => 3,n,Goto(s-queueme)
exten => 4,1,SetCIDName("Investigo Support"|a)
exten => 4,n,Goto(s-queueme)
exten => 5,1,SetCIDName("Email Support"|a)
exten => 5,n,Goto(s-queueme)
exten => 6,1,SetCIDName("IT Support"|a)
exten => 6,n,Goto(s-queueme)
exten => s-queueme,1,Queue(support|n)
*******Calls********
-- Executing Macro("SIP/phone2-bc417db0", "support|phone1") in new stack
-- Executing ChanIsAvail("SIP/phone2-bc417db0", "SIP/phone1|s") in new stack
-- Executing NoOp("SIP/phone2-bc417db0", "Channel phone1 has a status of 0") in new stack
-- Executing Goto("SIP/phone2-bc417db0", "s-0|1") in new stack
-- Goto (macro-support,s-0,1)
-- Executing Macro("SIP/phone2-bc417db0", "stdexten|phone1|SIP/phone1") in new stack
-- Executing Dial("SIP/phone2-bc417db0", "SIP/phone1|20") in new stack
-- Called phone1
-- SIP/phone1-0075fcf0 is ringing
== Spawn extension (macro-stdexten, s, 1) exited non-zero on 'SIP/phone2-bc417db0' in macro 'stdexten'
== Spawn extension (macro-stdexten, s, 1) exited non-zero on 'SIP/phone2-bc417db0' in macro 'support'
== Spawn extension (macro-stdexten, s, 1) exited non-zero on 'SIP/phone2-bc417db0'
-- Executing NoOp("SIP/phone1-bc417db0", "") in new stack
-- Executing SetVar("SIP/phone1-bc417db0", "ALERT_INFO=Bellcore-dr1") in new stack
-- Executing SetCIDName("SIP/phone1-bc417db0", "Support Queue") in new stack
-- Executing NoOp("SIP/phone1-bc417db0", "") in new stack
-- Executing Queue("SIP/phone1-bc417db0", "support|n") in new stack
-- Started music on hold, class 'default', on channel 'SIP/phone1-bc417db0'
-- Executing Macro("SIP/phone2-bc41d5d0", "support|phone1") in new stack
-- Executing ChanIsAvail("SIP/phone2-bc41d5d0", "SIP/phone1|s") in new stack
== Spawn extension (macro-support, s, 1) exited non-zero on 'SIP/phone2-bc41d5d0' in macro 'support'
== Spawn extension (macro-support, s, 1) exited non-zero on 'SIP/phone2-bc41d5d0'
-- Exiting on time-out cycle
-- Stopped music on hold on SIP/phone1-bc417db0
-- Executing VoiceMail("SIP/phone1-bc417db0", "u4910") in new stack
Nov 3 17:15:25 WARNING[17942]: app_voicemail.c:2412 leave_voicemail: No entry in voicemail config file for '4910'