;--------------------------------------------------------------------------------;
;          Do NOT edit this file as it is auto-generated by FreePBX.             ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate.                                                         ;
;--------------------------------------------------------------------------------;
[globals]
CFDEVSTATE = TRUE
CAMPONTOGGLE = *84
DNDDEVSTATE = TRUE
FMDEVSTATE = TRUE
QUEDEVSTATE = TRUE
QUEUETOGGLE = *45
QUEUEPAUSETOGGLE = *46
DYNAMIC_FEATURES = apprecord
INTERCOMCODE = *80
ASTETCDIR = /etc/asterisk
ASTMODDIR = /usr/lib/asterisk/modules
ASTVARLIBDIR = /var/lib/asterisk
ASTAGIDIR = /var/lib/asterisk/agi-bin
ASTSPOOLDIR = /var/spool/asterisk
ASTRUNDIR = /var/run/asterisk
ASTLOGDIR = /var/log/asterisk
CWINUSEBUSY = true
AMPMGRUSER = admin
AMPMGRPASS = djklfjwr89fn4fhj89oejfgoj4594
AMPDBENGINE = mysql
AMPDBHOST = localhost
AMPDBNAME = asterisk
AMPDBUSER = phonedaemon
AMPDBPASS = cufhr38fhh78fg28f87
VMX_CONTEXT = from-internal
VMX_PRI = 1
VMX_TIMEDEST_CONTEXT = 
VMX_TIMEDEST_EXT = dovm
VMX_TIMEDEST_PRI = 1
VMX_LOOPDEST_CONTEXT = 
VMX_LOOPDEST_EXT = dovm
VMX_LOOPDEST_PRI = 1
MIXMON_DIR = 
MIXMON_POST = 
DIAL_OPTIONS = Ttr
TRUNK_OPTIONS = Tt
TRUNK_RING_TIMER = 300
MIXMON_FORMAT = wav
REC_POLICY = caller
RINGTIMER_DEFAULT = 15
TRANSFER_CONTEXT = from-internal-xfer
ASTVERSION = 13.3.0
ASTCHANDAHDI = 1
NULL = ""
OUT_1 = SIP/persephone
OUTCID_1 = "Persephone.io" <8447377374>
OUTMAXCHANS_1 = 
OUTFAIL_1 = 
OUTPREFIX_1 = 
OUTDISABLE_1 = off
OUTKEEPCID_1 = off
FORCEDOUTCID_1 = 
PREFIX_TRUNK_1 = 
OUT_2 = SIP/fpbx-1-n1rQBMZCJKdL
OUTCID_2 = 6033670551
OUTMAXCHANS_2 = 
OUTFAIL_2 = 
OUTPREFIX_2 = 
OUTDISABLE_2 = off
OUTKEEPCID_2 = off
FORCEDOUTCID_2 = 
PREFIX_TRUNK_2 = 
OUT_3 = SIP/fpbx-2-n1rQBMZCJKdL
OUTCID_3 = 6033670551
OUTMAXCHANS_3 = 
OUTFAIL_3 = 
OUTPREFIX_3 = 
OUTDISABLE_3 = off
OUTKEEPCID_3 = off
FORCEDOUTCID_3 = 
PREFIX_TRUNK_3 = 
ALLOW_SIP_ANON = no
SIPLANG = 
#include globals_custom.conf

;end of [globals]

[app-announcement-15]
include => app-announcement-15-custom
exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement JubaClosed)
exten => s,n,Playback(custom/JubaClosed1,noanswer)
exten => s,n,Goto(ext-local,vms2,1)

;--== end of [app-announcement-15] ==--;


[app-announcement-1]
include => app-announcement-1-custom
exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement Test)
exten => s,n,Playback(custom/MatisiaConfBridge,noanswer)
exten => s,n,Goto(app-blackhole,hangup,1)

;--== end of [app-announcement-1] ==--;


[app-announcement-12]
include => app-announcement-12-custom
exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement WSCClosedLVM)
exten => s,n,Playback(custom/WSCClosedVM,noanswer)
exten => s,n,Goto(ext-local,vms1996,1)

;--== end of [app-announcement-12] ==--;


[app-announcement-11]
include => app-announcement-11-custom
exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement WSCPLZLVM)
exten => s,n,Playback(custom/WSCPleaseLVM,noanswer)
exten => s,n,Goto(ext-local,vms1996,1)

;--== end of [app-announcement-11] ==--;


[app-announcement-13]
include => app-announcement-13-custom
exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement WSCVendor)
exten => s,n,Playback(custom/WSCVendor,noanswer)
exten => s,n,Goto(ext-local,vms1300,1)

;--== end of [app-announcement-13] ==--;


[app-blacklist]
include => app-blacklist-custom
exten => s,1,Macro(user-callerid,)

exten => *32,1,Goto(app-blacklist-last,s,1)

exten => *31,1,Goto(app-blacklist-remove,s,1)

exten => *30,1,Goto(app-blacklist-add,s,1)

;--== end of [app-blacklist] ==--;


[app-blacklist-check]
include => app-blacklist-check-custom
exten => s,1(check),GotoIf($["${BLACKLIST()}"="1"]?blacklisted)
exten => s,n,Set(CALLED_BLACKLIST=1)
exten => s,n,Return()
exten => s,n(blacklisted),Answer
exten => s,n,Wait(1)
exten => s,n,Zapateller()
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup

;--== end of [app-blacklist-check] ==--;


[app-blacklist-last]
include => app-blacklist-last-custom
exten => s,1,Answer
exten => s,n,Macro(user-callerid,)
exten => s,n,Wait(1)
exten => s,n,Set(lastcaller=${DB(CALLTRACE/${CALLERID(number)})})
exten => s,n,GotoIf($[ $[ "${lastcaller}" = "" ] | $[ "${lastcaller}" = "unknown" ] ]?noinfo)
exten => s,n,Playback(privacy-to-blacklist-last-caller&telephone-number)
exten => s,n,SayDigits(${lastcaller})
exten => s,n,Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=7)
exten => s,n,Playback(if-correct-press&digits/1)
exten => s,n,Goto(end)
exten => s,n(noinfo),Playback(unidentified-no-callback)
exten => s,n,Hangup
exten => s,n,Noop(Waiting for input)
exten => s,n(end),WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)

exten => 1,1,Set(DB(blacklist/${lastcaller})=1)
exten => 1,n,Playback(num-was-successfully)
exten => 1,n,Playback(added)
exten => 1,n,Wait(1)
exten => 1,n,Hangup

;--== end of [app-blacklist-last] ==--;


[app-blacklist-remove]
include => app-blacklist-remove-custom
exten => s,1,Answer
exten => s,n,Macro(user-callerid,)
exten => s,n,Wait(1)
exten => s,n,Playback(entr-num-rmv-blklist)
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=60)
exten => s,n,Read(blacknr,then-press-pound,,,,)
exten => s,n,SayDigits(${blacknr})
exten => s,n,Playback(if-correct-press&digits/1)
exten => s,n,Noop(Waiting for input)
exten => s,n(end),WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)

exten => 1,1,Noop(Deleting: blacklist/${blacknr} ${DB_DELETE(blacklist/${blacknr})})
exten => 1,n,Playback(num-was-successfully&removed)
exten => 1,n,Wait(1)
exten => 1,n,Hangup

;--== end of [app-blacklist-remove] ==--;


[app-blacklist-add]
include => app-blacklist-add-custom
exten => s,1,Answer
exten => s,n,Macro(user-callerid,)
exten => s,n,Wait(1)
exten => s,n,Set(NumLoops=0)
exten => s,n(start),Playback(enter-num-blacklist)
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=60)
exten => s,n,Read(blacknr,then-press-pound,,,,)
exten => s,n,SayDigits(${blacknr})
exten => s,n,Playback(if-correct-press&digits/1)
exten => s,n,Noop(Waiting for input)
exten => s,n(end),WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)

exten => 1,1,GotoIf($[ "${blacknr}" != ""]?:app-blacklist-add-invalid,s,1)
exten => 1,n,Set(DB(blacklist/${blacknr})=1)
exten => 1,n,Playback(num-was-successfully&added)
exten => 1,n,Wait(1)
exten => 1,n,Hangup

;--== end of [app-blacklist-add] ==--;


[app-blacklist-add-invalid]
include => app-blacklist-add-invalid-custom
exten => s,1,Set(NumLoops=$[${NumLoops} + 1])
exten => s,n,Playback(pm-invalid-option)
exten => s,n,GotoIf($[${NumLoops} < 3]?app-blacklist-add,s,start)
exten => s,n,Playback(goodbye)
exten => s,n,Hangup

;--== end of [app-blacklist-add-invalid] ==--;


[app-cf-toggle]
include => app-cf-toggle-custom
exten => *96,1,Answer
exten => *96,n,Wait(1)
exten => *96,n,Macro(user-callerid,)
exten => *96,n,Set(fromext=${AMPUSER})
exten => *96,n,GotoIf($["${DB(CF/${fromext})}" = ""]?activate:deactivate)
exten => *96,n(activate),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *96,n,GotoIf($["${toext}"=""]?activate)
exten => *96,n,Wait(1)
exten => *96,n(toext),Set(DB(CF/${fromext})=${toext})
exten => *96,n,Set(STATE=BUSY)
exten => *96,n,Gosub(app-cf-toggle,sstate,1())
exten => *96,n(hook_on),Playback(call-fwd-unconditional&for&extension)
exten => *96,n,SayDigits(${fromext})
exten => *96,n,Playback(is-set-to)
exten => *96,n,SayDigits(${toext})
exten => *96,n,Macro(hangupcall,)
exten => *96,n(setdirect),Answer
exten => *96,n,Wait(1)
exten => *96,n,Macro(user-callerid,)
exten => *96,n,Goto(toext)
exten => *96,n(deactivate),Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => *96,n,Set(STATE=NOT_INUSE)
exten => *96,n,Gosub(app-cf-toggle,sstate,1())
exten => *96,n(hook_off),Playback(call-fwd-unconditional&de-activated)
exten => *96,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-cf-toggle] ==--;


[app-cf-unavailable-prompt-on]
include => app-cf-unavailable-prompt-on-custom
exten => *95,1,Answer
exten => *95,n,Wait(1)
exten => *95,n,Macro(user-callerid,)
exten => *95,n,Read(fromext,call-fwd-no-ans&please-enter-your&extension&then-press-pound,,,,)
exten => *95,n,Set(fromext=${IF($["${fromext}"=""]?${AMPUSER}:${fromext})})
exten => *95,n,Wait(1)
exten => *95,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *95,n,GotoIf($["${toext}"=""]?startread)
exten => *95,n,Wait(1)
exten => *95,n,Set(DB(CFU/${fromext})=${toext})
exten => *95,n(hook_1),Playback(call-fwd-no-ans&for&extension)
exten => *95,n,SayDigits(${fromext})
exten => *95,n,Playback(is-set-to)
exten => *95,n,SayDigits(${toext})
exten => *95,n,Macro(hangupcall,)

exten => _*95.,1,Answer
exten => _*95.,n,Wait(1)
exten => _*95.,n,Macro(user-callerid,)
exten => _*95.,n,Set(fromext=${AMPUSER})
exten => _*95.,n,Set(toext=${EXTEN:3})
exten => _*95.,n,Set(DB(CFU/${fromext})=${toext})
exten => _*95.,n(hook_2),Playback(call-fwd-no-ans&for&extension)
exten => _*95.,n,SayDigits(${fromext})
exten => _*95.,n,Playback(is-set-to)
exten => _*95.,n,SayDigits(${toext})
exten => _*95.,n,Macro(hangupcall,)

;--== end of [app-cf-unavailable-prompt-on] ==--;


[app-cf-busy-prompting-on]
include => app-cf-busy-prompting-on-custom
exten => *94,1,Answer
exten => *94,n,Wait(1)
exten => *94,n,Macro(user-callerid,)
exten => *94,n,Read(fromext,call-fwd-on-busy&please-enter-your&extension&then-press-pound,,,,)
exten => *94,n,Set(fromext=${IF($["${fromext}"=""]?${AMPUSER}:${fromext})})
exten => *94,n,Wait(1)
exten => *94,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *94,n,GotoIf($["${toext}"=""]?startread)
exten => *94,n,Wait(1)
exten => *94,n,Set(DB(CFB/${fromext})=${toext})
exten => *94,n(hook_1),Playback(call-fwd-on-busy&for&extension)
exten => *94,n,SayDigits(${fromext})
exten => *94,n,Playback(is-set-to)
exten => *94,n,SayDigits(${toext})
exten => *94,n,Macro(hangupcall,)

exten => _*94.,1,Answer
exten => _*94.,n,Wait(1)
exten => _*94.,n,Macro(user-callerid,)
exten => _*94.,n,Set(fromext=${AMPUSER})
exten => _*94.,n,Set(toext=${EXTEN:3})
exten => _*94.,n,Set(DB(CFB/${fromext})=${toext})
exten => _*94.,n(hook_2),Playback(call-fwd-on-busy&for&extension)
exten => _*94.,n,SayDigits(${fromext})
exten => _*94.,n,Playback(is-set-to)
exten => _*94.,n,SayDigits(${toext})
exten => _*94.,n,Macro(hangupcall,)

;--== end of [app-cf-busy-prompting-on] ==--;


[app-cf-prompting-on]
include => app-cf-prompting-on-custom
exten => *93,1,Answer
exten => *93,n,Wait(1)
exten => *93,n,Macro(user-callerid,)
exten => *93,n,Read(fromext,call-fwd-unconditional&please-enter-your&extension&then-press-pound,,,,)
exten => *93,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *93,n,Wait(1)
exten => *93,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *93,n,GotoIf($["foo${toext}"="foo"]?startread)
exten => *93,n,Wait(1)
exten => *93,n,Set(DB(CF/${fromext})=${toext})
exten => *93,n,Set(STATE=BUSY)
exten => *93,n,Gosub(app-cf-prompting-on,sstate,1())
exten => *93,n(hook_1),Playback(call-fwd-unconditional&for&extension)
exten => *93,n,SayDigits(${fromext})
exten => *93,n,Playback(is-set-to)
exten => *93,n,SayDigits(${toext})
exten => *93,n,Macro(hangupcall,)

exten => _*93.,1,Answer
exten => _*93.,n,Wait(1)
exten => _*93.,n,Macro(user-callerid,)
exten => _*93.,n,Set(fromext=${AMPUSER})
exten => _*93.,n,Set(toext=${EXTEN:3})
exten => _*93.,n,Set(DB(CF/${fromext})=${toext})
exten => _*93.,n,Set(STATE=BUSY)
exten => _*93.,n,Gosub(app-cf-prompting-on,sstate,1())
exten => _*93.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*93.,n,SayDigits(${fromext})
exten => _*93.,n,Playback(is-set-to)
exten => _*93.,n,SayDigits(${toext})
exten => _*93.,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-cf-prompting-on] ==--;


[app-cf-busy-off-any]
include => app-cf-busy-off-any-custom
exten => *92,1,Answer
exten => *92,n,Macro(user-callerid,)
exten => *92,n,Wait(1)
exten => *92,n,Read(fromext,please-enter-your&extension&then-press-pound,,,,)
exten => *92,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *92,n,Wait(1)
exten => *92,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
exten => *92,n(hook_1),Playback(call-fwd-on-busy&for&extension)
exten => *92,n,SayDigits(${fromext})
exten => *92,n,Playback(cancelled)
exten => *92,n,Macro(hangupcall,)

;--== end of [app-cf-busy-off-any] ==--;


[app-cf-busy-off]
include => app-cf-busy-off-custom
exten => *91,1,Answer
exten => *91,n,Wait(1)
exten => *91,n,Macro(user-callerid,)
exten => *91,n,Set(fromext=${AMPUSER})
exten => *91,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
exten => *91,n(hook_1),Playback(call-fwd-on-busy&de-activated)
exten => *91,n,Macro(hangupcall,)

exten => _*91.,1,Answer
exten => _*91.,n,Wait(1)
exten => _*91.,n,Set(fromext=${EXTEN:3})
exten => _*91.,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
exten => _*91.,n(hook_2),Playback(call-fwd-on-busy&for&extension)
exten => _*91.,n,SayDigits(${fromext})
exten => _*91.,n,Playback(cancelled)
exten => _*91.,n,Macro(hangupcall,)

;--== end of [app-cf-busy-off] ==--;


[app-cf-busy-on]
include => app-cf-busy-on-custom
exten => *90,1,Answer
exten => *90,n,Wait(1)
exten => *90,n,Macro(user-callerid,)
exten => *90,n,Set(fromext=${AMPUSER})
exten => *90,n,GotoIf($["${fromext}"!=""]?startread)
exten => *90,n,Playback(agent-loggedoff)
exten => *90,n,Macro(hangupcall,)
exten => *90,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *90,n,GotoIf($["${toext}"=""]?startread)
exten => *90,n,Wait(1)
exten => *90,n,Set(DB(CFB/${fromext})=${toext})
exten => *90,n(hook_1),Playback(call-fwd-on-busy&for&extension)
exten => *90,n,SayDigits(${fromext})
exten => *90,n,Playback(is-set-to)
exten => *90,n,SayDigits(${toext})
exten => *90,n,Macro(hangupcall,)

exten => _*90.,1,Answer
exten => _*90.,n,Wait(1)
exten => _*90.,n,Macro(user-callerid,)
exten => _*90.,n,Set(fromext=${AMPUSER})
exten => _*90.,n,Set(toext=${EXTEN:3})
exten => _*90.,n,Set(DB(CFB/${fromext})=${toext})
exten => _*90.,n(hook_2),Playback(call-fwd-on-busy&for&extension)
exten => _*90.,n,SayDigits(${fromext})
exten => _*90.,n,Playback(is-set-to)
exten => _*90.,n,SayDigits(${toext})
exten => _*90.,n,Macro(hangupcall,)

;--== end of [app-cf-busy-on] ==--;


[app-cf-off-any]
include => app-cf-off-any-custom
exten => *74,1,Answer
exten => *74,n,Macro(user-callerid,)
exten => *74,n,Wait(1)
exten => *74,n,Read(fromext,please-enter-your&extension&then-press-pound,,,,)
exten => *74,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *74,n,Wait(1)
exten => *74,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => *74,n,Set(STATE=NOT_INUSE)
exten => *74,n,Gosub(app-cf-off-any,sstate,1())
exten => *74,n(hook_1),Playback(call-fwd-unconditional&for&extension)
exten => *74,n,SayDigits(${fromext})
exten => *74,n,Playback(cancelled)
exten => *74,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-cf-off-any] ==--;


[app-cf-off]
include => app-cf-off-custom
exten => *73,1,Answer
exten => *73,n,Wait(1)
exten => *73,n,Macro(user-callerid,)
exten => *73,n,Set(fromext=${AMPUSER})
exten => *73,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => *73,n,Set(STATE=NOT_INUSE)
exten => *73,n,Gosub(app-cf-off,sstate,1())
exten => *73,n(hook_1),Playback(call-fwd-unconditional&de-activated)
exten => *73,n,Macro(hangupcall,)

exten => _*73.,1,Answer
exten => _*73.,n,Wait(1)
exten => _*73.,n,Set(fromext=${EXTEN:3})
exten => _*73.,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => _*73.,n,Set(STATE=NOT_INUSE)
exten => _*73.,n,Gosub(app-cf-off,sstate,1())
exten => _*73.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*73.,n,SayDigits(${fromext})
exten => _*73.,n,Playback(cancelled)
exten => _*73.,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-cf-off] ==--;


[app-cf-on]
include => app-cf-on-custom
exten => *72,1,Answer
exten => *72,n,Wait(1)
exten => *72,n,Macro(user-callerid,)
exten => *72,n,Set(fromext=${AMPUSER})
exten => *72,n,GotoIf($["${fromext}"!=""]?startread)
exten => *72,n,Playback(agent-loggedoff)
exten => *72,n,Macro(hangupcall,)
exten => *72,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *72,n,GotoIf($["foo${toext}"="foo"]?startread)
exten => *72,n,Wait(1)
exten => *72,n,Set(DB(CF/${fromext})=${toext})
exten => *72,n,Set(STATE=BUSY)
exten => *72,n,Gosub(app-cf-on,sstate,1())
exten => *72,n(hook_1),Playback(call-fwd-unconditional&for&extension)
exten => *72,n,SayDigits(${fromext})
exten => *72,n,Playback(is-set-to)
exten => *72,n,SayDigits(${toext})
exten => *72,n,Macro(hangupcall,)

exten => _*72.,1,Answer
exten => _*72.,n,Wait(1)
exten => _*72.,n,Macro(user-callerid,)
exten => _*72.,n,Set(fromext=${AMPUSER})
exten => _*72.,n,Set(toext=${EXTEN:3})
exten => _*72.,n,Set(DB(CF/${fromext})=${toext})
exten => _*72.,n,Set(STATE=BUSY)
exten => _*72.,n,Gosub(app-cf-on,sstate,1())
exten => _*72.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*72.,n,SayDigits(${fromext})
exten => _*72.,n,Playback(is-set-to)
exten => _*72.,n,SayDigits(${toext})
exten => _*72.,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-cf-on] ==--;


[app-cf-unavailable-off]
include => app-cf-unavailable-off-custom
exten => *53,1,Answer
exten => *53,n,Wait(1)
exten => *53,n,Macro(user-callerid,)
exten => *53,n,Set(fromext=${AMPUSER})
exten => *53,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})})
exten => *53,n(hook_1),Playback(call-fwd-no-ans&de-activated)
exten => *53,n,Macro(hangupcall,)

exten => _*53.,1,Answer
exten => _*53.,n,Wait(1)
exten => _*53.,n,Set(fromext=${EXTEN:3})
exten => _*53.,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})})
exten => _*53.,n(hook_2),Playback(call-fwd-no-ans&for&extension)
exten => _*53.,n,SayDigits(${fromext})
exten => _*53.,n,Playback(cancelled)
exten => _*53.,n,Macro(hangupcall,)

;--== end of [app-cf-unavailable-off] ==--;


[app-cf-unavailable-on]
include => app-cf-unavailable-on-custom
exten => *52,1,Answer
exten => *52,n,Wait(1)
exten => *52,n,Macro(user-callerid,)
exten => *52,n,Set(fromext=${AMPUSER})
exten => *52,n,GotoIf($["${fromext}"!=""]?startread)
exten => *52,n,Playback(agent-loggedoff)
exten => *52,n,Macro(hangupcall,)
exten => *52,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *52,n,GotoIf($["${toext}"=""]?startread)
exten => *52,n,Wait(1)
exten => *52,n,Set(DB(CFU/${fromext})=${toext})
exten => *52,n(hook_1),Playback(call-fwd-no-ans&for&extension)
exten => *52,n,SayDigits(${fromext})
exten => *52,n,Playback(is-set-to)
exten => *52,n,SayDigits(${toext})
exten => *52,n,Macro(hangupcall,)

exten => _*52.,1,Answer
exten => _*52.,n,Wait(1)
exten => _*52.,n,Macro(user-callerid,)
exten => _*52.,n,Set(fromext=${AMPUSER})
exten => _*52.,n,Set(toext=${EXTEN:3})
exten => _*52.,n,Set(DB(CFU/${fromext})=${toext})
exten => _*52.,n(hook_2),Playback(call-fwd-no-ans&for&extension)
exten => _*52.,n,SayDigits(${fromext})
exten => _*52.,n,Playback(is-set-to)
exten => _*52.,n,SayDigits(${toext})
exten => _*52.,n,Macro(hangupcall,)

;--== end of [app-cf-unavailable-on] ==--;


[ext-cf-hints]
include => ext-cf-hints-custom
exten => *96100,1,Goto(app-cf-toggle,*96,1)
exten => *96100,hint,Custom:DEVCF100

exten => _*96100.,1,Set(toext=${EXTEN:6})
exten => _*96100.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96101,1,Goto(app-cf-toggle,*96,1)
exten => *96101,hint,Custom:DEVCF101

exten => _*96101.,1,Set(toext=${EXTEN:6})
exten => _*96101.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96102,1,Goto(app-cf-toggle,*96,1)
exten => *96102,hint,Custom:DEVCF102

exten => _*96102.,1,Set(toext=${EXTEN:6})
exten => _*96102.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96103,1,Goto(app-cf-toggle,*96,1)
exten => *96103,hint,Custom:DEVCF103

exten => _*96103.,1,Set(toext=${EXTEN:6})
exten => _*96103.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96104,1,Goto(app-cf-toggle,*96,1)
exten => *96104,hint,Custom:DEVCF104

exten => _*96104.,1,Set(toext=${EXTEN:6})
exten => _*96104.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96105,1,Goto(app-cf-toggle,*96,1)
exten => *96105,hint,Custom:DEVCF105

exten => _*96105.,1,Set(toext=${EXTEN:6})
exten => _*96105.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96106,1,Goto(app-cf-toggle,*96,1)
exten => *96106,hint,Custom:DEVCF106

exten => _*96106.,1,Set(toext=${EXTEN:6})
exten => _*96106.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96108,1,Goto(app-cf-toggle,*96,1)
exten => *96108,hint,Custom:DEVCF108

exten => _*96108.,1,Set(toext=${EXTEN:6})
exten => _*96108.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96109,1,Goto(app-cf-toggle,*96,1)
exten => *96109,hint,Custom:DEVCF109

exten => _*96109.,1,Set(toext=${EXTEN:6})
exten => _*96109.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96110,1,Goto(app-cf-toggle,*96,1)
exten => *96110,hint,Custom:DEVCF110

exten => _*96110.,1,Set(toext=${EXTEN:6})
exten => _*96110.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96113,1,Goto(app-cf-toggle,*96,1)
exten => *96113,hint,Custom:DEVCF113

exten => _*96113.,1,Set(toext=${EXTEN:6})
exten => _*96113.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96124,1,Goto(app-cf-toggle,*96,1)
exten => *96124,hint,Custom:DEVCF124

exten => _*96124.,1,Set(toext=${EXTEN:6})
exten => _*96124.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961300,1,Goto(app-cf-toggle,*96,1)
exten => *961300,hint,Custom:DEVCF1300

exten => _*961300.,1,Set(toext=${EXTEN:7})
exten => _*961300.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961301,1,Goto(app-cf-toggle,*96,1)
exten => *961301,hint,Custom:DEVCF1301

exten => _*961301.,1,Set(toext=${EXTEN:7})
exten => _*961301.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96130199,1,Goto(app-cf-toggle,*96,1)
exten => *96130199,hint,Custom:DEVCF130199

exten => _*96130199.,1,Set(toext=${EXTEN:9})
exten => _*96130199.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961302,1,Goto(app-cf-toggle,*96,1)
exten => *961302,hint,Custom:DEVCF1302

exten => _*961302.,1,Set(toext=${EXTEN:7})
exten => _*961302.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961303,1,Goto(app-cf-toggle,*96,1)
exten => *961303,hint,Custom:DEVCF1303

exten => _*961303.,1,Set(toext=${EXTEN:7})
exten => _*961303.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961304,1,Goto(app-cf-toggle,*96,1)
exten => *961304,hint,Custom:DEVCF1304

exten => _*961304.,1,Set(toext=${EXTEN:7})
exten => _*961304.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961305,1,Goto(app-cf-toggle,*96,1)
exten => *961305,hint,Custom:DEVCF1305

exten => _*961305.,1,Set(toext=${EXTEN:7})
exten => _*961305.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961306,1,Goto(app-cf-toggle,*96,1)
exten => *961306,hint,Custom:DEVCF1306

exten => _*961306.,1,Set(toext=${EXTEN:7})
exten => _*961306.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961307,1,Goto(app-cf-toggle,*96,1)
exten => *961307,hint,Custom:DEVCF1307

exten => _*961307.,1,Set(toext=${EXTEN:7})
exten => _*961307.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961308,1,Goto(app-cf-toggle,*96,1)
exten => *961308,hint,Custom:DEVCF1308

exten => _*961308.,1,Set(toext=${EXTEN:7})
exten => _*961308.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961309,1,Goto(app-cf-toggle,*96,1)
exten => *961309,hint,Custom:DEVCF1309

exten => _*961309.,1,Set(toext=${EXTEN:7})
exten => _*961309.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961310,1,Goto(app-cf-toggle,*96,1)
exten => *961310,hint,Custom:DEVCF1310

exten => _*961310.,1,Set(toext=${EXTEN:7})
exten => _*961310.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961311,1,Goto(app-cf-toggle,*96,1)
exten => *961311,hint,Custom:DEVCF1311

exten => _*961311.,1,Set(toext=${EXTEN:7})
exten => _*961311.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961312,1,Goto(app-cf-toggle,*96,1)
exten => *961312,hint,Custom:DEVCF1312

exten => _*961312.,1,Set(toext=${EXTEN:7})
exten => _*961312.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96197,1,Goto(app-cf-toggle,*96,1)
exten => *96197,hint,Custom:DEVCF197

exten => _*96197.,1,Set(toext=${EXTEN:6})
exten => _*96197.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96198,1,Goto(app-cf-toggle,*96,1)
exten => *96198,hint,Custom:DEVCF198

exten => _*96198.,1,Set(toext=${EXTEN:6})
exten => _*96198.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96199,1,Goto(app-cf-toggle,*96,1)
exten => *96199,hint,Custom:DEVCF199

exten => _*96199.,1,Set(toext=${EXTEN:6})
exten => _*96199.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961996,1,Goto(app-cf-toggle,*96,1)
exten => *961996,hint,Custom:DEVCF1996

exten => _*961996.,1,Set(toext=${EXTEN:7})
exten => _*961996.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961997,1,Goto(app-cf-toggle,*96,1)
exten => *961997,hint,Custom:DEVCF1997

exten => _*961997.,1,Set(toext=${EXTEN:7})
exten => _*961997.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961998,1,Goto(app-cf-toggle,*96,1)
exten => *961998,hint,Custom:DEVCF1998

exten => _*961998.,1,Set(toext=${EXTEN:7})
exten => _*961998.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *961999,1,Goto(app-cf-toggle,*96,1)
exten => *961999,hint,Custom:DEVCF1999

exten => _*961999.,1,Set(toext=${EXTEN:7})
exten => _*961999.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962,1,Goto(app-cf-toggle,*96,1)
exten => *962,hint,Custom:DEVCF2

exten => _*962.,1,Set(toext=${EXTEN:4})
exten => _*962.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962071,1,Goto(app-cf-toggle,*96,1)
exten => *962071,hint,Custom:DEVCF2071

exten => _*962071.,1,Set(toext=${EXTEN:7})
exten => _*962071.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962072,1,Goto(app-cf-toggle,*96,1)
exten => *962072,hint,Custom:DEVCF2072

exten => _*962072.,1,Set(toext=${EXTEN:7})
exten => _*962072.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962073,1,Goto(app-cf-toggle,*96,1)
exten => *962073,hint,Custom:DEVCF2073

exten => _*962073.,1,Set(toext=${EXTEN:7})
exten => _*962073.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962074,1,Goto(app-cf-toggle,*96,1)
exten => *962074,hint,Custom:DEVCF2074

exten => _*962074.,1,Set(toext=${EXTEN:7})
exten => _*962074.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962075,1,Goto(app-cf-toggle,*96,1)
exten => *962075,hint,Custom:DEVCF2075

exten => _*962075.,1,Set(toext=${EXTEN:7})
exten => _*962075.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962605,1,Goto(app-cf-toggle,*96,1)
exten => *962605,hint,Custom:DEVCF2605

exten => _*962605.,1,Set(toext=${EXTEN:7})
exten => _*962605.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962607,1,Goto(app-cf-toggle,*96,1)
exten => *962607,hint,Custom:DEVCF2607

exten => _*962607.,1,Set(toext=${EXTEN:7})
exten => _*962607.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *962608,1,Goto(app-cf-toggle,*96,1)
exten => *962608,hint,Custom:DEVCF2608

exten => _*962608.,1,Set(toext=${EXTEN:7})
exten => _*962608.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *963,1,Goto(app-cf-toggle,*96,1)
exten => *963,hint,Custom:DEVCF3

exten => _*963.,1,Set(toext=${EXTEN:4})
exten => _*963.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96700,1,Goto(app-cf-toggle,*96,1)
exten => *96700,hint,Custom:DEVCF700

exten => _*96700.,1,Set(toext=${EXTEN:6})
exten => _*96700.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96701,1,Goto(app-cf-toggle,*96,1)
exten => *96701,hint,Custom:DEVCF701

exten => _*96701.,1,Set(toext=${EXTEN:6})
exten => _*96701.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96702,1,Goto(app-cf-toggle,*96,1)
exten => *96702,hint,Custom:DEVCF702

exten => _*96702.,1,Set(toext=${EXTEN:6})
exten => _*96702.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96703,1,Goto(app-cf-toggle,*96,1)
exten => *96703,hint,Custom:DEVCF703

exten => _*96703.,1,Set(toext=${EXTEN:6})
exten => _*96703.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96704,1,Goto(app-cf-toggle,*96,1)
exten => *96704,hint,Custom:DEVCF704

exten => _*96704.,1,Set(toext=${EXTEN:6})
exten => _*96704.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96705,1,Goto(app-cf-toggle,*96,1)
exten => *96705,hint,Custom:DEVCF705

exten => _*96705.,1,Set(toext=${EXTEN:6})
exten => _*96705.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96706,1,Goto(app-cf-toggle,*96,1)
exten => *96706,hint,Custom:DEVCF706

exten => _*96706.,1,Set(toext=${EXTEN:6})
exten => _*96706.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96707,1,Goto(app-cf-toggle,*96,1)
exten => *96707,hint,Custom:DEVCF707

exten => _*96707.,1,Set(toext=${EXTEN:6})
exten => _*96707.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96709,1,Goto(app-cf-toggle,*96,1)
exten => *96709,hint,Custom:DEVCF709

exten => _*96709.,1,Set(toext=${EXTEN:6})
exten => _*96709.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96711,1,Goto(app-cf-toggle,*96,1)
exten => *96711,hint,Custom:DEVCF711

exten => _*96711.,1,Set(toext=${EXTEN:6})
exten => _*96711.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96712,1,Goto(app-cf-toggle,*96,1)
exten => *96712,hint,Custom:DEVCF712

exten => _*96712.,1,Set(toext=${EXTEN:6})
exten => _*96712.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96713,1,Goto(app-cf-toggle,*96,1)
exten => *96713,hint,Custom:DEVCF713

exten => _*96713.,1,Set(toext=${EXTEN:6})
exten => _*96713.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96714,1,Goto(app-cf-toggle,*96,1)
exten => *96714,hint,Custom:DEVCF714

exten => _*96714.,1,Set(toext=${EXTEN:6})
exten => _*96714.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96715,1,Goto(app-cf-toggle,*96,1)
exten => *96715,hint,Custom:DEVCF715

exten => _*96715.,1,Set(toext=${EXTEN:6})
exten => _*96715.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *968181,1,Goto(app-cf-toggle,*96,1)
exten => *968181,hint,Custom:DEVCF8181

exten => _*968181.,1,Set(toext=${EXTEN:7})
exten => _*968181.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *968182,1,Goto(app-cf-toggle,*96,1)
exten => *968182,hint,Custom:DEVCF8182

exten => _*968182.,1,Set(toext=${EXTEN:7})
exten => _*968182.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *968585,1,Goto(app-cf-toggle,*96,1)
exten => *968585,hint,Custom:DEVCF8585

exten => _*968585.,1,Set(toext=${EXTEN:7})
exten => _*968585.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *96991236,1,Goto(app-cf-toggle,*96,1)
exten => *96991236,hint,Custom:DEVCF991236

exten => _*96991236.,1,Set(toext=${EXTEN:9})
exten => _*96991236.,n,Goto(app-cf-toggle,*96,setdirect)

exten => *9699502,1,Goto(app-cf-toggle,*96,1)
exten => *9699502,hint,Custom:DEVCF99502

exten => _*9699502.,1,Set(toext=${EXTEN:8})
exten => _*9699502.,n,Goto(app-cf-toggle,*96,setdirect)

;--== end of [ext-cf-hints] ==--;


[sub-record-cancel]
include => sub-record-cancel-custom
exten => s,1,Return()

;--== end of [sub-record-cancel] ==--;


[sub-record-check]
include => sub-record-check-custom
exten => s,1,GotoIf($[${LEN(${FROMEXTEN})}]?initialized)
exten => s,n,Set(__REC_STATUS=INITIALIZED)
exten => s,n,Set(NOW=${EPOCH})
exten => s,n,Set(__DAY=${STRFTIME(${NOW},,%d)})
exten => s,n,Set(__MONTH=${STRFTIME(${NOW},,%m)})
exten => s,n,Set(__YEAR=${STRFTIME(${NOW},,%Y)})
exten => s,n,Set(__TIMESTR=${YEAR}${MONTH}${DAY}-${STRFTIME(${NOW},,%H%M%S)})
exten => s,n,Set(__FROMEXTEN=${IF($[${LEN(${AMPUSER})}]?${AMPUSER}:${IF($[${LEN(${REALCALLERIDNUM})}]?${REALCALLERIDNUM}:unknown)})})
exten => s,n,Set(__MON_FMT=${IF($["${MIXMON_FORMAT}"="wav49"]?WAV:${MIXMON_FORMAT})})
exten => s,n(initialized),Noop(Recordings initialized)
exten => s,n,ExecIf($[!${LEN(${ARG3})}]?Set(ARG3=dontcare))
exten => s,n,Set(REC_POLICY_MODE_SAVE=${REC_POLICY_MODE})
exten => s,n,ExecIf($["${BLINDTRANSFER}${ATTENDEDTRANSFER}" != ""]?Set(REC_STATUS=NO))
exten => s,n(next),GotoIf($[${LEN(${ARG1})}]?checkaction)
exten => s,n(recorderror),Playback(something-terribly-wrong,error)
exten => s,n,Hangup
exten => s,n(checkaction),GotoIf($[${DIALPLAN_EXISTS(sub-record-check,${ARG1})}]?sub-record-check,${ARG1},1)
exten => s,n,Noop(Generic ${ARG1} Recording Check - ${FROMEXTEN} ${ARG2})
exten => s,n,Gosub(recordcheck,1(${ARG3},${ARG1},${ARG2}))
exten => s,n,Return()

exten => recordcheck,1,Noop(Starting recording check against ${ARG1})
exten => recordcheck,n,Goto(${ARG1})
exten => recordcheck,n(dontcare),Return()
exten => recordcheck,n(always),Noop(Detected legacy "always" entry. Mapping to "force")
exten => recordcheck,n(force),Set(__REC_POLICY_MODE=FORCE)
exten => recordcheck,n,GotoIf($["${REC_STATUS}"!="RECORDING"]?startrec)
exten => recordcheck,n,Return()
exten => recordcheck,n(delayed),Noop(Detected legacy "delayed" entry. Mapping to "yes")
exten => recordcheck,n(yes),ExecIf($["${REC_POLICY_MODE}" = "NEVER" | "${REC_POLICY_MODE}" = "NO" | "${REC_STATUS}" = "RECORDING"]?Return())
exten => recordcheck,n,Set(__REC_POLICY_MODE=YES)
exten => recordcheck,n,Goto(startrec)
exten => recordcheck,n(no),Set(__REC_POLICY_MODE=NO)
exten => recordcheck,n,Return()
exten => recordcheck,n(never),Set(__REC_POLICY_MODE=NEVER)
exten => recordcheck,n,Goto(stoprec)
exten => recordcheck,n(startrec),Noop(Starting recording: ${ARG2}, ${ARG3})
exten => recordcheck,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => recordcheck,n,Set(__CALLFILENAME=${ARG2}-${ARG3}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID})
exten => recordcheck,n,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MON_FMT},ai(LOCAL_MIXMON_ID),${MIXMON_POST})
exten => recordcheck,n,Set(__MIXMON_ID=${LOCAL_MIXMON_ID})
exten => recordcheck,n,Set(__RECORD_ID=${CHANNEL(name)})
exten => recordcheck,n,Set(__REC_STATUS=RECORDING)
exten => recordcheck,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => recordcheck,n,Return()
exten => recordcheck,n(stoprec),Noop(Stopping recording: ${ARG2}, ${ARG3})
exten => recordcheck,n,Set(__REC_STATUS=STOPPED)
exten => recordcheck,n,System(/var/lib/asterisk/bin/stoprecording.php "${CHANNEL(name)}")
exten => recordcheck,n,Return()

exten => out,1,Noop(Outbound Recording Check from ${FROMEXTEN} to ${ARG2})
exten => out,n,Set(RECMODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/external)})
exten => out,n,ExecIf($[!${LEN(${RECMODE})} | "${RECMODE}" = "dontcare"]?Goto(routewins))
exten => out,n,ExecIf($["${ARG3}" = "never" | "${ARG3}" = "force"]?Goto(routewins))
exten => out,n(extenwins),Gosub(recordcheck,1(${RECMODE},out,${ARG2}))
exten => out,n,Return()
exten => out,n(routewins),Gosub(recordcheck,1(${ARG3},out,${ARG2}))
exten => out,n,Return()

exten => in,1,Noop(Inbound Recording Check to ${ARG2})
exten => in,n,Set(FROMEXTEN=unknown)
exten => in,n,ExecIf($[${LEN(${CALLERID(num)})}]?Set(FROMEXTEN=${CALLERID(num)}))
exten => in,n,Gosub(recordcheck,1(${ARG3},in,${ARG2}))
exten => in,n,Return()

exten => exten,1,Noop(Exten Recording Check between ${FROMEXTEN} and ${ARG2})
exten => exten,n,Set(CALLTYPE=${IF($[${LEN(${FROM_DID})}]?external:internal)})
exten => exten,n,ExecIf(${LEN(${CALLTYPE_OVERRIDE})}?Set(CALLTYPE=${CALLTYPE_OVERRIDE}))
exten => exten,n,Set(CALLEE=${DB(AMPUSER/${ARG2}/recording/in/${CALLTYPE})})
exten => exten,n,ExecIf($[!${LEN(${CALLEE})}]?Set(CALLEE=dontcare))
exten => exten,n,GotoIf($["${CALLTYPE}"="external"]?callee)
exten => exten,n,GotoIf($["${CALLEE}"="dontcare"]?caller)
exten => exten,n,ExecIf($[${LEN(${DB(AMPUSER/${FROMEXTEN}/recording/priority)})}]?Set(CALLER_PRI=${DB(AMPUSER/${FROMEXTEN}/recording/priority)}):Set(CALLER_PRI=0))
exten => exten,n,ExecIf($[${LEN(${DB(AMPUSER/${ARG2}/recording/priority)})}]?Set(CALLEE_PRI=${DB(AMPUSER/${ARG2}/recording/priority)}):Set(CALLEE_PRI=0))
exten => exten,n,GotoIf($["${CALLER_PRI}"="${CALLEE_PRI}"]?${REC_POLICY}:${IF($[${CALLER_PRI}>${CALLEE_PRI}]?caller:callee)})
exten => exten,n(callee),Gosub(recordcheck,1(${CALLEE},${CALLTYPE},${ARG2}))
exten => exten,n,Return()
exten => exten,n(caller),Set(RECMODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/internal)})
exten => exten,n,ExecIf($[!${LEN(${RECMODE})}]?Set(RECMODE=dontcare))
exten => exten,n,ExecIf($["${RECMODE}"="dontcare"]?Set(RECMODE=${CALLEE}))
exten => exten,n,Gosub(recordcheck,1(${RECMODE},${CALLTYPE},${ARG2}))
exten => exten,n,Return()

exten => conf,1,Noop(Conference Recording Check ${FROMEXTEN} to ${ARG2})
exten => conf,n,Gosub(recconf,1(${ARG2},${ARG2},${ARG3}))
exten => conf,n,Return()

exten => page,1,Noop(Paging Recording Check ${FROMEXTEN} to ${ARG2})
exten => page,n,GosubIf($["${REC_POLICY_MODE}"="always"]?recconf,1(${ARG2},${FROMEXTEN},${ARG3}))
exten => page,n,Return()

exten => recconf,1,Noop(Setting up recording: ${ARG1}, ${ARG2}, ${ARG3})
exten => recconf,n,Set(__CALLFILENAME=${IF($[${CONFBRIDGE_INFO(parties,${ARG2})}]?${DB(RECCONF/${ARG2})}:${ARG1}-${ARG2}-${ARG3}-${TIMESTR}-${UNIQUEID})})
exten => recconf,n,ExecIf($[!${CONFBRIDGE_INFO(parties,${ARG2})}]?Set(DB(RECCONF/${ARG2})=${CALLFILENAME}))
exten => recconf,n,Set(CONFBRIDGE(bridge,record_file)=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MON_FMT})
exten => recconf,n,ExecIf($["${ARG3}"!="always"]?Return())
exten => recconf,n,Set(CONFBRIDGE(bridge,record_conference)=yes)
exten => recconf,n,Set(__REC_STATUS=RECORDING)
exten => recconf,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => recconf,n,Return()

exten => recq,1,Noop(Setting up recording: ${ARG1}, ${ARG2}, ${ARG3})
exten => recq,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => recq,n,Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
exten => recq,n,MixMonitor(${MONITOR_FILENAME}.${MON_FMT},${MONITOR_OPTIONS},${MIXMON_POST})
exten => recq,n,Set(__REC_STATUS=RECORDING)
exten => recq,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => recq,n,Return()

exten => parking,1,Noop(User ${ARG2} picked up a parked call)
exten => parking,n,Set(USER=${ARG2})
exten => parking,n,ExecIf($[!${LEN(${ARG2})}]?Set(USER=unknown))
exten => parking,n,Set(RECMODE=${DB(AMPUSER/${ARG2}/recording/out/internal)})
exten => parking,n,ExecIf($[!${LEN(${RECMODE})}]?Set(RECMODE=dontcare))
exten => parking,n,Gosub(recordcheck,1(${RECMODE},parked,${USER}))
exten => parking,n,Return()

;--== end of [sub-record-check] ==--;


[macro-one-touch-record]
include => macro-one-touch-record-custom
exten => s,1,Set(ONETOUCH_REC_SCRIPT_STATUS=)
exten => s,n,System(/var/lib/asterisk/bin/one_touch_record.php "${CHANNEL(name)}")
exten => s,n,Noop(ONETOUCH_REC_SCRIPT_STATUS: [${ONETOUCH_REC_SCRIPT_STATUS}])
exten => s,n,ExecIf($["${REC_STATUS}"="RECORDING"]?Playback(beep))
exten => s,n,ExecIf($["${REC_STATUS}"="STOPPED"]?Playback(beep&beep))
exten => s,n,ExecIf($["${ONETOUCH_REC_SCRIPT_STATUS:0:6}"="DENIED"]?Playback(access-denied))
exten => s,n,MacroExit()

;--== end of [macro-one-touch-record] ==--;


[app-callwaiting-cwoff]
include => app-callwaiting-cwoff-custom
exten => *71,1,Answer
exten => *71,n,Wait(1)
exten => *71,n,Macro(user-callerid,)
exten => *71,n,Noop(Deleting: CW/${AMPUSER} ${DB_DELETE(CW/${AMPUSER})})
exten => *71,n(hook_1),Playback(call-waiting&de-activated)
exten => *71,n,Macro(hangupcall,)

;--== end of [app-callwaiting-cwoff] ==--;


[app-callwaiting-cwon]
include => app-callwaiting-cwon-custom
exten => *70,1,Answer
exten => *70,n,Wait(1)
exten => *70,n,Macro(user-callerid,)
exten => *70,n,Set(DB(CW/${AMPUSER})=ENABLED)
exten => *70,n(hook_1),Playback(call-waiting&activated)
exten => *70,n,Macro(hangupcall,)

;--== end of [app-callwaiting-cwon] ==--;


[app-campon-toggle]
include => app-campon-toggle-custom
exten => *84,1,Answer
exten => *84,n,Set(CCSS_SETUP=TRUE)
exten => *84,n,Macro(user-callerid,)
exten => *84,n,ExecIf($["${EXTENSION_STATE(*84${AMPUSER}@ext-local)}" = "INUSE"]?CallCompletionCancel():CallCompletionRequest())
exten => *84,n,Playback(beep)
exten => *84,n,Macro(hangupcall,)

;--== end of [app-campon-toggle] ==--;


[ext-local]
include => ext-local-custom
exten => *841,1,Goto(app-campon-toggle,*84,1)
exten => *841,hint,ccss:

exten => *842,1,Goto(app-campon-toggle,*84,1)
exten => *842,hint,ccss:SIP/2

exten => *843,1,Goto(app-campon-toggle,*84,1)
exten => *843,hint,ccss:SIP/3

exten => *84100,1,Goto(app-campon-toggle,*84,1)
exten => *84100,hint,ccss:SIP/100

exten => *84101,1,Goto(app-campon-toggle,*84,1)
exten => *84101,hint,ccss:SIP/101

exten => *84102,1,Goto(app-campon-toggle,*84,1)
exten => *84102,hint,ccss:SIP/102

exten => *84103,1,Goto(app-campon-toggle,*84,1)
exten => *84103,hint,ccss:SIP/103

exten => *84104,1,Goto(app-campon-toggle,*84,1)
exten => *84104,hint,ccss:SIP/104

exten => *84105,1,Goto(app-campon-toggle,*84,1)
exten => *84105,hint,ccss:SIP/105

exten => *84106,1,Goto(app-campon-toggle,*84,1)
exten => *84106,hint,ccss:SIP/106

exten => *84108,1,Goto(app-campon-toggle,*84,1)
exten => *84108,hint,ccss:SIP/108

exten => *84109,1,Goto(app-campon-toggle,*84,1)
exten => *84109,hint,ccss:SIP/109

exten => *84110,1,Goto(app-campon-toggle,*84,1)
exten => *84110,hint,ccss:SIP/110

exten => *84113,1,Goto(app-campon-toggle,*84,1)
exten => *84113,hint,ccss:SIP/113

exten => *84124,1,Goto(app-campon-toggle,*84,1)
exten => *84124,hint,ccss:SIP/124

exten => *84197,1,Goto(app-campon-toggle,*84,1)
exten => *84197,hint,ccss:SIP/197

exten => *84198,1,Goto(app-campon-toggle,*84,1)
exten => *84198,hint,ccss:SIP/198

exten => *84199,1,Goto(app-campon-toggle,*84,1)
exten => *84199,hint,ccss:SIP/199

exten => *84611,1,Goto(app-campon-toggle,*84,1)
exten => *84611,hint,ccss:

exten => *84700,1,Goto(app-campon-toggle,*84,1)
exten => *84700,hint,ccss:SIP/700

exten => *84701,1,Goto(app-campon-toggle,*84,1)
exten => *84701,hint,ccss:SIP/701

exten => *84702,1,Goto(app-campon-toggle,*84,1)
exten => *84702,hint,ccss:SIP/702

exten => *84703,1,Goto(app-campon-toggle,*84,1)
exten => *84703,hint,ccss:SIP/703

exten => *84704,1,Goto(app-campon-toggle,*84,1)
exten => *84704,hint,ccss:SIP/704

exten => *84705,1,Goto(app-campon-toggle,*84,1)
exten => *84705,hint,ccss:SIP/705

exten => *84706,1,Goto(app-campon-toggle,*84,1)
exten => *84706,hint,ccss:SIP/706

exten => *84707,1,Goto(app-campon-toggle,*84,1)
exten => *84707,hint,ccss:SIP/707

exten => *84709,1,Goto(app-campon-toggle,*84,1)
exten => *84709,hint,ccss:SIP/709

exten => *84711,1,Goto(app-campon-toggle,*84,1)
exten => *84711,hint,ccss:SIP/711

exten => *84712,1,Goto(app-campon-toggle,*84,1)
exten => *84712,hint,ccss:SIP/712

exten => *84713,1,Goto(app-campon-toggle,*84,1)
exten => *84713,hint,ccss:SIP/713

exten => *84714,1,Goto(app-campon-toggle,*84,1)
exten => *84714,hint,ccss:SIP/714

exten => *84715,1,Goto(app-campon-toggle,*84,1)
exten => *84715,hint,ccss:SIP/715

exten => *841300,1,Goto(app-campon-toggle,*84,1)
exten => *841300,hint,ccss:SIP/1300

exten => *841301,1,Goto(app-campon-toggle,*84,1)
exten => *841301,hint,ccss:SIP/1301

exten => *841302,1,Goto(app-campon-toggle,*84,1)
exten => *841302,hint,ccss:SIP/1302

exten => *841303,1,Goto(app-campon-toggle,*84,1)
exten => *841303,hint,ccss:SIP/1303

exten => *841304,1,Goto(app-campon-toggle,*84,1)
exten => *841304,hint,ccss:SIP/1304

exten => *841305,1,Goto(app-campon-toggle,*84,1)
exten => *841305,hint,ccss:SIP/1305

exten => *841306,1,Goto(app-campon-toggle,*84,1)
exten => *841306,hint,ccss:SIP/1306

exten => *841307,1,Goto(app-campon-toggle,*84,1)
exten => *841307,hint,ccss:SIP/1307

exten => *841308,1,Goto(app-campon-toggle,*84,1)
exten => *841308,hint,ccss:SIP/1308

exten => *841309,1,Goto(app-campon-toggle,*84,1)
exten => *841309,hint,ccss:SIP/1309

exten => *841310,1,Goto(app-campon-toggle,*84,1)
exten => *841310,hint,ccss:SIP/1310

exten => *841311,1,Goto(app-campon-toggle,*84,1)
exten => *841311,hint,ccss:SIP/1311

exten => *841312,1,Goto(app-campon-toggle,*84,1)
exten => *841312,hint,ccss:SIP/1312

exten => *841313,1,Goto(app-campon-toggle,*84,1)
exten => *841313,hint,ccss:

exten => *841996,1,Goto(app-campon-toggle,*84,1)
exten => *841996,hint,ccss:SIP/1996

exten => *841997,1,Goto(app-campon-toggle,*84,1)
exten => *841997,hint,ccss:SIP/1997

exten => *841998,1,Goto(app-campon-toggle,*84,1)
exten => *841998,hint,ccss:SIP/1998

exten => *841999,1,Goto(app-campon-toggle,*84,1)
exten => *841999,hint,ccss:SIP/1999

exten => *842071,1,Goto(app-campon-toggle,*84,1)
exten => *842071,hint,ccss:SIP/2071

exten => *842072,1,Goto(app-campon-toggle,*84,1)
exten => *842072,hint,ccss:SIP/2072

exten => *842073,1,Goto(app-campon-toggle,*84,1)
exten => *842073,hint,ccss:SIP/2073

exten => *842074,1,Goto(app-campon-toggle,*84,1)
exten => *842074,hint,ccss:SIP/2074

exten => *842075,1,Goto(app-campon-toggle,*84,1)
exten => *842075,hint,ccss:SIP/2075

exten => *842605,1,Goto(app-campon-toggle,*84,1)
exten => *842605,hint,ccss:SIP/2605

exten => *842607,1,Goto(app-campon-toggle,*84,1)
exten => *842607,hint,ccss:SIP/2607

exten => *842608,1,Goto(app-campon-toggle,*84,1)
exten => *842608,hint,ccss:SIP/2608

exten => *848181,1,Goto(app-campon-toggle,*84,1)
exten => *848181,hint,ccss:SIP/8181

exten => *848182,1,Goto(app-campon-toggle,*84,1)
exten => *848182,hint,ccss:SIP/8182

exten => *848585,1,Goto(app-campon-toggle,*84,1)
exten => *848585,hint,ccss:SIP/8585

exten => *84130199,1,Goto(app-campon-toggle,*84,1)
exten => *84130199,hint,ccss:SIP/130199

exten => *2,1,Macro(vm,2,DIRECTDIAL,${IVR_RETVM})
exten => *2,n,Goto(vmret,1)

exten => *100,1,Macro(vm,100,DIRECTDIAL,${IVR_RETVM})
exten => *100,n,Goto(vmret,1)

exten => *101,1,Macro(vm,101,DIRECTDIAL,${IVR_RETVM})
exten => *101,n,Goto(vmret,1)

exten => *102,1,Macro(vm,102,DIRECTDIAL,${IVR_RETVM})
exten => *102,n,Goto(vmret,1)

exten => *103,1,Macro(vm,103,DIRECTDIAL,${IVR_RETVM})
exten => *103,n,Goto(vmret,1)

exten => *104,1,Macro(vm,104,DIRECTDIAL,${IVR_RETVM})
exten => *104,n,Goto(vmret,1)

exten => *105,1,Macro(vm,105,DIRECTDIAL,${IVR_RETVM})
exten => *105,n,Goto(vmret,1)

exten => *109,1,Macro(vm,109,DIRECTDIAL,${IVR_RETVM})
exten => *109,n,Goto(vmret,1)

exten => *113,1,Macro(vm,113,DIRECTDIAL,${IVR_RETVM})
exten => *113,n,Goto(vmret,1)

exten => *199,1,Macro(vm,199,DIRECTDIAL,${IVR_RETVM})
exten => *199,n,Goto(vmret,1)

exten => *700,1,Macro(vm,700,DIRECTDIAL,${IVR_RETVM})
exten => *700,n,Goto(vmret,1)

exten => *701,1,Macro(vm,701,DIRECTDIAL,${IVR_RETVM})
exten => *701,n,Goto(vmret,1)

exten => *702,1,Macro(vm,702,DIRECTDIAL,${IVR_RETVM})
exten => *702,n,Goto(vmret,1)

exten => *703,1,Macro(vm,703,DIRECTDIAL,${IVR_RETVM})
exten => *703,n,Goto(vmret,1)

exten => *704,1,Macro(vm,704,DIRECTDIAL,${IVR_RETVM})
exten => *704,n,Goto(vmret,1)

exten => *705,1,Macro(vm,705,DIRECTDIAL,${IVR_RETVM})
exten => *705,n,Goto(vmret,1)

exten => *706,1,Macro(vm,706,DIRECTDIAL,${IVR_RETVM})
exten => *706,n,Goto(vmret,1)

exten => *707,1,Macro(vm,707,DIRECTDIAL,${IVR_RETVM})
exten => *707,n,Goto(vmret,1)

exten => *709,1,Macro(vm,709,DIRECTDIAL,${IVR_RETVM})
exten => *709,n,Goto(vmret,1)

exten => *711,1,Macro(vm,711,DIRECTDIAL,${IVR_RETVM})
exten => *711,n,Goto(vmret,1)

exten => *713,1,Macro(vm,713,DIRECTDIAL,${IVR_RETVM})
exten => *713,n,Goto(vmret,1)

exten => *1300,1,Macro(vm,1300,DIRECTDIAL,${IVR_RETVM})
exten => *1300,n,Goto(vmret,1)

exten => *1301,1,Macro(vm,1301,DIRECTDIAL,${IVR_RETVM})
exten => *1301,n,Goto(vmret,1)

exten => *1303,1,Macro(vm,1303,DIRECTDIAL,${IVR_RETVM})
exten => *1303,n,Goto(vmret,1)

exten => *1304,1,Macro(vm,1304,DIRECTDIAL,${IVR_RETVM})
exten => *1304,n,Goto(vmret,1)

exten => *1305,1,Macro(vm,1305,DIRECTDIAL,${IVR_RETVM})
exten => *1305,n,Goto(vmret,1)

exten => *1306,1,Macro(vm,1306,DIRECTDIAL,${IVR_RETVM})
exten => *1306,n,Goto(vmret,1)

exten => *1307,1,Macro(vm,1307,DIRECTDIAL,${IVR_RETVM})
exten => *1307,n,Goto(vmret,1)

exten => *1309,1,Macro(vm,1309,DIRECTDIAL,${IVR_RETVM})
exten => *1309,n,Goto(vmret,1)

exten => *1310,1,Macro(vm,1310,DIRECTDIAL,${IVR_RETVM})
exten => *1310,n,Goto(vmret,1)

exten => *1313,1,Macro(vm,1313,DIRECTDIAL,${IVR_RETVM})
exten => *1313,n,Goto(vmret,1)

exten => *1996,1,Macro(vm,1996,DIRECTDIAL,${IVR_RETVM})
exten => *1996,n,Goto(vmret,1)

exten => *1997,1,Macro(vm,1997,DIRECTDIAL,${IVR_RETVM})
exten => *1997,n,Goto(vmret,1)

exten => *1998,1,Macro(vm,1998,DIRECTDIAL,${IVR_RETVM})
exten => *1998,n,Goto(vmret,1)

exten => *1999,1,Macro(vm,1999,DIRECTDIAL,${IVR_RETVM})
exten => *1999,n,Goto(vmret,1)

exten => *2071,1,Macro(vm,2071,DIRECTDIAL,${IVR_RETVM})
exten => *2071,n,Goto(vmret,1)

exten => *2072,1,Macro(vm,2072,DIRECTDIAL,${IVR_RETVM})
exten => *2072,n,Goto(vmret,1)

exten => *2073,1,Macro(vm,2073,DIRECTDIAL,${IVR_RETVM})
exten => *2073,n,Goto(vmret,1)

exten => *2074,1,Macro(vm,2074,DIRECTDIAL,${IVR_RETVM})
exten => *2074,n,Goto(vmret,1)

exten => *2605,1,Macro(vm,2605,DIRECTDIAL,${IVR_RETVM})
exten => *2605,n,Goto(vmret,1)

exten => *2607,1,Macro(vm,2607,DIRECTDIAL,${IVR_RETVM})
exten => *2607,n,Goto(vmret,1)

exten => *2608,1,Macro(vm,2608,DIRECTDIAL,${IVR_RETVM})
exten => *2608,n,Goto(vmret,1)

exten => *8181,1,Macro(vm,8181,DIRECTDIAL,${IVR_RETVM})
exten => *8181,n,Goto(vmret,1)

exten => 1,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1/ringtimer)}" > "0"]?${DB(AMPUSER/1/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1,n,Macro(exten-vm,novm,1,0,0,0)
exten => 1,n(dest),Set(__PICKUPMARK=)
exten => 1,n,Goto(${IVR_CONTEXT},return,1)
exten => 1,hint,&Custom:DND1,CustomPresence:1

exten => 2,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2/ringtimer)}" > "0"]?${DB(AMPUSER/2/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2,n,Macro(exten-vm,2,2,0,0,0)
exten => 2,n(dest),Set(__PICKUPMARK=)
exten => 2,n,Macro(vm,2,${DIALSTATUS},${IVR_RETVM})
exten => 2,n,Goto(vmret,1)
exten => 2,hint,SIP/2&Custom:DND2,CustomPresence:2

exten => vmb2,1,Macro(vm,2,BUSY,${IVR_RETVM})
exten => vmb2,n,Goto(vmret,1)

exten => vmu2,1,Macro(vm,2,NOANSWER,${IVR_RETVM})
exten => vmu2,n,Goto(vmret,1)

exten => vms2,1,Macro(vm,2,NOMESSAGE,${IVR_RETVM})
exten => vms2,n,Goto(vmret,1)

exten => vmi2,1,Macro(vm,2,INSTRUCT,${IVR_RETVM})
exten => vmi2,n,Goto(vmret,1)

exten => 3,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/3/ringtimer)}" > "0"]?${DB(AMPUSER/3/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 3,n,Macro(exten-vm,novm,3,0,0,0)
exten => 3,n(dest),Set(__PICKUPMARK=)
exten => 3,n,Goto(${IVR_CONTEXT},return,1)
exten => 3,hint,SIP/3&Custom:DND3,CustomPresence:3

exten => 100,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/100/ringtimer)}" > "0"]?${DB(AMPUSER/100/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 100,n,Macro(exten-vm,100,100,0,0,0)
exten => 100,n(dest),Set(__PICKUPMARK=)
exten => 100,n,Macro(vm,100,${DIALSTATUS},${IVR_RETVM})
exten => 100,n,Goto(vmret,1)
exten => 100,hint,SIP/100&Custom:DND100,CustomPresence:100

exten => vmb100,1,Macro(vm,100,BUSY,${IVR_RETVM})
exten => vmb100,n,Goto(vmret,1)

exten => vmu100,1,Macro(vm,100,NOANSWER,${IVR_RETVM})
exten => vmu100,n,Goto(vmret,1)

exten => vms100,1,Macro(vm,100,NOMESSAGE,${IVR_RETVM})
exten => vms100,n,Goto(vmret,1)

exten => vmi100,1,Macro(vm,100,INSTRUCT,${IVR_RETVM})
exten => vmi100,n,Goto(vmret,1)

exten => 101,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/101/ringtimer)}" > "0"]?${DB(AMPUSER/101/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 101,n,Macro(exten-vm,101,101,0,0,0)
exten => 101,n(dest),Set(__PICKUPMARK=)
exten => 101,n,Macro(vm,101,${DIALSTATUS},${IVR_RETVM})
exten => 101,n,Goto(vmret,1)
exten => 101,hint,SIP/101&Custom:DND101,CustomPresence:101

exten => vmb101,1,Macro(vm,101,BUSY,${IVR_RETVM})
exten => vmb101,n,Goto(vmret,1)

exten => vmu101,1,Macro(vm,101,NOANSWER,${IVR_RETVM})
exten => vmu101,n,Goto(vmret,1)

exten => vms101,1,Macro(vm,101,NOMESSAGE,${IVR_RETVM})
exten => vms101,n,Goto(vmret,1)

exten => vmi101,1,Macro(vm,101,INSTRUCT,${IVR_RETVM})
exten => vmi101,n,Goto(vmret,1)

exten => 102,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/102/ringtimer)}" > "0"]?${DB(AMPUSER/102/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 102,n,Macro(exten-vm,102,102,0,0,0)
exten => 102,n(dest),Set(__PICKUPMARK=)
exten => 102,n,Macro(vm,102,${DIALSTATUS},${IVR_RETVM})
exten => 102,n,Goto(vmret,1)
exten => 102,hint,SIP/102&Custom:DND102,CustomPresence:102

exten => vmb102,1,Macro(vm,102,BUSY,${IVR_RETVM})
exten => vmb102,n,Goto(vmret,1)

exten => vmu102,1,Macro(vm,102,NOANSWER,${IVR_RETVM})
exten => vmu102,n,Goto(vmret,1)

exten => vms102,1,Macro(vm,102,NOMESSAGE,${IVR_RETVM})
exten => vms102,n,Goto(vmret,1)

exten => vmi102,1,Macro(vm,102,INSTRUCT,${IVR_RETVM})
exten => vmi102,n,Goto(vmret,1)

exten => 103,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/103/ringtimer)}" > "0"]?${DB(AMPUSER/103/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 103,n,Macro(exten-vm,103,103,0,0,0)
exten => 103,n(dest),Set(__PICKUPMARK=)
exten => 103,n,Macro(vm,103,${DIALSTATUS},${IVR_RETVM})
exten => 103,n,Goto(vmret,1)
exten => 103,hint,SIP/103&Custom:DND103,CustomPresence:103

exten => vmb103,1,Macro(vm,103,BUSY,${IVR_RETVM})
exten => vmb103,n,Goto(vmret,1)

exten => vmu103,1,Macro(vm,103,NOANSWER,${IVR_RETVM})
exten => vmu103,n,Goto(vmret,1)

exten => vms103,1,Macro(vm,103,NOMESSAGE,${IVR_RETVM})
exten => vms103,n,Goto(vmret,1)

exten => vmi103,1,Macro(vm,103,INSTRUCT,${IVR_RETVM})
exten => vmi103,n,Goto(vmret,1)

exten => 104,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/104/ringtimer)}" > "0"]?${DB(AMPUSER/104/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 104,n,Macro(exten-vm,104,104,0,0,0)
exten => 104,n(dest),Set(__PICKUPMARK=)
exten => 104,n,Macro(vm,104,${DIALSTATUS},${IVR_RETVM})
exten => 104,n,Goto(vmret,1)
exten => 104,hint,SIP/104&Custom:DND104,CustomPresence:104

exten => vmb104,1,Macro(vm,104,BUSY,${IVR_RETVM})
exten => vmb104,n,Goto(vmret,1)

exten => vmu104,1,Macro(vm,104,NOANSWER,${IVR_RETVM})
exten => vmu104,n,Goto(vmret,1)

exten => vms104,1,Macro(vm,104,NOMESSAGE,${IVR_RETVM})
exten => vms104,n,Goto(vmret,1)

exten => vmi104,1,Macro(vm,104,INSTRUCT,${IVR_RETVM})
exten => vmi104,n,Goto(vmret,1)

exten => 105,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/105/ringtimer)}" > "0"]?${DB(AMPUSER/105/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 105,n,Macro(exten-vm,105,105,0,0,0)
exten => 105,n(dest),Set(__PICKUPMARK=)
exten => 105,n,Macro(vm,105,${DIALSTATUS},${IVR_RETVM})
exten => 105,n,Goto(vmret,1)
exten => 105,hint,SIP/105&Custom:DND105,CustomPresence:105

exten => vmb105,1,Macro(vm,105,BUSY,${IVR_RETVM})
exten => vmb105,n,Goto(vmret,1)

exten => vmu105,1,Macro(vm,105,NOANSWER,${IVR_RETVM})
exten => vmu105,n,Goto(vmret,1)

exten => vms105,1,Macro(vm,105,NOMESSAGE,${IVR_RETVM})
exten => vms105,n,Goto(vmret,1)

exten => vmi105,1,Macro(vm,105,INSTRUCT,${IVR_RETVM})
exten => vmi105,n,Goto(vmret,1)

exten => 106,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/106/ringtimer)}" > "0"]?${DB(AMPUSER/106/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 106,n,Macro(exten-vm,novm,106,0,0,0)
exten => 106,n(dest),Set(__PICKUPMARK=)
exten => 106,n,Goto(${IVR_CONTEXT},return,1)
exten => 106,hint,SIP/106&Custom:DND106,CustomPresence:106

exten => 108,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/108/ringtimer)}" > "0"]?${DB(AMPUSER/108/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 108,n,Macro(exten-vm,novm,108,0,0,0)
exten => 108,n(dest),Set(__PICKUPMARK=)
exten => 108,n,Goto(${IVR_CONTEXT},return,1)
exten => 108,hint,SIP/108&Custom:DND108,CustomPresence:108

exten => 109,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/109/ringtimer)}" > "0"]?${DB(AMPUSER/109/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 109,n,Macro(exten-vm,109,109,0,0,0)
exten => 109,n(dest),Set(__PICKUPMARK=)
exten => 109,n,Macro(vm,109,${DIALSTATUS},${IVR_RETVM})
exten => 109,n,Goto(vmret,1)
exten => 109,hint,SIP/109&Custom:DND109,CustomPresence:109

exten => vmb109,1,Macro(vm,109,BUSY,${IVR_RETVM})
exten => vmb109,n,Goto(vmret,1)

exten => vmu109,1,Macro(vm,109,NOANSWER,${IVR_RETVM})
exten => vmu109,n,Goto(vmret,1)

exten => vms109,1,Macro(vm,109,NOMESSAGE,${IVR_RETVM})
exten => vms109,n,Goto(vmret,1)

exten => vmi109,1,Macro(vm,109,INSTRUCT,${IVR_RETVM})
exten => vmi109,n,Goto(vmret,1)

exten => 110,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/110/ringtimer)}" > "0"]?${DB(AMPUSER/110/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 110,n,Macro(exten-vm,novm,110,0,0,0)
exten => 110,n(dest),Set(__PICKUPMARK=)
exten => 110,n,Goto(${IVR_CONTEXT},return,1)
exten => 110,hint,SIP/110&Custom:DND110,CustomPresence:110

exten => 113,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/113/ringtimer)}" > "0"]?${DB(AMPUSER/113/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 113,n,Macro(exten-vm,113,113,0,0,0)
exten => 113,n(dest),Set(__PICKUPMARK=)
exten => 113,n,Macro(vm,113,${DIALSTATUS},${IVR_RETVM})
exten => 113,n,Goto(vmret,1)
exten => 113,hint,SIP/113&Custom:DND113,CustomPresence:113

exten => vmb113,1,Macro(vm,113,BUSY,${IVR_RETVM})
exten => vmb113,n,Goto(vmret,1)

exten => vmu113,1,Macro(vm,113,NOANSWER,${IVR_RETVM})
exten => vmu113,n,Goto(vmret,1)

exten => vms113,1,Macro(vm,113,NOMESSAGE,${IVR_RETVM})
exten => vms113,n,Goto(vmret,1)

exten => vmi113,1,Macro(vm,113,INSTRUCT,${IVR_RETVM})
exten => vmi113,n,Goto(vmret,1)

exten => 124,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/124/ringtimer)}" > "0"]?${DB(AMPUSER/124/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 124,n,Macro(exten-vm,novm,124,0,0,0)
exten => 124,n(dest),Set(__PICKUPMARK=)
exten => 124,n,Goto(${IVR_CONTEXT},return,1)
exten => 124,hint,SIP/124&Custom:DND124,CustomPresence:124

exten => 197,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/197/ringtimer)}" > "0"]?${DB(AMPUSER/197/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 197,n,Macro(exten-vm,novm,197,0,0,0)
exten => 197,n(dest),Set(__PICKUPMARK=)
exten => 197,n,Goto(${IVR_CONTEXT},return,1)
exten => 197,hint,SIP/197&Custom:DND197,CustomPresence:197

exten => 198,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/198/ringtimer)}" > "0"]?${DB(AMPUSER/198/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 198,n,Macro(exten-vm,novm,198,0,0,0)
exten => 198,n(dest),Set(__PICKUPMARK=)
exten => 198,n,Goto(${IVR_CONTEXT},return,1)
exten => 198,hint,SIP/198&Custom:DND198,CustomPresence:198

exten => 199,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/199/ringtimer)}" > "0"]?${DB(AMPUSER/199/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 199,n,Macro(exten-vm,199,199,0,0,0)
exten => 199,n(dest),Set(__PICKUPMARK=)
exten => 199,n,Macro(vm,199,${DIALSTATUS},${IVR_RETVM})
exten => 199,n,Goto(vmret,1)
exten => 199,hint,SIP/199&Custom:DND199,CustomPresence:199

exten => vmb199,1,Macro(vm,199,BUSY,${IVR_RETVM})
exten => vmb199,n,Goto(vmret,1)

exten => vmu199,1,Macro(vm,199,NOANSWER,${IVR_RETVM})
exten => vmu199,n,Goto(vmret,1)

exten => vms199,1,Macro(vm,199,NOMESSAGE,${IVR_RETVM})
exten => vms199,n,Goto(vmret,1)

exten => vmi199,1,Macro(vm,199,INSTRUCT,${IVR_RETVM})
exten => vmi199,n,Goto(vmret,1)

exten => 611,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/611/ringtimer)}" > "0"]?${DB(AMPUSER/611/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 611,n,Macro(exten-vm,novm,611,0,0,0)
exten => 611,n(dest),Set(__PICKUPMARK=)
exten => 611,n,Goto(${IVR_CONTEXT},return,1)
exten => 611,hint,&Custom:DND611,CustomPresence:611

exten => 700,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/700/ringtimer)}" > "0"]?${DB(AMPUSER/700/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 700,n,Macro(exten-vm,700,700,0,0,0)
exten => 700,n(dest),Set(__PICKUPMARK=)
exten => 700,n,Macro(vm,700,${DIALSTATUS},${IVR_RETVM})
exten => 700,n,Goto(vmret,1)
exten => 700,hint,SIP/700&Custom:DND700,CustomPresence:700

exten => vmb700,1,Macro(vm,700,BUSY,${IVR_RETVM})
exten => vmb700,n,Goto(vmret,1)

exten => vmu700,1,Macro(vm,700,NOANSWER,${IVR_RETVM})
exten => vmu700,n,Goto(vmret,1)

exten => vms700,1,Macro(vm,700,NOMESSAGE,${IVR_RETVM})
exten => vms700,n,Goto(vmret,1)

exten => vmi700,1,Macro(vm,700,INSTRUCT,${IVR_RETVM})
exten => vmi700,n,Goto(vmret,1)

exten => 701,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/701/ringtimer)}" > "0"]?${DB(AMPUSER/701/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 701,n,Macro(exten-vm,701,701,1,1,1)
exten => 701,n(dest),Set(__PICKUPMARK=)
exten => 701,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?from-did-direct,703,1)
exten => 701,n,GotoIf($["${DIALSTATUS}"="BUSY"]?from-did-direct,703,1)
exten => 701,n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?from-did-direct,703,1)
exten => 701,n,Macro(vm,701,${DIALSTATUS},${IVR_RETVM})
exten => 701,n,Goto(vmret,1)
exten => 701,hint,SIP/701&Custom:DND701,CustomPresence:701

exten => vmb701,1,Macro(vm,701,BUSY,${IVR_RETVM})
exten => vmb701,n,Goto(vmret,1)

exten => vmu701,1,Macro(vm,701,NOANSWER,${IVR_RETVM})
exten => vmu701,n,Goto(vmret,1)

exten => vms701,1,Macro(vm,701,NOMESSAGE,${IVR_RETVM})
exten => vms701,n,Goto(vmret,1)

exten => vmi701,1,Macro(vm,701,INSTRUCT,${IVR_RETVM})
exten => vmi701,n,Goto(vmret,1)

exten => 702,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/702/ringtimer)}" > "0"]?${DB(AMPUSER/702/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 702,n,Macro(exten-vm,702,702,0,0,0)
exten => 702,n(dest),Set(__PICKUPMARK=)
exten => 702,n,Macro(vm,702,${DIALSTATUS},${IVR_RETVM})
exten => 702,n,Goto(vmret,1)
exten => 702,hint,SIP/702&Custom:DND702,CustomPresence:702

exten => vmb702,1,Macro(vm,702,BUSY,${IVR_RETVM})
exten => vmb702,n,Goto(vmret,1)

exten => vmu702,1,Macro(vm,702,NOANSWER,${IVR_RETVM})
exten => vmu702,n,Goto(vmret,1)

exten => vms702,1,Macro(vm,702,NOMESSAGE,${IVR_RETVM})
exten => vms702,n,Goto(vmret,1)

exten => vmi702,1,Macro(vm,702,INSTRUCT,${IVR_RETVM})
exten => vmi702,n,Goto(vmret,1)

exten => 703,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/703/ringtimer)}" > "0"]?${DB(AMPUSER/703/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 703,n,Macro(exten-vm,703,703,0,0,0)
exten => 703,n(dest),Set(__PICKUPMARK=)
exten => 703,n,Macro(vm,703,${DIALSTATUS},${IVR_RETVM})
exten => 703,n,Goto(vmret,1)
exten => 703,hint,SIP/703&Custom:DND703,CustomPresence:703

exten => vmb703,1,Macro(vm,703,BUSY,${IVR_RETVM})
exten => vmb703,n,Goto(vmret,1)

exten => vmu703,1,Macro(vm,703,NOANSWER,${IVR_RETVM})
exten => vmu703,n,Goto(vmret,1)

exten => vms703,1,Macro(vm,703,NOMESSAGE,${IVR_RETVM})
exten => vms703,n,Goto(vmret,1)

exten => vmi703,1,Macro(vm,703,INSTRUCT,${IVR_RETVM})
exten => vmi703,n,Goto(vmret,1)

exten => 704,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/704/ringtimer)}" > "0"]?${DB(AMPUSER/704/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 704,n,Macro(exten-vm,704,704,0,0,0)
exten => 704,n(dest),Set(__PICKUPMARK=)
exten => 704,n,Macro(vm,704,${DIALSTATUS},${IVR_RETVM})
exten => 704,n,Goto(vmret,1)
exten => 704,hint,SIP/704&Custom:DND704,CustomPresence:704

exten => vmb704,1,Macro(vm,704,BUSY,${IVR_RETVM})
exten => vmb704,n,Goto(vmret,1)

exten => vmu704,1,Macro(vm,704,NOANSWER,${IVR_RETVM})
exten => vmu704,n,Goto(vmret,1)

exten => vms704,1,Macro(vm,704,NOMESSAGE,${IVR_RETVM})
exten => vms704,n,Goto(vmret,1)

exten => vmi704,1,Macro(vm,704,INSTRUCT,${IVR_RETVM})
exten => vmi704,n,Goto(vmret,1)

exten => 705,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/705/ringtimer)}" > "0"]?${DB(AMPUSER/705/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 705,n,Macro(exten-vm,705,705,0,0,0)
exten => 705,n(dest),Set(__PICKUPMARK=)
exten => 705,n,Macro(vm,705,${DIALSTATUS},${IVR_RETVM})
exten => 705,n,Goto(vmret,1)
exten => 705,hint,SIP/705&Custom:DND705,CustomPresence:705

exten => vmb705,1,Macro(vm,705,BUSY,${IVR_RETVM})
exten => vmb705,n,Goto(vmret,1)

exten => vmu705,1,Macro(vm,705,NOANSWER,${IVR_RETVM})
exten => vmu705,n,Goto(vmret,1)

exten => vms705,1,Macro(vm,705,NOMESSAGE,${IVR_RETVM})
exten => vms705,n,Goto(vmret,1)

exten => vmi705,1,Macro(vm,705,INSTRUCT,${IVR_RETVM})
exten => vmi705,n,Goto(vmret,1)

exten => 706,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/706/ringtimer)}" > "0"]?${DB(AMPUSER/706/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 706,n,Macro(exten-vm,706,706,0,0,0)
exten => 706,n(dest),Set(__PICKUPMARK=)
exten => 706,n,Macro(vm,706,${DIALSTATUS},${IVR_RETVM})
exten => 706,n,Goto(vmret,1)
exten => 706,hint,SIP/706&Custom:DND706,CustomPresence:706

exten => vmb706,1,Macro(vm,706,BUSY,${IVR_RETVM})
exten => vmb706,n,Goto(vmret,1)

exten => vmu706,1,Macro(vm,706,NOANSWER,${IVR_RETVM})
exten => vmu706,n,Goto(vmret,1)

exten => vms706,1,Macro(vm,706,NOMESSAGE,${IVR_RETVM})
exten => vms706,n,Goto(vmret,1)

exten => vmi706,1,Macro(vm,706,INSTRUCT,${IVR_RETVM})
exten => vmi706,n,Goto(vmret,1)

exten => 707,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/707/ringtimer)}" > "0"]?${DB(AMPUSER/707/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 707,n,Macro(exten-vm,707,707,0,0,0)
exten => 707,n(dest),Set(__PICKUPMARK=)
exten => 707,n,Macro(vm,707,${DIALSTATUS},${IVR_RETVM})
exten => 707,n,Goto(vmret,1)
exten => 707,hint,SIP/707&Custom:DND707,CustomPresence:707

exten => vmb707,1,Macro(vm,707,BUSY,${IVR_RETVM})
exten => vmb707,n,Goto(vmret,1)

exten => vmu707,1,Macro(vm,707,NOANSWER,${IVR_RETVM})
exten => vmu707,n,Goto(vmret,1)

exten => vms707,1,Macro(vm,707,NOMESSAGE,${IVR_RETVM})
exten => vms707,n,Goto(vmret,1)

exten => vmi707,1,Macro(vm,707,INSTRUCT,${IVR_RETVM})
exten => vmi707,n,Goto(vmret,1)

exten => 709,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/709/ringtimer)}" > "0"]?${DB(AMPUSER/709/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 709,n,Macro(exten-vm,709,709,0,0,0)
exten => 709,n(dest),Set(__PICKUPMARK=)
exten => 709,n,Macro(vm,709,${DIALSTATUS},${IVR_RETVM})
exten => 709,n,Goto(vmret,1)
exten => 709,hint,SIP/709&Custom:DND709,CustomPresence:709

exten => vmb709,1,Macro(vm,709,BUSY,${IVR_RETVM})
exten => vmb709,n,Goto(vmret,1)

exten => vmu709,1,Macro(vm,709,NOANSWER,${IVR_RETVM})
exten => vmu709,n,Goto(vmret,1)

exten => vms709,1,Macro(vm,709,NOMESSAGE,${IVR_RETVM})
exten => vms709,n,Goto(vmret,1)

exten => vmi709,1,Macro(vm,709,INSTRUCT,${IVR_RETVM})
exten => vmi709,n,Goto(vmret,1)

exten => 711,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/711/ringtimer)}" > "0"]?${DB(AMPUSER/711/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 711,n,Macro(exten-vm,711,711,0,0,0)
exten => 711,n(dest),Set(__PICKUPMARK=)
exten => 711,n,Macro(vm,711,${DIALSTATUS},${IVR_RETVM})
exten => 711,n,Goto(vmret,1)
exten => 711,hint,SIP/711&Custom:DND711,CustomPresence:711

exten => vmb711,1,Macro(vm,711,BUSY,${IVR_RETVM})
exten => vmb711,n,Goto(vmret,1)

exten => vmu711,1,Macro(vm,711,NOANSWER,${IVR_RETVM})
exten => vmu711,n,Goto(vmret,1)

exten => vms711,1,Macro(vm,711,NOMESSAGE,${IVR_RETVM})
exten => vms711,n,Goto(vmret,1)

exten => vmi711,1,Macro(vm,711,INSTRUCT,${IVR_RETVM})
exten => vmi711,n,Goto(vmret,1)

exten => 712,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/712/ringtimer)}" > "0"]?${DB(AMPUSER/712/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 712,n,Macro(exten-vm,novm,712,0,0,0)
exten => 712,n(dest),Set(__PICKUPMARK=)
exten => 712,n,Goto(${IVR_CONTEXT},return,1)
exten => 712,hint,SIP/712&Custom:DND712,CustomPresence:712

exten => 713,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/713/ringtimer)}" > "0"]?${DB(AMPUSER/713/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 713,n,Macro(exten-vm,713,713,0,0,0)
exten => 713,n(dest),Set(__PICKUPMARK=)
exten => 713,n,Macro(vm,713,${DIALSTATUS},${IVR_RETVM})
exten => 713,n,Goto(vmret,1)
exten => 713,hint,SIP/713&Custom:DND713,CustomPresence:713

exten => vmb713,1,Macro(vm,713,BUSY,${IVR_RETVM})
exten => vmb713,n,Goto(vmret,1)

exten => vmu713,1,Macro(vm,713,NOANSWER,${IVR_RETVM})
exten => vmu713,n,Goto(vmret,1)

exten => vms713,1,Macro(vm,713,NOMESSAGE,${IVR_RETVM})
exten => vms713,n,Goto(vmret,1)

exten => vmi713,1,Macro(vm,713,INSTRUCT,${IVR_RETVM})
exten => vmi713,n,Goto(vmret,1)

exten => 714,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/714/ringtimer)}" > "0"]?${DB(AMPUSER/714/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 714,n,Macro(exten-vm,novm,714,0,0,0)
exten => 714,n(dest),Set(__PICKUPMARK=)
exten => 714,n,Goto(${IVR_CONTEXT},return,1)
exten => 714,hint,SIP/714&Custom:DND714,CustomPresence:714

exten => 715,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/715/ringtimer)}" > "0"]?${DB(AMPUSER/715/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 715,n,Macro(exten-vm,novm,715,0,0,0)
exten => 715,n(dest),Set(__PICKUPMARK=)
exten => 715,n,Goto(${IVR_CONTEXT},return,1)
exten => 715,hint,SIP/715&Custom:DND715,CustomPresence:715

exten => 1300,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1300/ringtimer)}" > "0"]?${DB(AMPUSER/1300/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1300,n,Macro(exten-vm,1300,1300,1,1,1)
exten => 1300,n(dest),Set(__PICKUPMARK=)
exten => 1300,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?app-announcement-13,s,1)
exten => 1300,n,GotoIf($["${DIALSTATUS}"="BUSY"]?app-announcement-13,s,1)
exten => 1300,n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?app-announcement-13,s,1)
exten => 1300,n,Macro(vm,1300,${DIALSTATUS},${IVR_RETVM})
exten => 1300,n,Goto(vmret,1)
exten => 1300,hint,SIP/1300&Custom:DND1300,CustomPresence:1300

exten => vmb1300,1,Macro(vm,1300,BUSY,${IVR_RETVM})
exten => vmb1300,n,Goto(vmret,1)

exten => vmu1300,1,Macro(vm,1300,NOANSWER,${IVR_RETVM})
exten => vmu1300,n,Goto(vmret,1)

exten => vms1300,1,Macro(vm,1300,NOMESSAGE,${IVR_RETVM})
exten => vms1300,n,Goto(vmret,1)

exten => vmi1300,1,Macro(vm,1300,INSTRUCT,${IVR_RETVM})
exten => vmi1300,n,Goto(vmret,1)

exten => 1301,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1301/ringtimer)}" > "0"]?${DB(AMPUSER/1301/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1301,n,Macro(exten-vm,1301,1301,0,0,0)
exten => 1301,n(dest),Set(__PICKUPMARK=)
exten => 1301,n,Macro(vm,1301,${DIALSTATUS},${IVR_RETVM})
exten => 1301,n,Goto(vmret,1)
exten => 1301,hint,SIP/1301&Custom:DND1301,CustomPresence:1301

exten => vmb1301,1,Macro(vm,1301,BUSY,${IVR_RETVM})
exten => vmb1301,n,Goto(vmret,1)

exten => vmu1301,1,Macro(vm,1301,NOANSWER,${IVR_RETVM})
exten => vmu1301,n,Goto(vmret,1)

exten => vms1301,1,Macro(vm,1301,NOMESSAGE,${IVR_RETVM})
exten => vms1301,n,Goto(vmret,1)

exten => vmi1301,1,Macro(vm,1301,INSTRUCT,${IVR_RETVM})
exten => vmi1301,n,Goto(vmret,1)

exten => 1302,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1302/ringtimer)}" > "0"]?${DB(AMPUSER/1302/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1302,n,Macro(exten-vm,novm,1302,0,0,0)
exten => 1302,n(dest),Set(__PICKUPMARK=)
exten => 1302,n,Goto(${IVR_CONTEXT},return,1)
exten => 1302,hint,SIP/1302&Custom:DND1302,CustomPresence:1302

exten => 1303,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1303/ringtimer)}" > "0"]?${DB(AMPUSER/1303/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1303,n,Macro(exten-vm,1303,1303,0,0,0)
exten => 1303,n(dest),Set(__PICKUPMARK=)
exten => 1303,n,Macro(vm,1303,${DIALSTATUS},${IVR_RETVM})
exten => 1303,n,Goto(vmret,1)
exten => 1303,hint,SIP/1303&Custom:DND1303,CustomPresence:1303

exten => vmb1303,1,Macro(vm,1303,BUSY,${IVR_RETVM})
exten => vmb1303,n,Goto(vmret,1)

exten => vmu1303,1,Macro(vm,1303,NOANSWER,${IVR_RETVM})
exten => vmu1303,n,Goto(vmret,1)

exten => vms1303,1,Macro(vm,1303,NOMESSAGE,${IVR_RETVM})
exten => vms1303,n,Goto(vmret,1)

exten => vmi1303,1,Macro(vm,1303,INSTRUCT,${IVR_RETVM})
exten => vmi1303,n,Goto(vmret,1)

exten => 1304,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1304/ringtimer)}" > "0"]?${DB(AMPUSER/1304/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1304,n,Macro(exten-vm,1304,1304,0,0,0)
exten => 1304,n(dest),Set(__PICKUPMARK=)
exten => 1304,n,Macro(vm,1304,${DIALSTATUS},${IVR_RETVM})
exten => 1304,n,Goto(vmret,1)
exten => 1304,hint,SIP/1304&Custom:DND1304,CustomPresence:1304

exten => vmb1304,1,Macro(vm,1304,BUSY,${IVR_RETVM})
exten => vmb1304,n,Goto(vmret,1)

exten => vmu1304,1,Macro(vm,1304,NOANSWER,${IVR_RETVM})
exten => vmu1304,n,Goto(vmret,1)

exten => vms1304,1,Macro(vm,1304,NOMESSAGE,${IVR_RETVM})
exten => vms1304,n,Goto(vmret,1)

exten => vmi1304,1,Macro(vm,1304,INSTRUCT,${IVR_RETVM})
exten => vmi1304,n,Goto(vmret,1)

exten => 1305,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1305/ringtimer)}" > "0"]?${DB(AMPUSER/1305/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1305,n,Macro(exten-vm,1305,1305,0,0,0)
exten => 1305,n(dest),Set(__PICKUPMARK=)
exten => 1305,n,Macro(vm,1305,${DIALSTATUS},${IVR_RETVM})
exten => 1305,n,Goto(vmret,1)
exten => 1305,hint,SIP/1305&Custom:DND1305,CustomPresence:1305

exten => vmb1305,1,Macro(vm,1305,BUSY,${IVR_RETVM})
exten => vmb1305,n,Goto(vmret,1)

exten => vmu1305,1,Macro(vm,1305,NOANSWER,${IVR_RETVM})
exten => vmu1305,n,Goto(vmret,1)

exten => vms1305,1,Macro(vm,1305,NOMESSAGE,${IVR_RETVM})
exten => vms1305,n,Goto(vmret,1)

exten => vmi1305,1,Macro(vm,1305,INSTRUCT,${IVR_RETVM})
exten => vmi1305,n,Goto(vmret,1)

exten => 1306,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1306/ringtimer)}" > "0"]?${DB(AMPUSER/1306/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1306,n,Macro(exten-vm,1306,1306,0,0,0)
exten => 1306,n(dest),Set(__PICKUPMARK=)
exten => 1306,n,Macro(vm,1306,${DIALSTATUS},${IVR_RETVM})
exten => 1306,n,Goto(vmret,1)
exten => 1306,hint,SIP/1306&Custom:DND1306,CustomPresence:1306

exten => vmb1306,1,Macro(vm,1306,BUSY,${IVR_RETVM})
exten => vmb1306,n,Goto(vmret,1)

exten => vmu1306,1,Macro(vm,1306,NOANSWER,${IVR_RETVM})
exten => vmu1306,n,Goto(vmret,1)

exten => vms1306,1,Macro(vm,1306,NOMESSAGE,${IVR_RETVM})
exten => vms1306,n,Goto(vmret,1)

exten => vmi1306,1,Macro(vm,1306,INSTRUCT,${IVR_RETVM})
exten => vmi1306,n,Goto(vmret,1)

exten => 1307,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1307/ringtimer)}" > "0"]?${DB(AMPUSER/1307/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1307,n,Macro(exten-vm,1307,1307,0,0,0)
exten => 1307,n(dest),Set(__PICKUPMARK=)
exten => 1307,n,Macro(vm,1307,${DIALSTATUS},${IVR_RETVM})
exten => 1307,n,Goto(vmret,1)
exten => 1307,hint,SIP/1307&Custom:DND1307,CustomPresence:1307

exten => vmb1307,1,Macro(vm,1307,BUSY,${IVR_RETVM})
exten => vmb1307,n,Goto(vmret,1)

exten => vmu1307,1,Macro(vm,1307,NOANSWER,${IVR_RETVM})
exten => vmu1307,n,Goto(vmret,1)

exten => vms1307,1,Macro(vm,1307,NOMESSAGE,${IVR_RETVM})
exten => vms1307,n,Goto(vmret,1)

exten => vmi1307,1,Macro(vm,1307,INSTRUCT,${IVR_RETVM})
exten => vmi1307,n,Goto(vmret,1)

exten => 1308,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1308/ringtimer)}" > "0"]?${DB(AMPUSER/1308/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1308,n,Macro(exten-vm,novm,1308,0,0,0)
exten => 1308,n(dest),Set(__PICKUPMARK=)
exten => 1308,n,Goto(${IVR_CONTEXT},return,1)
exten => 1308,hint,SIP/1308&Custom:DND1308,CustomPresence:1308

exten => 1309,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1309/ringtimer)}" > "0"]?${DB(AMPUSER/1309/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1309,n,Macro(exten-vm,1309,1309,0,0,0)
exten => 1309,n(dest),Set(__PICKUPMARK=)
exten => 1309,n,Macro(vm,1309,${DIALSTATUS},${IVR_RETVM})
exten => 1309,n,Goto(vmret,1)
exten => 1309,hint,SIP/1309&Custom:DND1309,CustomPresence:1309

exten => vmb1309,1,Macro(vm,1309,BUSY,${IVR_RETVM})
exten => vmb1309,n,Goto(vmret,1)

exten => vmu1309,1,Macro(vm,1309,NOANSWER,${IVR_RETVM})
exten => vmu1309,n,Goto(vmret,1)

exten => vms1309,1,Macro(vm,1309,NOMESSAGE,${IVR_RETVM})
exten => vms1309,n,Goto(vmret,1)

exten => vmi1309,1,Macro(vm,1309,INSTRUCT,${IVR_RETVM})
exten => vmi1309,n,Goto(vmret,1)

exten => 1310,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1310/ringtimer)}" > "0"]?${DB(AMPUSER/1310/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1310,n,Macro(exten-vm,1310,1310,0,0,0)
exten => 1310,n(dest),Set(__PICKUPMARK=)
exten => 1310,n,Macro(vm,1310,${DIALSTATUS},${IVR_RETVM})
exten => 1310,n,Goto(vmret,1)
exten => 1310,hint,SIP/1310&Custom:DND1310,CustomPresence:1310

exten => vmb1310,1,Macro(vm,1310,BUSY,${IVR_RETVM})
exten => vmb1310,n,Goto(vmret,1)

exten => vmu1310,1,Macro(vm,1310,NOANSWER,${IVR_RETVM})
exten => vmu1310,n,Goto(vmret,1)

exten => vms1310,1,Macro(vm,1310,NOMESSAGE,${IVR_RETVM})
exten => vms1310,n,Goto(vmret,1)

exten => vmi1310,1,Macro(vm,1310,INSTRUCT,${IVR_RETVM})
exten => vmi1310,n,Goto(vmret,1)

exten => 1311,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1311/ringtimer)}" > "0"]?${DB(AMPUSER/1311/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1311,n,Macro(exten-vm,novm,1311,0,0,0)
exten => 1311,n(dest),Set(__PICKUPMARK=)
exten => 1311,n,Goto(${IVR_CONTEXT},return,1)
exten => 1311,hint,SIP/1311&Custom:DND1311,CustomPresence:1311

exten => 1312,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1312/ringtimer)}" > "0"]?${DB(AMPUSER/1312/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1312,n,Macro(exten-vm,novm,1312,0,0,0)
exten => 1312,n(dest),Set(__PICKUPMARK=)
exten => 1312,n,Goto(${IVR_CONTEXT},return,1)
exten => 1312,hint,SIP/1312&Custom:DND1312,CustomPresence:1312

exten => 1313,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1313/ringtimer)}" > "0"]?${DB(AMPUSER/1313/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1313,n,Macro(exten-vm,1313,1313,0,0,0)
exten => 1313,n(dest),Set(__PICKUPMARK=)
exten => 1313,n,Macro(vm,1313,${DIALSTATUS},${IVR_RETVM})
exten => 1313,n,Goto(vmret,1)
exten => 1313,hint,&Custom:DND1313,CustomPresence:1313

exten => vmb1313,1,Macro(vm,1313,BUSY,${IVR_RETVM})
exten => vmb1313,n,Goto(vmret,1)

exten => vmu1313,1,Macro(vm,1313,NOANSWER,${IVR_RETVM})
exten => vmu1313,n,Goto(vmret,1)

exten => vms1313,1,Macro(vm,1313,NOMESSAGE,${IVR_RETVM})
exten => vms1313,n,Goto(vmret,1)

exten => vmi1313,1,Macro(vm,1313,INSTRUCT,${IVR_RETVM})
exten => vmi1313,n,Goto(vmret,1)

exten => 1996,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1996/ringtimer)}" > "0"]?${DB(AMPUSER/1996/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1996,n,Macro(exten-vm,1996,1996,0,0,0)
exten => 1996,n(dest),Set(__PICKUPMARK=)
exten => 1996,n,Macro(vm,1996,${DIALSTATUS},${IVR_RETVM})
exten => 1996,n,Goto(vmret,1)
exten => 1996,hint,SIP/1996&Custom:DND1996,CustomPresence:1996

exten => vmb1996,1,Macro(vm,1996,BUSY,${IVR_RETVM})
exten => vmb1996,n,Goto(vmret,1)

exten => vmu1996,1,Macro(vm,1996,NOANSWER,${IVR_RETVM})
exten => vmu1996,n,Goto(vmret,1)

exten => vms1996,1,Macro(vm,1996,NOMESSAGE,${IVR_RETVM})
exten => vms1996,n,Goto(vmret,1)

exten => vmi1996,1,Macro(vm,1996,INSTRUCT,${IVR_RETVM})
exten => vmi1996,n,Goto(vmret,1)

exten => 1997,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1997/ringtimer)}" > "0"]?${DB(AMPUSER/1997/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1997,n,Macro(exten-vm,1997,1997,0,0,0)
exten => 1997,n(dest),Set(__PICKUPMARK=)
exten => 1997,n,Macro(vm,1997,${DIALSTATUS},${IVR_RETVM})
exten => 1997,n,Goto(vmret,1)
exten => 1997,hint,SIP/1997&Custom:DND1997,CustomPresence:1997

exten => vmb1997,1,Macro(vm,1997,BUSY,${IVR_RETVM})
exten => vmb1997,n,Goto(vmret,1)

exten => vmu1997,1,Macro(vm,1997,NOANSWER,${IVR_RETVM})
exten => vmu1997,n,Goto(vmret,1)

exten => vms1997,1,Macro(vm,1997,NOMESSAGE,${IVR_RETVM})
exten => vms1997,n,Goto(vmret,1)

exten => vmi1997,1,Macro(vm,1997,INSTRUCT,${IVR_RETVM})
exten => vmi1997,n,Goto(vmret,1)

exten => 1998,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1998/ringtimer)}" > "0"]?${DB(AMPUSER/1998/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1998,n,Macro(exten-vm,1998,1998,0,0,0)
exten => 1998,n(dest),Set(__PICKUPMARK=)
exten => 1998,n,Macro(vm,1998,${DIALSTATUS},${IVR_RETVM})
exten => 1998,n,Goto(vmret,1)
exten => 1998,hint,SIP/1998&Custom:DND1998,CustomPresence:1998

exten => vmb1998,1,Macro(vm,1998,BUSY,${IVR_RETVM})
exten => vmb1998,n,Goto(vmret,1)

exten => vmu1998,1,Macro(vm,1998,NOANSWER,${IVR_RETVM})
exten => vmu1998,n,Goto(vmret,1)

exten => vms1998,1,Macro(vm,1998,NOMESSAGE,${IVR_RETVM})
exten => vms1998,n,Goto(vmret,1)

exten => vmi1998,1,Macro(vm,1998,INSTRUCT,${IVR_RETVM})
exten => vmi1998,n,Goto(vmret,1)

exten => 1999,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/1999/ringtimer)}" > "0"]?${DB(AMPUSER/1999/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 1999,n,Macro(exten-vm,1999,1999,0,0,0)
exten => 1999,n(dest),Set(__PICKUPMARK=)
exten => 1999,n,Macro(vm,1999,${DIALSTATUS},${IVR_RETVM})
exten => 1999,n,Goto(vmret,1)
exten => 1999,hint,SIP/1999&Custom:DND1999,CustomPresence:1999

exten => vmb1999,1,Macro(vm,1999,BUSY,${IVR_RETVM})
exten => vmb1999,n,Goto(vmret,1)

exten => vmu1999,1,Macro(vm,1999,NOANSWER,${IVR_RETVM})
exten => vmu1999,n,Goto(vmret,1)

exten => vms1999,1,Macro(vm,1999,NOMESSAGE,${IVR_RETVM})
exten => vms1999,n,Goto(vmret,1)

exten => vmi1999,1,Macro(vm,1999,INSTRUCT,${IVR_RETVM})
exten => vmi1999,n,Goto(vmret,1)

exten => 2071,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2071/ringtimer)}" > "0"]?${DB(AMPUSER/2071/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2071,n,Macro(exten-vm,2071,2071,0,0,0)
exten => 2071,n(dest),Set(__PICKUPMARK=)
exten => 2071,n,Macro(vm,2071,${DIALSTATUS},${IVR_RETVM})
exten => 2071,n,Goto(vmret,1)
exten => 2071,hint,SIP/2071&Custom:DND2071,CustomPresence:2071

exten => vmb2071,1,Macro(vm,2071,BUSY,${IVR_RETVM})
exten => vmb2071,n,Goto(vmret,1)

exten => vmu2071,1,Macro(vm,2071,NOANSWER,${IVR_RETVM})
exten => vmu2071,n,Goto(vmret,1)

exten => vms2071,1,Macro(vm,2071,NOMESSAGE,${IVR_RETVM})
exten => vms2071,n,Goto(vmret,1)

exten => vmi2071,1,Macro(vm,2071,INSTRUCT,${IVR_RETVM})
exten => vmi2071,n,Goto(vmret,1)

exten => 2072,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2072/ringtimer)}" > "0"]?${DB(AMPUSER/2072/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2072,n,Macro(exten-vm,2072,2072,0,0,0)
exten => 2072,n(dest),Set(__PICKUPMARK=)
exten => 2072,n,Macro(vm,2072,${DIALSTATUS},${IVR_RETVM})
exten => 2072,n,Goto(vmret,1)
exten => 2072,hint,SIP/2072&Custom:DND2072,CustomPresence:2072

exten => vmb2072,1,Macro(vm,2072,BUSY,${IVR_RETVM})
exten => vmb2072,n,Goto(vmret,1)

exten => vmu2072,1,Macro(vm,2072,NOANSWER,${IVR_RETVM})
exten => vmu2072,n,Goto(vmret,1)

exten => vms2072,1,Macro(vm,2072,NOMESSAGE,${IVR_RETVM})
exten => vms2072,n,Goto(vmret,1)

exten => vmi2072,1,Macro(vm,2072,INSTRUCT,${IVR_RETVM})
exten => vmi2072,n,Goto(vmret,1)

exten => 2073,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2073/ringtimer)}" > "0"]?${DB(AMPUSER/2073/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2073,n,Macro(exten-vm,2073,2073,0,0,0)
exten => 2073,n(dest),Set(__PICKUPMARK=)
exten => 2073,n,Macro(vm,2073,${DIALSTATUS},${IVR_RETVM})
exten => 2073,n,Goto(vmret,1)
exten => 2073,hint,SIP/2073&Custom:DND2073,CustomPresence:2073

exten => vmb2073,1,Macro(vm,2073,BUSY,${IVR_RETVM})
exten => vmb2073,n,Goto(vmret,1)

exten => vmu2073,1,Macro(vm,2073,NOANSWER,${IVR_RETVM})
exten => vmu2073,n,Goto(vmret,1)

exten => vms2073,1,Macro(vm,2073,NOMESSAGE,${IVR_RETVM})
exten => vms2073,n,Goto(vmret,1)

exten => vmi2073,1,Macro(vm,2073,INSTRUCT,${IVR_RETVM})
exten => vmi2073,n,Goto(vmret,1)

exten => 2074,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2074/ringtimer)}" > "0"]?${DB(AMPUSER/2074/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2074,n,Macro(exten-vm,2074,2074,0,0,0)
exten => 2074,n(dest),Set(__PICKUPMARK=)
exten => 2074,n,Macro(vm,2074,${DIALSTATUS},${IVR_RETVM})
exten => 2074,n,Goto(vmret,1)
exten => 2074,hint,SIP/2074&Custom:DND2074,CustomPresence:2074

exten => vmb2074,1,Macro(vm,2074,BUSY,${IVR_RETVM})
exten => vmb2074,n,Goto(vmret,1)

exten => vmu2074,1,Macro(vm,2074,NOANSWER,${IVR_RETVM})
exten => vmu2074,n,Goto(vmret,1)

exten => vms2074,1,Macro(vm,2074,NOMESSAGE,${IVR_RETVM})
exten => vms2074,n,Goto(vmret,1)

exten => vmi2074,1,Macro(vm,2074,INSTRUCT,${IVR_RETVM})
exten => vmi2074,n,Goto(vmret,1)

exten => 2075,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2075/ringtimer)}" > "0"]?${DB(AMPUSER/2075/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2075,n,Macro(exten-vm,novm,2075,1,1,1)
exten => 2075,n(dest),Set(__PICKUPMARK=)
exten => 2075,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?ivr-4,s,1)
exten => 2075,n,GotoIf($["${DIALSTATUS}"="BUSY"]?ivr-4,s,1)
exten => 2075,n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?ivr-4,s,1)
exten => 2075,n,Goto(${IVR_CONTEXT},return,1)
exten => 2075,hint,SIP/2075&Custom:DND2075,CustomPresence:2075

exten => 2605,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2605/ringtimer)}" > "0"]?${DB(AMPUSER/2605/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2605,n,Macro(exten-vm,2605,2605,0,0,0)
exten => 2605,n(dest),Set(__PICKUPMARK=)
exten => 2605,n,Macro(vm,2605,${DIALSTATUS},${IVR_RETVM})
exten => 2605,n,Goto(vmret,1)
exten => 2605,hint,SIP/2605&Custom:DND2605,CustomPresence:2605

exten => vmb2605,1,Macro(vm,2605,BUSY,${IVR_RETVM})
exten => vmb2605,n,Goto(vmret,1)

exten => vmu2605,1,Macro(vm,2605,NOANSWER,${IVR_RETVM})
exten => vmu2605,n,Goto(vmret,1)

exten => vms2605,1,Macro(vm,2605,NOMESSAGE,${IVR_RETVM})
exten => vms2605,n,Goto(vmret,1)

exten => vmi2605,1,Macro(vm,2605,INSTRUCT,${IVR_RETVM})
exten => vmi2605,n,Goto(vmret,1)

exten => 2607,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2607/ringtimer)}" > "0"]?${DB(AMPUSER/2607/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2607,n,Macro(exten-vm,2607,2607,0,0,0)
exten => 2607,n(dest),Set(__PICKUPMARK=)
exten => 2607,n,Macro(vm,2607,${DIALSTATUS},${IVR_RETVM})
exten => 2607,n,Goto(vmret,1)
exten => 2607,hint,SIP/2607&Custom:DND2607,CustomPresence:2607

exten => vmb2607,1,Macro(vm,2607,BUSY,${IVR_RETVM})
exten => vmb2607,n,Goto(vmret,1)

exten => vmu2607,1,Macro(vm,2607,NOANSWER,${IVR_RETVM})
exten => vmu2607,n,Goto(vmret,1)

exten => vms2607,1,Macro(vm,2607,NOMESSAGE,${IVR_RETVM})
exten => vms2607,n,Goto(vmret,1)

exten => vmi2607,1,Macro(vm,2607,INSTRUCT,${IVR_RETVM})
exten => vmi2607,n,Goto(vmret,1)

exten => 2608,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/2608/ringtimer)}" > "0"]?${DB(AMPUSER/2608/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 2608,n,Macro(exten-vm,2608,2608,0,0,0)
exten => 2608,n(dest),Set(__PICKUPMARK=)
exten => 2608,n,Macro(vm,2608,${DIALSTATUS},${IVR_RETVM})
exten => 2608,n,Goto(vmret,1)
exten => 2608,hint,SIP/2608&Custom:DND2608,CustomPresence:2608

exten => vmb2608,1,Macro(vm,2608,BUSY,${IVR_RETVM})
exten => vmb2608,n,Goto(vmret,1)

exten => vmu2608,1,Macro(vm,2608,NOANSWER,${IVR_RETVM})
exten => vmu2608,n,Goto(vmret,1)

exten => vms2608,1,Macro(vm,2608,NOMESSAGE,${IVR_RETVM})
exten => vms2608,n,Goto(vmret,1)

exten => vmi2608,1,Macro(vm,2608,INSTRUCT,${IVR_RETVM})
exten => vmi2608,n,Goto(vmret,1)

exten => 8181,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/8181/ringtimer)}" > "0"]?${DB(AMPUSER/8181/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 8181,n,Macro(exten-vm,8181,8181,0,0,0)
exten => 8181,n(dest),Set(__PICKUPMARK=)
exten => 8181,n,Macro(vm,8181,${DIALSTATUS},${IVR_RETVM})
exten => 8181,n,Goto(vmret,1)
exten => 8181,hint,SIP/8181&Custom:DND8181,CustomPresence:8181

exten => vmb8181,1,Macro(vm,8181,BUSY,${IVR_RETVM})
exten => vmb8181,n,Goto(vmret,1)

exten => vmu8181,1,Macro(vm,8181,NOANSWER,${IVR_RETVM})
exten => vmu8181,n,Goto(vmret,1)

exten => vms8181,1,Macro(vm,8181,NOMESSAGE,${IVR_RETVM})
exten => vms8181,n,Goto(vmret,1)

exten => vmi8181,1,Macro(vm,8181,INSTRUCT,${IVR_RETVM})
exten => vmi8181,n,Goto(vmret,1)

exten => 8182,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/8182/ringtimer)}" > "0"]?${DB(AMPUSER/8182/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 8182,n,Macro(exten-vm,novm,8182,0,0,0)
exten => 8182,n(dest),Set(__PICKUPMARK=)
exten => 8182,n,Goto(${IVR_CONTEXT},return,1)
exten => 8182,hint,SIP/8182&Custom:DND8182,CustomPresence:8182

exten => 8585,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/8585/ringtimer)}" > "0"]?${DB(AMPUSER/8585/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 8585,n,Macro(exten-vm,novm,8585,0,0,0)
exten => 8585,n(dest),Set(__PICKUPMARK=)
exten => 8585,n,Goto(${IVR_CONTEXT},return,1)
exten => 8585,hint,SIP/8585&Custom:DND8585,CustomPresence:8585

exten => 130199,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/130199/ringtimer)}" > "0"]?${DB(AMPUSER/130199/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 130199,n,Macro(exten-vm,novm,130199,1,1,1)
exten => 130199,n(dest),Set(__PICKUPMARK=)
exten => 130199,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?ext-local,vmu1301,1)
exten => 130199,n,GotoIf($["${DIALSTATUS}"="BUSY"]?ext-local,vmb1301,1)
exten => 130199,n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?ext-local,vmu1301,1)
exten => 130199,n,Goto(${IVR_CONTEXT},return,1)
exten => 130199,hint,SIP/130199&Custom:DND130199,CustomPresence:130199

exten => vmret,1,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => vmret,n,Hangup
exten => vmret,n(playret),Playback(exited-vm-will-be-transfered&silence/1)
exten => vmret,n,Goto(${IVR_CONTEXT},return,1)

exten => h,1,Macro(hangupcall,)

;--== end of [ext-local] ==--;


[app-campon-cancel]
include => app-campon-cancel-custom
exten => *83,1,Answer
exten => *83,n,Set(CCSS_SETUP=TRUE)
exten => *83,n,Macro(user-callerid,)
exten => *83,n,CallCompletionCancel()
exten => *83,n,Playback(beep)
exten => *83,n,Macro(hangupcall,)

;--== end of [app-campon-cancel] ==--;


[app-campon-request]
include => app-campon-request-custom
exten => *82,1,Answer
exten => *82,n,Set(CCSS_SETUP=TRUE)
exten => *82,n,Macro(user-callerid,)
exten => *82,n,CallCompletionRequest()
exten => *82,n,Playback(beep)
exten => *82,n,Macro(hangupcall,)

;--== end of [app-campon-request] ==--;


[sub-ccss]
include => sub-ccss-custom
exten => s,1,ExecIf($[${LEN(${CCSS_SETUP})}]?Return())
exten => s,n,Set(CCSS_SETUP=TRUE)
exten => s,n(monitor),GosubIf($[${LEN(${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)})}]?monitor_config,1(${ARG1},${ARG2}):monitor_default,1(${ARG1},${ARG2}))
exten => s,n(agent),GosubIf($[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})}]?agent_config,1():agent_default,1())
exten => s,n,Set(DB(AMPUSER/${AMPUSER}/ccss/last_number)=${ARG2})
exten => s,n,Return(${GOSUB_RETVAL})

exten => monitor_config,1,Set(CALLCOMPLETION(cc_monitor_policy)=${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)})
exten => monitor_config,n,GotoIf($["CALLCOMPLETION(cc_monitor_policy)" != "never"]?set_monitor)
exten => monitor_config,n,StackPop()
exten => monitor_config,n,Return(FALSE)
exten => monitor_config,n(set_monitor),Set(CALLCOMPLETION(cc_max_monitors)=${DB(AMPUSER/${ARG2}/ccss/max_monitors)})
exten => monitor_config,n,Return(TRUE)

exten => monitor_default,1,GotoIf($["${DB(AMPUSER/${ARG2}/cidname)}" != ""]?is_exten)
exten => monitor_default,n,StackPop()
exten => monitor_default,n,Return(FALSE)
exten => monitor_default,n(is_exten),Set(CALLCOMPLETION(cc_monitor_policy)=generic)
exten => monitor_default,n,Set(CALLCOMPLETION(cc_max_monitors)=5)
exten => monitor_default,n,Return(TRUE)

exten => agent_config,1,Set(CALLCOMPLETION(cc_agent_policy)=${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})
exten => agent_config,n,Set(CALLCOMPLETION(cc_offer_timer)=${DB(AMPUSER/${AMPUSER}/ccss/cc_offer_timer)})
exten => agent_config,n,Set(CALLCOMPLETION(ccbs_available_timer)=${DB(AMPUSER/${AMPUSER}/ccss/ccbs_available_timer)})
exten => agent_config,n,Set(CALLCOMPLETION(ccnr_available_timer)=${DB(AMPUSER/${AMPUSER}/ccss/ccnr_available_timer)})
exten => agent_config,n,Set(CALLCOMPLETION(cc_callback_macro)=ccss-default)
exten => agent_config,n,ExecIf($["${CALLCOMPLETION(cc_agent_policy)}" = "generic"]?Set(CALLCOMPLETION(cc_recall_timer)=${DB(AMPUSER/${AMPUSER}/ccss/cc_recall_timer)}))
exten => agent_config,n,ExecIf($["${CALLCOMPLETION(cc_agent_policy)}" = "generic"]?Set(CALLCOMPLETION(cc_max_agents)=${DB(AMPUSER/${AMPUSER}/ccss/cc_max_agents)}))
exten => agent_config,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}" != ""]?Set(CALLCOMPLETION(cc_agent_dialstring)=Local/${AMPUSER}_${CALLERID(dnid)}@from-ccss-${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}))
exten => agent_config,n,Set(CALLCOMPLETION(cc_callback_macro)=ccss-default)
exten => agent_config,n,Return()

exten => agent_default,1,Set(CALLCOMPLETION(cc_agent_policy)=generic)
exten => agent_default,n,Set(CALLCOMPLETION(cc_offer_timer)=30)
exten => agent_default,n,Set(CALLCOMPLETION(ccbs_available_timer)=4800)
exten => agent_default,n,Set(CALLCOMPLETION(ccnr_available_timer)=7200)
exten => agent_default,n,Set(CALLCOMPLETION(cc_callback_macro)=ccss-default)
exten => agent_default,n,Set(CALLCOMPLETION(cc_recall_timer)=15)
exten => agent_default,n,Set(CALLCOMPLETION(cc_agent_dialstring)=Local/${AMPUSER}_${CALLERID(dnid)}@from-ccss-extension)
exten => agent_default,n,Return(TRUE)

;--== end of [sub-ccss] ==--;


[macro-ccss-default]
include => macro-ccss-default-custom
exten => s,1,Playback(beep&calling&extension)
exten => s,n,SayDigits(${CC_EXTEN})
exten => s,n(siprm),SIPRemoveHeader(${CC_HEADER})
exten => s,n,Set(CALLERID(dnid)=${CC_EXTEN})
exten => s,n,Set(CALLERID(name)=${CALLERID(name)})
exten => s,n,MacroExit()

;--== end of [macro-ccss-default] ==--;


[from-ccss-internal]
include => from-ccss-internal-custom
exten => _X._X.,1,Gosub(sub-from-ccss,s,1(${CUT(EXTEN,_,2)}))
exten => _X._X.,n(no_alert),Goto(from-internal,${CUT(EXTEN,_,1)},1)

;--== end of [from-ccss-internal] ==--;


[from-ccss-extension]
include => from-ccss-extension-custom
exten => _X._X.,1,Gosub(sub-from-ccss,s,1(${CUT(EXTEN,_,2)}))
exten => _X._X.,n,Goto(ext-local,${CUT(EXTEN,_,1)},1)

;--== end of [from-ccss-extension] ==--;


[sub-from-ccss]
include => sub-from-ccss-custom
exten => s,1,Macro(blkvm-set,)
exten => s,n,Set(__CC_RECALL=1)
exten => s,n,Set(CALLERID(name)=${IF($[${LEN(${DB(AMPUSER/${ARG1}/cidname)})}]?${DB(AMPUSER/${ARG1}/cidname)}:CALLBACK)})
exten => s,n,Set(CALLERID(number)=${ARG1})
exten => s,n,Return()
exten => s,n,SIPAddHeader(Alert-Info: ${CC_HEADER})
exten => s,n,Return()

;--== end of [sub-from-ccss] ==--;


[cidlookup]
include => cidlookup-custom
exten => cidlookup_2,1,Set(CURLOPT(httptimeout)=7)
exten => cidlookup_2,n,Set(CALLERID(name)=${CURL(https://api.opencnam.com/v2/phone/${CALLERID(num)}?format=pbx&ref=freepbx)})
exten => cidlookup_2,n,Set(current_hour=${STRFTIME(,,%Y-%m-%d %H)})
exten => cidlookup_2,n,Set(last_query_hour=${DB(cidlookup/opencnam_last_query_hour)})
exten => cidlookup_2,n,Set(total_hourly_queries=${DB(cidlookup/opencnam_total_hourly_queries)})
exten => cidlookup_2,n,ExecIf($["${last_query_hour}" != "${current_hour}"]?Set(DB(cidlookup/opencnam_total_hourly_queries)=0))
exten => cidlookup_2,n,ExecIf($["${total_hourly_queries}" = ""]?Set(DB(cidlookup/opencnam_total_hourly_queries)=0))
exten => cidlookup_2,n,Set(DB(cidlookup/opencnam_total_hourly_queries)=${MATH(${DB(cidlookup/opencnam_total_hourly_queries)}+1,i)})
exten => cidlookup_2,n,ExecIf($[${DB(cidlookup/opencnam_total_hourly_queries)} >= 60]?System(${ASTVARLIBDIR}/bin/opencnam-alert.php))
exten => cidlookup_2,n,Set(DB(cidlookup/opencnam_last_query_hour)=${current_hour})
exten => cidlookup_2,n,Return()

exten => cidlookup_return,1,ExecIf($["${DB(cidname/${CALLERID(num)})}" != ""]?Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})}))
exten => cidlookup_return,n,Return()

;--== end of [cidlookup] ==--;


[ext-meetme]
include => ext-meetme-custom
exten => STARTMEETME,1,ExecIf($["${MEETME_MUSIC}" != ""]?Set(CONFBRIDGE(user,music_on_hold_class)=${MEETME_MUSIC}))
exten => STARTMEETME,n,ExecIf($["${MEETME_MUSIC}" != ""]?Set(CHANNEL(musicclass)=${MEETME_MUSIC}))
exten => STARTMEETME,n,Set(GROUP(meetme)=${MEETME_ROOMNUM})
exten => STARTMEETME,n,GotoIf($[${MAX_PARTICIPANTS} > 0 && ${GROUP_COUNT(${MEETME_ROOMNUM}@meetme)}>${MAX_PARTICIPANTS}]?MEETMEFULL,1)
exten => STARTMEETME,n,ConfBridge(${MEETME_ROOMNUM},,,${MENU_PROFILE})
exten => STARTMEETME,n,Hangup

exten => MEETMEFULL,1,Playback(im-sorry&conf-full&goodbye)
exten => MEETMEFULL,n,Hangup

exten => h,1,Hangup

exten => 7000,1,Macro(user-callerid,)
exten => 7000,n,Set(MEETME_ROOMNUM=7000)
exten => 7000,n,Set(MAX_PARTICIPANTS=0)
exten => 7000,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7000,n,ExecIf($["${DB(CONFERENCE/7000/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7000/users)}))
exten => 7000,n,ExecIf($["${DB(CONFERENCE/7000/music)}" != "inherit" & "${DB(CONFERENCE/7000/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7000/music)}))
exten => 7000,n,Gosub(sub-record-check,s,1(conf,7000,never))
exten => 7000,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7000,n,Answer
exten => 7000,n,Wait(1)
exten => 7000,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7000/userpin)}" = "" & "${DB(CONFERENCE/7000/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7000,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7000,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7000/userpin)}]?USER)
exten => 7000,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7000/adminpin)}]?ADMIN)
exten => 7000,n(READPIN),Set(PINCOUNT=0)
exten => 7000,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7000,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7000/userpin)}]?USER)
exten => 7000,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7000/adminpin)}]?ADMIN)
exten => 7000,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7000,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7000,n,Playback(conf-invalidpin)
exten => 7000,n,Goto(READPIN)
exten => 7000,n(ADMIN),Gosub(sub-conference-options,s,1(7000,ADMIN))
exten => 7000,n,ExecIf($["${DB(CONFERENCE/7000/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7000/joinmsg)}))
exten => 7000,n,Goto(STARTMEETME,1)
exten => 7000,n(USER),Gosub(sub-conference-options,s,1(7000,USER))
exten => 7000,n,ExecIf($["${DB(CONFERENCE/7000/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7000/joinmsg)}))
exten => 7000,n,Goto(STARTMEETME,1)
exten => 7000,hint,confbridge:7000

exten => 7001,1,Macro(user-callerid,)
exten => 7001,n,Set(MEETME_ROOMNUM=7001)
exten => 7001,n,Set(MAX_PARTICIPANTS=0)
exten => 7001,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7001,n,ExecIf($["${DB(CONFERENCE/7001/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7001/users)}))
exten => 7001,n,ExecIf($["${DB(CONFERENCE/7001/music)}" != "inherit" & "${DB(CONFERENCE/7001/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7001/music)}))
exten => 7001,n,Gosub(sub-record-check,s,1(conf,7001,never))
exten => 7001,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7001,n,Answer
exten => 7001,n,Wait(1)
exten => 7001,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7001/userpin)}" = "" & "${DB(CONFERENCE/7001/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7001,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7001,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7001/userpin)}]?USER)
exten => 7001,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7001/adminpin)}]?ADMIN)
exten => 7001,n(READPIN),Set(PINCOUNT=0)
exten => 7001,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7001,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7001/userpin)}]?USER)
exten => 7001,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7001/adminpin)}]?ADMIN)
exten => 7001,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7001,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7001,n,Playback(conf-invalidpin)
exten => 7001,n,Goto(READPIN)
exten => 7001,n(ADMIN),Gosub(sub-conference-options,s,1(7001,ADMIN))
exten => 7001,n,ExecIf($["${DB(CONFERENCE/7001/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7001/joinmsg)}))
exten => 7001,n,Goto(STARTMEETME,1)
exten => 7001,n(USER),Gosub(sub-conference-options,s,1(7001,USER))
exten => 7001,n,ExecIf($["${DB(CONFERENCE/7001/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7001/joinmsg)}))
exten => 7001,n,Goto(STARTMEETME,1)
exten => 7001,hint,confbridge:7001

exten => 7002,1,Macro(user-callerid,)
exten => 7002,n,Set(MEETME_ROOMNUM=7002)
exten => 7002,n,Set(MAX_PARTICIPANTS=0)
exten => 7002,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7002,n,ExecIf($["${DB(CONFERENCE/7002/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7002/users)}))
exten => 7002,n,ExecIf($["${DB(CONFERENCE/7002/music)}" != "inherit" & "${DB(CONFERENCE/7002/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7002/music)}))
exten => 7002,n,Gosub(sub-record-check,s,1(conf,7002,never))
exten => 7002,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7002,n,Answer
exten => 7002,n,Wait(1)
exten => 7002,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7002/userpin)}" = "" & "${DB(CONFERENCE/7002/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7002,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7002,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7002/userpin)}]?USER)
exten => 7002,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7002/adminpin)}]?ADMIN)
exten => 7002,n(READPIN),Set(PINCOUNT=0)
exten => 7002,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7002,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7002/userpin)}]?USER)
exten => 7002,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7002/adminpin)}]?ADMIN)
exten => 7002,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7002,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7002,n,Playback(conf-invalidpin)
exten => 7002,n,Goto(READPIN)
exten => 7002,n(ADMIN),Gosub(sub-conference-options,s,1(7002,ADMIN))
exten => 7002,n,ExecIf($["${DB(CONFERENCE/7002/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7002/joinmsg)}))
exten => 7002,n,Goto(STARTMEETME,1)
exten => 7002,n(USER),Gosub(sub-conference-options,s,1(7002,USER))
exten => 7002,n,ExecIf($["${DB(CONFERENCE/7002/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7002/joinmsg)}))
exten => 7002,n,Goto(STARTMEETME,1)
exten => 7002,hint,confbridge:7002

exten => 7003,1,Macro(user-callerid,)
exten => 7003,n,Set(MEETME_ROOMNUM=7003)
exten => 7003,n,Set(MAX_PARTICIPANTS=0)
exten => 7003,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7003,n,ExecIf($["${DB(CONFERENCE/7003/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7003/users)}))
exten => 7003,n,ExecIf($["${DB(CONFERENCE/7003/music)}" != "inherit" & "${DB(CONFERENCE/7003/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7003/music)}))
exten => 7003,n,Gosub(sub-record-check,s,1(conf,7003,never))
exten => 7003,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7003,n,Answer
exten => 7003,n,Wait(1)
exten => 7003,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7003/userpin)}" = "" & "${DB(CONFERENCE/7003/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7003,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7003,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7003/userpin)}]?USER)
exten => 7003,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7003/adminpin)}]?ADMIN)
exten => 7003,n(READPIN),Set(PINCOUNT=0)
exten => 7003,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7003,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7003/userpin)}]?USER)
exten => 7003,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7003/adminpin)}]?ADMIN)
exten => 7003,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7003,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7003,n,Playback(conf-invalidpin)
exten => 7003,n,Goto(READPIN)
exten => 7003,n(ADMIN),Gosub(sub-conference-options,s,1(7003,ADMIN))
exten => 7003,n,ExecIf($["${DB(CONFERENCE/7003/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7003/joinmsg)}))
exten => 7003,n,Goto(STARTMEETME,1)
exten => 7003,n(USER),Gosub(sub-conference-options,s,1(7003,USER))
exten => 7003,n,ExecIf($["${DB(CONFERENCE/7003/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7003/joinmsg)}))
exten => 7003,n,Goto(STARTMEETME,1)
exten => 7003,hint,confbridge:7003

exten => 7004,1,Macro(user-callerid,)
exten => 7004,n,Set(MEETME_ROOMNUM=7004)
exten => 7004,n,Set(MAX_PARTICIPANTS=0)
exten => 7004,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7004,n,ExecIf($["${DB(CONFERENCE/7004/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7004/users)}))
exten => 7004,n,ExecIf($["${DB(CONFERENCE/7004/music)}" != "inherit" & "${DB(CONFERENCE/7004/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7004/music)}))
exten => 7004,n,Gosub(sub-record-check,s,1(conf,7004,never))
exten => 7004,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7004,n,Answer
exten => 7004,n,Wait(1)
exten => 7004,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7004/userpin)}" = "" & "${DB(CONFERENCE/7004/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7004,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7004,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7004/userpin)}]?USER)
exten => 7004,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7004/adminpin)}]?ADMIN)
exten => 7004,n(READPIN),Set(PINCOUNT=0)
exten => 7004,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7004,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7004/userpin)}]?USER)
exten => 7004,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7004/adminpin)}]?ADMIN)
exten => 7004,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7004,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7004,n,Playback(conf-invalidpin)
exten => 7004,n,Goto(READPIN)
exten => 7004,n(ADMIN),Gosub(sub-conference-options,s,1(7004,ADMIN))
exten => 7004,n,ExecIf($["${DB(CONFERENCE/7004/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7004/joinmsg)}))
exten => 7004,n,Goto(STARTMEETME,1)
exten => 7004,n(USER),Gosub(sub-conference-options,s,1(7004,USER))
exten => 7004,n,ExecIf($["${DB(CONFERENCE/7004/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7004/joinmsg)}))
exten => 7004,n,Goto(STARTMEETME,1)
exten => 7004,hint,confbridge:7004

exten => 7005,1,Macro(user-callerid,)
exten => 7005,n,Set(MEETME_ROOMNUM=7005)
exten => 7005,n,Set(MAX_PARTICIPANTS=0)
exten => 7005,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7005,n,ExecIf($["${DB(CONFERENCE/7005/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7005/users)}))
exten => 7005,n,ExecIf($["${DB(CONFERENCE/7005/music)}" != "inherit" & "${DB(CONFERENCE/7005/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7005/music)}))
exten => 7005,n,Gosub(sub-record-check,s,1(conf,7005,never))
exten => 7005,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7005,n,Answer
exten => 7005,n,Wait(1)
exten => 7005,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7005/userpin)}" = "" & "${DB(CONFERENCE/7005/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7005,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7005,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7005/userpin)}]?USER)
exten => 7005,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7005/adminpin)}]?ADMIN)
exten => 7005,n(READPIN),Set(PINCOUNT=0)
exten => 7005,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7005,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7005/userpin)}]?USER)
exten => 7005,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7005/adminpin)}]?ADMIN)
exten => 7005,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7005,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7005,n,Playback(conf-invalidpin)
exten => 7005,n,Goto(READPIN)
exten => 7005,n(ADMIN),Gosub(sub-conference-options,s,1(7005,ADMIN))
exten => 7005,n,ExecIf($["${DB(CONFERENCE/7005/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7005/joinmsg)}))
exten => 7005,n,Goto(STARTMEETME,1)
exten => 7005,n(USER),Gosub(sub-conference-options,s,1(7005,USER))
exten => 7005,n,ExecIf($["${DB(CONFERENCE/7005/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7005/joinmsg)}))
exten => 7005,n,Goto(STARTMEETME,1)
exten => 7005,hint,confbridge:7005

exten => 7006,1,Macro(user-callerid,)
exten => 7006,n,Set(MEETME_ROOMNUM=7006)
exten => 7006,n,Set(MAX_PARTICIPANTS=0)
exten => 7006,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7006,n,ExecIf($["${DB(CONFERENCE/7006/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7006/users)}))
exten => 7006,n,ExecIf($["${DB(CONFERENCE/7006/music)}" != "inherit" & "${DB(CONFERENCE/7006/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7006/music)}))
exten => 7006,n,Gosub(sub-record-check,s,1(conf,7006,never))
exten => 7006,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7006,n,Answer
exten => 7006,n,Wait(1)
exten => 7006,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7006/userpin)}" = "" & "${DB(CONFERENCE/7006/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7006,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7006,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7006/userpin)}]?USER)
exten => 7006,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7006/adminpin)}]?ADMIN)
exten => 7006,n(READPIN),Set(PINCOUNT=0)
exten => 7006,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7006,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7006/userpin)}]?USER)
exten => 7006,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7006/adminpin)}]?ADMIN)
exten => 7006,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7006,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7006,n,Playback(conf-invalidpin)
exten => 7006,n,Goto(READPIN)
exten => 7006,n(ADMIN),Gosub(sub-conference-options,s,1(7006,ADMIN))
exten => 7006,n,ExecIf($["${DB(CONFERENCE/7006/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7006/joinmsg)}))
exten => 7006,n,Goto(STARTMEETME,1)
exten => 7006,n(USER),Gosub(sub-conference-options,s,1(7006,USER))
exten => 7006,n,ExecIf($["${DB(CONFERENCE/7006/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7006/joinmsg)}))
exten => 7006,n,Goto(STARTMEETME,1)
exten => 7006,hint,confbridge:7006

exten => 7007,1,Macro(user-callerid,)
exten => 7007,n,Set(MEETME_ROOMNUM=7007)
exten => 7007,n,Set(MAX_PARTICIPANTS=0)
exten => 7007,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7007,n,ExecIf($["${DB(CONFERENCE/7007/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7007/users)}))
exten => 7007,n,ExecIf($["${DB(CONFERENCE/7007/music)}" != "inherit" & "${DB(CONFERENCE/7007/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7007/music)}))
exten => 7007,n,Gosub(sub-record-check,s,1(conf,7007,never))
exten => 7007,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7007,n,Answer
exten => 7007,n,Wait(1)
exten => 7007,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7007/userpin)}" = "" & "${DB(CONFERENCE/7007/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7007,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7007,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7007/userpin)}]?USER)
exten => 7007,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7007/adminpin)}]?ADMIN)
exten => 7007,n(READPIN),Set(PINCOUNT=0)
exten => 7007,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7007,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7007/userpin)}]?USER)
exten => 7007,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7007/adminpin)}]?ADMIN)
exten => 7007,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7007,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7007,n,Playback(conf-invalidpin)
exten => 7007,n,Goto(READPIN)
exten => 7007,n(ADMIN),Gosub(sub-conference-options,s,1(7007,ADMIN))
exten => 7007,n,ExecIf($["${DB(CONFERENCE/7007/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7007/joinmsg)}))
exten => 7007,n,Goto(STARTMEETME,1)
exten => 7007,n(USER),Gosub(sub-conference-options,s,1(7007,USER))
exten => 7007,n,ExecIf($["${DB(CONFERENCE/7007/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7007/joinmsg)}))
exten => 7007,n,Goto(STARTMEETME,1)
exten => 7007,hint,confbridge:7007

exten => 7008,1,Macro(user-callerid,)
exten => 7008,n,Set(MEETME_ROOMNUM=7008)
exten => 7008,n,Set(MAX_PARTICIPANTS=0)
exten => 7008,n,Set(MEETME_MUSIC=${MOHCLASS})
exten => 7008,n,ExecIf($["${DB(CONFERENCE/7008/users)}" != ""]?Set(MAX_PARTICIPANTS=${DB(CONFERENCE/7008/users)}))
exten => 7008,n,ExecIf($["${DB(CONFERENCE/7008/music)}" != "inherit" & "${DB(CONFERENCE/7008/music)}" != ""]?Set(MEETME_MUSIC=${DB(CONFERENCE/7008/music)}))
exten => 7008,n,Gosub(sub-record-check,s,1(conf,7008,never))
exten => 7008,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWERED)
exten => 7008,n,Answer
exten => 7008,n,Wait(1)
exten => 7008,n(ANSWERED),GotoIf($["${DB(CONFERENCE/7008/userpin)}" = "" & "${DB(CONFERENCE/7008/adminpin)}" = ""]?USER:CHECKPIN)
exten => 7008,n(CHECKPIN),GotoIf($["z${PIN}" = "z"]?READPIN)
exten => 7008,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7008/userpin)}]?USER)
exten => 7008,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7008/adminpin)}]?ADMIN)
exten => 7008,n(READPIN),Set(PINCOUNT=0)
exten => 7008,n,Read(PIN,enter-conf-pin-number,,,,)
exten => 7008,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7008/userpin)}]?USER)
exten => 7008,n,GotoIf($[x${PIN} = x${DB(CONFERENCE/7008/adminpin)}]?ADMIN)
exten => 7008,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => 7008,n,GotoIf($[${PINCOUNT}>3]?h,1)
exten => 7008,n,Playback(conf-invalidpin)
exten => 7008,n,Goto(READPIN)
exten => 7008,n(ADMIN),Gosub(sub-conference-options,s,1(7008,ADMIN))
exten => 7008,n,ExecIf($["${DB(CONFERENCE/7008/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7008/joinmsg)}))
exten => 7008,n,Goto(STARTMEETME,1)
exten => 7008,n(USER),Gosub(sub-conference-options,s,1(7008,USER))
exten => 7008,n,ExecIf($["${DB(CONFERENCE/7008/joinmsg)}" != ""]?Playback(${DB(CONFERENCE/7008/joinmsg)}))
exten => 7008,n,Goto(STARTMEETME,1)
exten => 7008,hint,confbridge:7008

exten => *87,1,Hangup
exten => *87,hint,confbridge:7000&confbridge:7001&confbridge:7002&confbridge:7003&confbridge:7004&confbridge:7005&confbridge:7006&confbridge:7007&confbridge:7008

;--== end of [ext-meetme] ==--;


[sub-conference-options]
include => sub-conference-options-custom
exten => s,1,Noop(Setting options for Conference ${ARG1})
exten => s,n,Goto(${ARG2})
exten => s,n(USER),ExecIf(${REGEX("w" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,wait_marked)=yes))
exten => s,n,ExecIf(${REGEX("w" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,end_marked)=yes))
exten => s,n,ExecIf(${REGEX("s" ${DB(CONFERENCE/${ARG1}/options)})}?Set(MENU_PROFILE=user_menu))
exten => s,n,ExecIf(${REGEX("m" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,startmuted)=yes))
exten => s,n,Goto(RETURN)
exten => s,n(ADMIN),Set(CONFBRIDGE(user,admin)=yes)
exten => s,n,Set(CONFBRIDGE(user,marked)=yes)
exten => s,n,ExecIf(${REGEX("s" ${DB(CONFERENCE/${ARG1}/options)})}?Set(MENU_PROFILE=admin_menu))
exten => s,n,Goto(RETURN)
exten => s,n(RETURN),Noop(Setting Additional Options:)
exten => s,n,ExecIf(${REGEX("q" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,quiet)=yes))
exten => s,n,ExecIf(${REGEX("c" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,announce_user_count)=yes))
exten => s,n,ExecIf(${REGEX("I" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,announce_join_leave)=yes))
exten => s,n,ExecIf(${REGEX("o" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,dsp_drop_silence)=yes))
exten => s,n,ExecIf(${REGEX("T" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,talk_detection_events)=yes))
exten => s,n,ExecIf(${REGEX("M" ${DB(CONFERENCE/${ARG1}/options)})}?Set(CONFBRIDGE(user,music_on_hold_when_empty)=yes))
exten => s,n,Return()

;--== end of [sub-conference-options] ==--;


[Matisia_PBX]
include => Matisia_PBX-custom
include => parkedcalls
include => from-internal-custom
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => Matisia_PBX_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Matisia_PBX] ==--;


[Matisia_PBX_rulematch]
include => Matisia_PBX_rulematch-custom
include => parkedcalls
include => from-internal-custom
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => Matisia_PBX_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Matisia_PBX_rulematch] ==--;


[Matisia_PBX_bad-number]
include => Matisia_PBX_bad-number-custom

;--== end of [Matisia_PBX_bad-number] ==--;


[Meeco_PBX]
include => Meeco_PBX-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => Meeco_PBX_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Meeco_PBX] ==--;


[Meeco_PBX_rulematch]
include => Meeco_PBX_rulematch-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => Meeco_PBX_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Meeco_PBX_rulematch] ==--;


[Meeco_PBX_bad-number]
include => Meeco_PBX_bad-number-custom

;--== end of [Meeco_PBX_bad-number] ==--;


[West_Seattle_Computers]
include => West_Seattle_Computers-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => app-miscapps
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-6
include => West_Seattle_Computers_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [West_Seattle_Computers] ==--;


[West_Seattle_Computers_rulematch]
include => West_Seattle_Computers_rulematch-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => app-miscapps
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-6
include => West_Seattle_Computers_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [West_Seattle_Computers_rulematch] ==--;


[West_Seattle_Computers_bad-number]
include => West_Seattle_Computers_bad-number-custom

;--== end of [West_Seattle_Computers_bad-number] ==--;


[Acuitas_Investments]
include => Acuitas_Investments-custom
include => parkedcalls
include => from-internal-custom
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => Acuitas_Investments_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Acuitas_Investments] ==--;


[Acuitas_Investments_rulematch]
include => Acuitas_Investments_rulematch-custom
include => parkedcalls
include => from-internal-custom
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => Acuitas_Investments_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Acuitas_Investments_rulematch] ==--;


[Acuitas_Investments_bad-number]
include => Acuitas_Investments_bad-number-custom

;--== end of [Acuitas_Investments_bad-number] ==--;


[BlueMoon]
include => BlueMoon-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => outrt-5
include => BlueMoon_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [BlueMoon] ==--;


[BlueMoon_rulematch]
include => BlueMoon_rulematch-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-3
include => outrt-1
include => outrt-5
include => BlueMoon_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [BlueMoon_rulematch] ==--;


[BlueMoon_bad-number]
include => BlueMoon_bad-number-custom

;--== end of [BlueMoon_bad-number] ==--;


[SWA]
include => SWA-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => SWA_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [SWA] ==--;


[SWA_rulematch]
include => SWA_rulematch-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => SWA_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [SWA_rulematch] ==--;


[SWA_bad-number]
include => SWA_bad-number-custom

;--== end of [SWA_bad-number] ==--;


[Juba]
include => Juba-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => outrt-5
include => outrt-4
include => Juba_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Juba] ==--;


[Juba_rulematch]
include => Juba_rulematch-custom
include => from-internal-custom
include => parkedcalls
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fax
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outrt-2
include => outrt-1
include => outrt-5
include => outrt-4
include => Juba_bad-number
include => bad-number
exten => s,1,Macro(hangupcall,)

exten => h,1,Macro(hangupcall,)

;--== end of [Juba_rulematch] ==--;


[Juba_bad-number]
include => Juba_bad-number-custom

;--== end of [Juba_bad-number] ==--;


[c-x-3-operator-panel-hold]
include => c-x-3-operator-panel-hold-custom
exten => 432111,1,MusicOnHold(${XMLNamespaceMusicOnHoldClass})
exten => 432111,n,Hangup

;--== end of [c-x-3-operator-panel-hold] ==--;


[c-x-3-operator-panel-voice-mail]
include => c-x-3-operator-panel-voice-mail-custom
exten => 432112,1,VoiceMail(${XMLNamespaceVoiceMailBox}@${XMLNamespaceVoiceMailBoxContext},u)
exten => 432112,n,Hangup

;--== end of [c-x-3-operator-panel-voice-mail] ==--;


[c-x-3-operator-panel-meetme]
include => c-x-3-operator-panel-meetme-custom
exten => 432113,1,ConfBridge(${XMLNamespaceMeetMeRoomNumber},${XMLNamespaceMeetMeRoomOptions},,)
exten => 432113,n,Hangup

;--== end of [c-x-3-operator-panel-meetme] ==--;


[c-x-3-operator-panel-confbridge]
include => c-x-3-operator-panel-confbridge-custom
exten => 432113,1,ConfBridge(${XMLNamespaceMeetMeRoomNumber},,,)
exten => 432113,n,Hangup

;--== end of [c-x-3-operator-panel-confbridge] ==--;


[c-x-3-operator-panel-park]
include => c-x-3-operator-panel-park-custom
exten => 432114,1,ParkAndAnnounce(pbx-transfer:PARKED,200,Local/432116@c-x-3-operator-panel-park-announce-answer,${XMLNamespaceParkContext},${XMLNamespaceParkExtension},1)
exten => 432114,n,Hangup

;--== end of [c-x-3-operator-panel-park] ==--;


[c-x-3-operator-panel-park-announce-answer]
include => c-x-3-operator-panel-park-announce-answer-custom
exten => 432116,1,Answer
exten => 432116,n,Hangup

;--== end of [c-x-3-operator-panel-park-announce-answer] ==--;


[c-x-3-operator-panel-listen-to-voice-mail]
include => c-x-3-operator-panel-listen-to-voice-mail-custom
exten => 432115,1,ControlPlayback(${XMLNamespaceVoiceMailPath},1000,*,#,7,8,9)
exten => 432115,n,Hangup

;--== end of [c-x-3-operator-panel-listen-to-voice-mail] ==--;


[c-x-3-operator-panel-listen-to-recording]
include => c-x-3-operator-panel-listen-to-recording-custom
exten => 432118,1,ControlPlayback(${XMLNamespaceRecordingPath},1000,*,#,7,8,9)
exten => 432118,n,Hangup

;--== end of [c-x-3-operator-panel-listen-to-recording] ==--;


[c-x-3-operator-panel-spy]
include => c-x-3-operator-panel-spy-custom
exten => 432117,1,ChanSpy(${XMLNamespaceChanSpyChannel},${XMLNamespaceChanSpyOptions})
exten => 432117,n,Hangup

;--== end of [c-x-3-operator-panel-spy] ==--;


[app-dictate-send]
include => app-dictate-send-custom
exten => *35,1,Answer
exten => *35,n,Macro(user-callerid,)
exten => *35,n,Noop(CallerID is ${AMPUSER})
exten => *35,n,Set(DICTENABLED=${DB(AMPUSER/${AMPUSER}/dictate/enabled)})
exten => *35,n,GotoIf($[$["x${DICTENABLED}"="x"]|$["x${DICTENABLED}"="xdisabled"]]?nodict:dictok)
exten => *35,n(nodict),Playback(feature-not-avail-line)
exten => *35,n,Hangup
exten => *35,n(dictok),Read(DICTFILE,enter-filename-short,,,,)
exten => *35,n,Set(DICTEMAIL=${DB(AMPUSER/${AMPUSER}/dictate/email)})
exten => *35,n,Set(DICTFMT=${DB(AMPUSER/${AMPUSER}/dictate/format)})
exten => *35,n,Set(NAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => *35,n,Playback(dictation-being-processed)
exten => *35,n,System(/var/lib/asterisk/bin/audio-email.pl --file /var/lib/asterisk/sounds/dictate/${AMPUSER}/${DICTFILE}.raw --attachment dict-${DICTFILE} --format ${DICTFMT} --to ${DICTEMAIL} --subject "Dictation from ${NAME} Attached")
exten => *35,n,Playback(dictation-sent)
exten => *35,n,Macro(hangupcall,)

;--== end of [app-dictate-send] ==--;


[app-dictate-record]
include => app-dictate-record-custom
exten => *34,1,Answer
exten => *34,n,Macro(user-callerid,)
exten => *34,n,Noop(CallerID is ${AMPUSER})
exten => *34,n,Set(DICTENABLED=${DB(AMPUSER/${AMPUSER}/dictate/enabled)})
exten => *34,n,GotoIf($[$["x${DICTENABLED}"="x"]|$["x${DICTENABLED}"="xdisabled"]]?nodict:dictok)
exten => *34,n(nodict),Playback(feature-not-avail-line)
exten => *34,n,Hangup
exten => *34,n(dictok),Dictate(/var/lib/asterisk/sounds/dictate/${AMPUSER})
exten => *34,n,Macro(hangupcall,)

;--== end of [app-dictate-record] ==--;


[directory]
include => directory-custom
exten => 2,1,Answer
exten => 2,n,Wait(1)
exten => 2,n,AGI(directory.agi,dir=2,retivr=true)
exten => 2,n,Playback(pls-hold-while-try&to-extension)
exten => 2,n,SayDigits(${DIR_DIAL})
exten => 2,n(dial-2),Ringing()
exten => 2,n,Goto(from-internal,${DIR_DIAL},1)

exten => 1,1,Answer
exten => 1,n,Wait(1)
exten => 1,n,AGI(directory.agi,dir=1,retivr=false)
exten => 1,n(dial-1),Ringing()
exten => 1,n,Goto(from-internal,${DIR_DIAL},1)

exten => 4,1,Answer
exten => 4,n,Wait(1)
exten => 4,n,AGI(directory.agi,dir=4,retivr=false)
exten => 4,n(dial-4),Ringing()
exten => 4,n,Goto(from-internal,${DIR_DIAL},1)

exten => invalid,1(invalid),Playback(${DIR_INVALID_RECORDING})
exten => invalid,n,Ringing()
exten => invalid,n,Goto(${DIR_INVALID_CONTEXT},${DIR_INVALID_EXTEN},${DIR_INVALID_PRI})

exten => retivr,1(retivr),Playback(${DIR_INVALID_RECORDING})
exten => retivr,n,Goto(${IVR_CONTEXT},return,1)

exten => h,1,Macro(hangupcall,)

;--== end of [directory] ==--;


[app-dnd-off]
include => app-dnd-off-custom
exten => *79,1,Answer
exten => *79,n,Wait(1)
exten => *79,n,Macro(user-callerid,)
exten => *79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
exten => *79,n,Set(STATE=NOT_INUSE)
exten => *79,n,Gosub(app-dnd-off,sstate,1())
exten => *79,n(hook_1),Playback(do-not-disturb&de-activated)
exten => *79,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-dnd-off] ==--;


[app-dnd-on]
include => app-dnd-on-custom
exten => *78,1,Answer
exten => *78,n,Wait(1)
exten => *78,n,Macro(user-callerid,)
exten => *78,n,Set(DB(DND/${AMPUSER})=YES)
exten => *78,n,Set(STATE=BUSY)
exten => *78,n,Gosub(app-dnd-on,sstate,1())
exten => *78,n(hook_1),Playback(do-not-disturb&activated)
exten => *78,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-dnd-on] ==--;


[app-dnd-toggle]
include => app-dnd-toggle-custom
exten => *76,1,Answer
exten => *76,n,Wait(1)
exten => *76,n,Macro(user-callerid,)
exten => *76,n,GotoIf($["${DB(DND/${AMPUSER})}" = ""]?activate:deactivate)
exten => *76,n(activate),Set(DB(DND/${AMPUSER})=YES)
exten => *76,n,Set(STATE=BUSY)
exten => *76,n,Gosub(app-dnd-toggle,sstate,1())
exten => *76,n(hook_on),Playback(do-not-disturb&activated)
exten => *76,n,Macro(hangupcall,)
exten => *76,n(deactivate),Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
exten => *76,n,Set(STATE=NOT_INUSE)
exten => *76,n,Gosub(app-dnd-toggle,sstate,1())
exten => *76,n(hook_off),Playback(do-not-disturb&de-activated)
exten => *76,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-dnd-toggle] ==--;


[ext-dnd-hints]
include => ext-dnd-hints-custom
exten => *76100,1,Goto(app-dnd-toggle,*76,1)
exten => *76100,hint,Custom:DEVDND100

exten => *76101,1,Goto(app-dnd-toggle,*76,1)
exten => *76101,hint,Custom:DEVDND101

exten => *76102,1,Goto(app-dnd-toggle,*76,1)
exten => *76102,hint,Custom:DEVDND102

exten => *76103,1,Goto(app-dnd-toggle,*76,1)
exten => *76103,hint,Custom:DEVDND103

exten => *76104,1,Goto(app-dnd-toggle,*76,1)
exten => *76104,hint,Custom:DEVDND104

exten => *76105,1,Goto(app-dnd-toggle,*76,1)
exten => *76105,hint,Custom:DEVDND105

exten => *76106,1,Goto(app-dnd-toggle,*76,1)
exten => *76106,hint,Custom:DEVDND106

exten => *76108,1,Goto(app-dnd-toggle,*76,1)
exten => *76108,hint,Custom:DEVDND108

exten => *76109,1,Goto(app-dnd-toggle,*76,1)
exten => *76109,hint,Custom:DEVDND109

exten => *76110,1,Goto(app-dnd-toggle,*76,1)
exten => *76110,hint,Custom:DEVDND110

exten => *76113,1,Goto(app-dnd-toggle,*76,1)
exten => *76113,hint,Custom:DEVDND113

exten => *76124,1,Goto(app-dnd-toggle,*76,1)
exten => *76124,hint,Custom:DEVDND124

exten => *761300,1,Goto(app-dnd-toggle,*76,1)
exten => *761300,hint,Custom:DEVDND1300

exten => *761301,1,Goto(app-dnd-toggle,*76,1)
exten => *761301,hint,Custom:DEVDND1301

exten => *76130199,1,Goto(app-dnd-toggle,*76,1)
exten => *76130199,hint,Custom:DEVDND130199

exten => *761302,1,Goto(app-dnd-toggle,*76,1)
exten => *761302,hint,Custom:DEVDND1302

exten => *761303,1,Goto(app-dnd-toggle,*76,1)
exten => *761303,hint,Custom:DEVDND1303

exten => *761304,1,Goto(app-dnd-toggle,*76,1)
exten => *761304,hint,Custom:DEVDND1304

exten => *761305,1,Goto(app-dnd-toggle,*76,1)
exten => *761305,hint,Custom:DEVDND1305

exten => *761306,1,Goto(app-dnd-toggle,*76,1)
exten => *761306,hint,Custom:DEVDND1306

exten => *761307,1,Goto(app-dnd-toggle,*76,1)
exten => *761307,hint,Custom:DEVDND1307

exten => *761308,1,Goto(app-dnd-toggle,*76,1)
exten => *761308,hint,Custom:DEVDND1308

exten => *761309,1,Goto(app-dnd-toggle,*76,1)
exten => *761309,hint,Custom:DEVDND1309

exten => *761310,1,Goto(app-dnd-toggle,*76,1)
exten => *761310,hint,Custom:DEVDND1310

exten => *761311,1,Goto(app-dnd-toggle,*76,1)
exten => *761311,hint,Custom:DEVDND1311

exten => *761312,1,Goto(app-dnd-toggle,*76,1)
exten => *761312,hint,Custom:DEVDND1312

exten => *76197,1,Goto(app-dnd-toggle,*76,1)
exten => *76197,hint,Custom:DEVDND197

exten => *76198,1,Goto(app-dnd-toggle,*76,1)
exten => *76198,hint,Custom:DEVDND198

exten => *76199,1,Goto(app-dnd-toggle,*76,1)
exten => *76199,hint,Custom:DEVDND199

exten => *761996,1,Goto(app-dnd-toggle,*76,1)
exten => *761996,hint,Custom:DEVDND1996

exten => *761997,1,Goto(app-dnd-toggle,*76,1)
exten => *761997,hint,Custom:DEVDND1997

exten => *761998,1,Goto(app-dnd-toggle,*76,1)
exten => *761998,hint,Custom:DEVDND1998

exten => *761999,1,Goto(app-dnd-toggle,*76,1)
exten => *761999,hint,Custom:DEVDND1999

exten => *762,1,Goto(app-dnd-toggle,*76,1)
exten => *762,hint,Custom:DEVDND2

exten => *762071,1,Goto(app-dnd-toggle,*76,1)
exten => *762071,hint,Custom:DEVDND2071

exten => *762072,1,Goto(app-dnd-toggle,*76,1)
exten => *762072,hint,Custom:DEVDND2072

exten => *762073,1,Goto(app-dnd-toggle,*76,1)
exten => *762073,hint,Custom:DEVDND2073

exten => *762074,1,Goto(app-dnd-toggle,*76,1)
exten => *762074,hint,Custom:DEVDND2074

exten => *762075,1,Goto(app-dnd-toggle,*76,1)
exten => *762075,hint,Custom:DEVDND2075

exten => *762605,1,Goto(app-dnd-toggle,*76,1)
exten => *762605,hint,Custom:DEVDND2605

exten => *762607,1,Goto(app-dnd-toggle,*76,1)
exten => *762607,hint,Custom:DEVDND2607

exten => *762608,1,Goto(app-dnd-toggle,*76,1)
exten => *762608,hint,Custom:DEVDND2608

exten => *763,1,Goto(app-dnd-toggle,*76,1)
exten => *763,hint,Custom:DEVDND3

exten => *76700,1,Goto(app-dnd-toggle,*76,1)
exten => *76700,hint,Custom:DEVDND700

exten => *76701,1,Goto(app-dnd-toggle,*76,1)
exten => *76701,hint,Custom:DEVDND701

exten => *76702,1,Goto(app-dnd-toggle,*76,1)
exten => *76702,hint,Custom:DEVDND702

exten => *76703,1,Goto(app-dnd-toggle,*76,1)
exten => *76703,hint,Custom:DEVDND703

exten => *76704,1,Goto(app-dnd-toggle,*76,1)
exten => *76704,hint,Custom:DEVDND704

exten => *76705,1,Goto(app-dnd-toggle,*76,1)
exten => *76705,hint,Custom:DEVDND705

exten => *76706,1,Goto(app-dnd-toggle,*76,1)
exten => *76706,hint,Custom:DEVDND706

exten => *76707,1,Goto(app-dnd-toggle,*76,1)
exten => *76707,hint,Custom:DEVDND707

exten => *76709,1,Goto(app-dnd-toggle,*76,1)
exten => *76709,hint,Custom:DEVDND709

exten => *76711,1,Goto(app-dnd-toggle,*76,1)
exten => *76711,hint,Custom:DEVDND711

exten => *76712,1,Goto(app-dnd-toggle,*76,1)
exten => *76712,hint,Custom:DEVDND712

exten => *76713,1,Goto(app-dnd-toggle,*76,1)
exten => *76713,hint,Custom:DEVDND713

exten => *76714,1,Goto(app-dnd-toggle,*76,1)
exten => *76714,hint,Custom:DEVDND714

exten => *76715,1,Goto(app-dnd-toggle,*76,1)
exten => *76715,hint,Custom:DEVDND715

exten => *768181,1,Goto(app-dnd-toggle,*76,1)
exten => *768181,hint,Custom:DEVDND8181

exten => *768182,1,Goto(app-dnd-toggle,*76,1)
exten => *768182,hint,Custom:DEVDND8182

exten => *768585,1,Goto(app-dnd-toggle,*76,1)
exten => *768585,hint,Custom:DEVDND8585

exten => *76991236,1,Goto(app-dnd-toggle,*76,1)
exten => *76991236,hint,Custom:DEVDND991236

exten => *7699502,1,Goto(app-dnd-toggle,*76,1)
exten => *7699502,hint,Custom:DEVDND99502

;--== end of [ext-dnd-hints] ==--;


[ext-featurecodes]
include => ext-featurecodes-custom
exten => *30,1,Goto(from-internal,*30,1)

exten => *31,1,Goto(from-internal,*31,1)

exten => 555,1,Goto(from-internal,555,1)

exten => 7777,1,Goto(from-internal,7777,1)

exten => 888,1,Goto(from-internal,888,1)

exten => 666,1,Goto(from-internal,666,1)

exten => *43,1,Goto(from-internal,*43,1)

exten => *60,1,Goto(from-internal,*60,1)

exten => *85,1,Goto(from-internal,*85,1)

exten => 411,1,Goto(from-internal,411,1)

exten => *2939,1,Goto(from-internal,*2939,1)

exten => *271,1,Goto(from-internal,*271,1)

exten => *273,1,Goto(from-internal,*273,1)

exten => *98,1,Goto(from-internal,*98,1)

;--== end of [ext-featurecodes] ==--;


[app-fmf-toggle]
include => app-fmf-toggle-custom
exten => *21,1,Goto(app-fmf-toggle,s,start)

exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = "EXTENSION"]?activate)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = "DIRECT"]?deactivate:end)
exten => s,n(deactivate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=EXTENSION)
exten => s,n,Set(STATE=NOT_INUSE)
exten => s,n,Gosub(app-fmf-toggle,sstate,1())
exten => s,n(hook_off),Playback(followme&de-activated)
exten => s,n(end),Macro(hangupcall,)
exten => s,n(activate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=DIRECT)
exten => s,n,Set(STATE=INUSE)
exten => s,n,Gosub(app-fmf-toggle,sstate,1())
exten => s,n(hook_on),Playback(followme&activated)
exten => s,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:FOLLOWME${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-fmf-toggle] ==--;


[ext-findmefollow]
include => ext-findmefollow-custom
exten => *21100,1,Goto(app-fmf-toggle,*21,1)
exten => *21100,hint,Custom:FOLLOWME100

exten => *21101,1,Goto(app-fmf-toggle,*21,1)
exten => *21101,hint,Custom:FOLLOWME101

exten => *21102,1,Goto(app-fmf-toggle,*21,1)
exten => *21102,hint,Custom:FOLLOWME102

exten => *21103,1,Goto(app-fmf-toggle,*21,1)
exten => *21103,hint,Custom:FOLLOWME103

exten => *21104,1,Goto(app-fmf-toggle,*21,1)
exten => *21104,hint,Custom:FOLLOWME104

exten => *21105,1,Goto(app-fmf-toggle,*21,1)
exten => *21105,hint,Custom:FOLLOWME105

exten => *21106,1,Goto(app-fmf-toggle,*21,1)
exten => *21106,hint,Custom:FOLLOWME106

exten => *21108,1,Goto(app-fmf-toggle,*21,1)
exten => *21108,hint,Custom:FOLLOWME108

exten => *21109,1,Goto(app-fmf-toggle,*21,1)
exten => *21109,hint,Custom:FOLLOWME109

exten => *21110,1,Goto(app-fmf-toggle,*21,1)
exten => *21110,hint,Custom:FOLLOWME110

exten => *21113,1,Goto(app-fmf-toggle,*21,1)
exten => *21113,hint,Custom:FOLLOWME113

exten => *21124,1,Goto(app-fmf-toggle,*21,1)
exten => *21124,hint,Custom:FOLLOWME124

exten => *211300,1,Goto(app-fmf-toggle,*21,1)
exten => *211300,hint,Custom:FOLLOWME1300

exten => *211301,1,Goto(app-fmf-toggle,*21,1)
exten => *211301,hint,Custom:FOLLOWME1301

exten => *21130199,1,Goto(app-fmf-toggle,*21,1)
exten => *21130199,hint,Custom:FOLLOWME130199

exten => *211302,1,Goto(app-fmf-toggle,*21,1)
exten => *211302,hint,Custom:FOLLOWME1302

exten => *211303,1,Goto(app-fmf-toggle,*21,1)
exten => *211303,hint,Custom:FOLLOWME1303

exten => *211304,1,Goto(app-fmf-toggle,*21,1)
exten => *211304,hint,Custom:FOLLOWME1304

exten => *211305,1,Goto(app-fmf-toggle,*21,1)
exten => *211305,hint,Custom:FOLLOWME1305

exten => *211306,1,Goto(app-fmf-toggle,*21,1)
exten => *211306,hint,Custom:FOLLOWME1306

exten => *211307,1,Goto(app-fmf-toggle,*21,1)
exten => *211307,hint,Custom:FOLLOWME1307

exten => *211308,1,Goto(app-fmf-toggle,*21,1)
exten => *211308,hint,Custom:FOLLOWME1308

exten => *211309,1,Goto(app-fmf-toggle,*21,1)
exten => *211309,hint,Custom:FOLLOWME1309

exten => *211310,1,Goto(app-fmf-toggle,*21,1)
exten => *211310,hint,Custom:FOLLOWME1310

exten => *211311,1,Goto(app-fmf-toggle,*21,1)
exten => *211311,hint,Custom:FOLLOWME1311

exten => *211312,1,Goto(app-fmf-toggle,*21,1)
exten => *211312,hint,Custom:FOLLOWME1312

exten => *21197,1,Goto(app-fmf-toggle,*21,1)
exten => *21197,hint,Custom:FOLLOWME197

exten => *21198,1,Goto(app-fmf-toggle,*21,1)
exten => *21198,hint,Custom:FOLLOWME198

exten => *21199,1,Goto(app-fmf-toggle,*21,1)
exten => *21199,hint,Custom:FOLLOWME199

exten => *211996,1,Goto(app-fmf-toggle,*21,1)
exten => *211996,hint,Custom:FOLLOWME1996

exten => *211997,1,Goto(app-fmf-toggle,*21,1)
exten => *211997,hint,Custom:FOLLOWME1997

exten => *211998,1,Goto(app-fmf-toggle,*21,1)
exten => *211998,hint,Custom:FOLLOWME1998

exten => *211999,1,Goto(app-fmf-toggle,*21,1)
exten => *211999,hint,Custom:FOLLOWME1999

exten => *212,1,Goto(app-fmf-toggle,*21,1)
exten => *212,hint,Custom:FOLLOWME2

exten => *212071,1,Goto(app-fmf-toggle,*21,1)
exten => *212071,hint,Custom:FOLLOWME2071

exten => *212072,1,Goto(app-fmf-toggle,*21,1)
exten => *212072,hint,Custom:FOLLOWME2072

exten => *212073,1,Goto(app-fmf-toggle,*21,1)
exten => *212073,hint,Custom:FOLLOWME2073

exten => *212074,1,Goto(app-fmf-toggle,*21,1)
exten => *212074,hint,Custom:FOLLOWME2074

exten => *212075,1,Goto(app-fmf-toggle,*21,1)
exten => *212075,hint,Custom:FOLLOWME2075

exten => *212605,1,Goto(app-fmf-toggle,*21,1)
exten => *212605,hint,Custom:FOLLOWME2605

exten => *212607,1,Goto(app-fmf-toggle,*21,1)
exten => *212607,hint,Custom:FOLLOWME2607

exten => *212608,1,Goto(app-fmf-toggle,*21,1)
exten => *212608,hint,Custom:FOLLOWME2608

exten => *213,1,Goto(app-fmf-toggle,*21,1)
exten => *213,hint,Custom:FOLLOWME3

exten => *21700,1,Goto(app-fmf-toggle,*21,1)
exten => *21700,hint,Custom:FOLLOWME700

exten => *21701,1,Goto(app-fmf-toggle,*21,1)
exten => *21701,hint,Custom:FOLLOWME701

exten => *21702,1,Goto(app-fmf-toggle,*21,1)
exten => *21702,hint,Custom:FOLLOWME702

exten => *21703,1,Goto(app-fmf-toggle,*21,1)
exten => *21703,hint,Custom:FOLLOWME703

exten => *21704,1,Goto(app-fmf-toggle,*21,1)
exten => *21704,hint,Custom:FOLLOWME704

exten => *21705,1,Goto(app-fmf-toggle,*21,1)
exten => *21705,hint,Custom:FOLLOWME705

exten => *21706,1,Goto(app-fmf-toggle,*21,1)
exten => *21706,hint,Custom:FOLLOWME706

exten => *21707,1,Goto(app-fmf-toggle,*21,1)
exten => *21707,hint,Custom:FOLLOWME707

exten => *21709,1,Goto(app-fmf-toggle,*21,1)
exten => *21709,hint,Custom:FOLLOWME709

exten => *21711,1,Goto(app-fmf-toggle,*21,1)
exten => *21711,hint,Custom:FOLLOWME711

exten => *21712,1,Goto(app-fmf-toggle,*21,1)
exten => *21712,hint,Custom:FOLLOWME712

exten => *21713,1,Goto(app-fmf-toggle,*21,1)
exten => *21713,hint,Custom:FOLLOWME713

exten => *21714,1,Goto(app-fmf-toggle,*21,1)
exten => *21714,hint,Custom:FOLLOWME714

exten => *21715,1,Goto(app-fmf-toggle,*21,1)
exten => *21715,hint,Custom:FOLLOWME715

exten => *218181,1,Goto(app-fmf-toggle,*21,1)
exten => *218181,hint,Custom:FOLLOWME8181

exten => *218182,1,Goto(app-fmf-toggle,*21,1)
exten => *218182,hint,Custom:FOLLOWME8182

exten => *218585,1,Goto(app-fmf-toggle,*21,1)
exten => *218585,hint,Custom:FOLLOWME8585

exten => *21991236,1,Goto(app-fmf-toggle,*21,1)
exten => *21991236,hint,Custom:FOLLOWME991236

exten => *2199502,1,Goto(app-fmf-toggle,*21,1)
exten => *2199502,hint,Custom:FOLLOWME99502

exten => FM1,1,Goto(1,FM1)

exten => 1,1,GotoIf($[ "${DB(AMPUSER/1/followme/ddial)}" = "EXTENSION" ]?ext-local,1,1)
exten => 1,n(FM1),Macro(user-callerid,)
exten => 1,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1,n,Set(CONNECTEDLINE(num,i)=1)
exten => 1,n,Gosub(sub-presencestate-display,s,1(1))
exten => 1,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/1/cidname)}${PRESENCESTATE_DISPLAY})
exten => 1,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1@ext-local)})
exten => 1,n,Set(__EXTTOCALL=${EXTEN})
exten => 1,n,Set(__PICKUPMARK=${EXTEN})
exten => 1,n,Macro(blkvm-setifempty,)
exten => 1,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1,n,Macro(blkvm-set,reset)
exten => 1,n,Set(__NODEST=)
exten => 1,n(skipov),Set(RRNODEST=${NODEST})
exten => 1,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1,n,GosubIf($[${DB_EXISTS(AMPUSER/1/followme/changecid)} = 1 & "${DB(AMPUSER/1/followme/changecid)}" != "default" & "${DB(AMPUSER/1/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1,n,Set(RecordMethod=Group)
exten => 1,n(checkrecord),Gosub(sub-record-check,s,1(exten,1,))
exten => 1,n(skipsimple),Set(RingGroupMethod=ringallv2)
exten => 1,n,Set(_FMGRP=1)
exten => 1,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1,n,Macro(dial,$[ ${DB(AMPUSER/1/followme/grptime)} + ${DB(AMPUSER/1/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1/followme/grplist)})
exten => 1,n,Goto(nextstep)
exten => 1,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1/followme/grptime)} + ${DB(AMPUSER/1/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1/followme/grplist)},1)
exten => 1,n(nextstep),Set(RingGroupMethod=)
exten => 1,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1,n,Set(__NODEST=)
exten => 1,n,Set(__PICKUPMARK=)
exten => 1,n,Macro(blkvm-clr,)
exten => 1,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 1,n,Goto(ext-local,1,dest)
exten => 1,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2,1,Goto(2,FM2)

exten => 2,1,GotoIf($[ "${DB(AMPUSER/2/followme/ddial)}" = "EXTENSION" ]?ext-local,2,1)
exten => 2,n(FM2),Macro(user-callerid,)
exten => 2,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2,n,Set(CONNECTEDLINE(num,i)=2)
exten => 2,n,Gosub(sub-presencestate-display,s,1(2))
exten => 2,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/2/cidname)}${PRESENCESTATE_DISPLAY})
exten => 2,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2@ext-local)})
exten => 2,n,Set(__EXTTOCALL=${EXTEN})
exten => 2,n,Set(__PICKUPMARK=${EXTEN})
exten => 2,n,Macro(blkvm-setifempty,)
exten => 2,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2,n,Macro(blkvm-set,reset)
exten => 2,n,Set(__NODEST=)
exten => 2,n(skipov),Set(RRNODEST=${NODEST})
exten => 2,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2,n,GosubIf($[${DB_EXISTS(AMPUSER/2/followme/changecid)} = 1 & "${DB(AMPUSER/2/followme/changecid)}" != "default" & "${DB(AMPUSER/2/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2,n,Set(RecordMethod=Group)
exten => 2,n(checkrecord),Gosub(sub-record-check,s,1(exten,2,))
exten => 2,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2,n,Set(_FMGRP=2)
exten => 2,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2,n,Macro(dial,$[ ${DB(AMPUSER/2/followme/grptime)} + ${DB(AMPUSER/2/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2/followme/grplist)})
exten => 2,n,Goto(nextstep)
exten => 2,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2/followme/grptime)} + ${DB(AMPUSER/2/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2/followme/grplist)},2)
exten => 2,n(nextstep),Set(RingGroupMethod=)
exten => 2,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2,n,Set(__NODEST=)
exten => 2,n,Set(__PICKUPMARK=)
exten => 2,n,Macro(blkvm-clr,)
exten => 2,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 2,n,Goto(ext-local,2,dest)
exten => 2,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM611,1,Goto(611,FM611)

exten => 611,1,GotoIf($[ "${DB(AMPUSER/611/followme/ddial)}" = "EXTENSION" ]?ext-local,611,1)
exten => 611,n(FM611),Macro(user-callerid,)
exten => 611,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 611,n,Set(CONNECTEDLINE(num,i)=611)
exten => 611,n,Gosub(sub-presencestate-display,s,1(611))
exten => 611,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/611/cidname)}${PRESENCESTATE_DISPLAY})
exten => 611,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(611@ext-local)})
exten => 611,n,Set(__EXTTOCALL=${EXTEN})
exten => 611,n,Set(__PICKUPMARK=${EXTEN})
exten => 611,n,Macro(blkvm-setifempty,)
exten => 611,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 611,n,Macro(blkvm-set,reset)
exten => 611,n,Set(__NODEST=)
exten => 611,n(skipov),Set(RRNODEST=${NODEST})
exten => 611,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 611,n,GosubIf($[${DB_EXISTS(AMPUSER/611/followme/changecid)} = 1 & "${DB(AMPUSER/611/followme/changecid)}" != "default" & "${DB(AMPUSER/611/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 611,n,Set(RecordMethod=Group)
exten => 611,n(checkrecord),Gosub(sub-record-check,s,1(exten,611,))
exten => 611,n(skipsimple),Set(RingGroupMethod=ringallv2)
exten => 611,n,Set(_FMGRP=611)
exten => 611,n(DIALGRP),GotoIf($[("${DB(AMPUSER/611/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 611,n,Macro(dial,$[ ${DB(AMPUSER/611/followme/grptime)} + ${DB(AMPUSER/611/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/611/followme/grplist)})
exten => 611,n,Goto(nextstep)
exten => 611,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/611/followme/grptime)} + ${DB(AMPUSER/611/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/611/followme/grplist)},611)
exten => 611,n(nextstep),Set(RingGroupMethod=)
exten => 611,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 611,n,Set(__NODEST=)
exten => 611,n,Set(__PICKUPMARK=)
exten => 611,n,Macro(blkvm-clr,)
exten => 611,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 611,n,Goto(ext-local,611,dest)
exten => 611,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM701,1,Goto(701,FM701)

exten => 701,1,GotoIf($[ "${DB(AMPUSER/701/followme/ddial)}" = "EXTENSION" ]?ext-local,701,1)
exten => 701,n(FM701),Macro(user-callerid,)
exten => 701,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 701,n,Set(CONNECTEDLINE(num,i)=701)
exten => 701,n,Gosub(sub-presencestate-display,s,1(701))
exten => 701,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/701/cidname)}${PRESENCESTATE_DISPLAY})
exten => 701,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(701@ext-local)})
exten => 701,n,Set(__EXTTOCALL=${EXTEN})
exten => 701,n,Set(__PICKUPMARK=${EXTEN})
exten => 701,n,Macro(blkvm-setifempty,)
exten => 701,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 701,n,Macro(blkvm-set,reset)
exten => 701,n,Set(__NODEST=)
exten => 701,n(skipov),Set(RRNODEST=${NODEST})
exten => 701,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 701,n,GosubIf($[${DB_EXISTS(AMPUSER/701/followme/changecid)} = 1 & "${DB(AMPUSER/701/followme/changecid)}" != "default" & "${DB(AMPUSER/701/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 701,n,Set(RecordMethod=Group)
exten => 701,n(checkrecord),Gosub(sub-record-check,s,1(exten,701,))
exten => 701,n(skipsimple),Set(RingGroupMethod=ringallv2)
exten => 701,n,Set(_FMGRP=701)
exten => 701,n(DIALGRP),GotoIf($[("${DB(AMPUSER/701/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 701,n,Macro(dial,$[ ${DB(AMPUSER/701/followme/grptime)} + ${DB(AMPUSER/701/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/701/followme/grplist)})
exten => 701,n,Goto(nextstep)
exten => 701,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/701/followme/grptime)} + ${DB(AMPUSER/701/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/701/followme/grplist)},701)
exten => 701,n(nextstep),Set(RingGroupMethod=)
exten => 701,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 701,n,Set(__NODEST=)
exten => 701,n,Set(__PICKUPMARK=)
exten => 701,n,Macro(blkvm-clr,)
exten => 701,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 701,n,Goto(ext-local,701,dest)
exten => 701,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM702,1,Goto(702,FM702)

exten => 702,1,GotoIf($[ "${DB(AMPUSER/702/followme/ddial)}" = "EXTENSION" ]?ext-local,702,1)
exten => 702,n(FM702),Macro(user-callerid,)
exten => 702,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 702,n,Set(CONNECTEDLINE(num,i)=702)
exten => 702,n,Gosub(sub-presencestate-display,s,1(702))
exten => 702,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/702/cidname)}${PRESENCESTATE_DISPLAY})
exten => 702,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(702@ext-local)})
exten => 702,n,Set(__EXTTOCALL=${EXTEN})
exten => 702,n,Set(__PICKUPMARK=${EXTEN})
exten => 702,n,Macro(blkvm-setifempty,)
exten => 702,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 702,n,Macro(blkvm-set,reset)
exten => 702,n,Set(__NODEST=)
exten => 702,n(skipov),Set(RRNODEST=${NODEST})
exten => 702,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 702,n,GosubIf($[${DB_EXISTS(AMPUSER/702/followme/changecid)} = 1 & "${DB(AMPUSER/702/followme/changecid)}" != "default" & "${DB(AMPUSER/702/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 702,n,Set(RecordMethod=Group)
exten => 702,n(checkrecord),Gosub(sub-record-check,s,1(exten,702,))
exten => 702,n(skipsimple),Set(RingGroupMethod=ringallv2)
exten => 702,n,Set(_FMGRP=702)
exten => 702,n(DIALGRP),GotoIf($[("${DB(AMPUSER/702/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 702,n,Macro(dial,$[ ${DB(AMPUSER/702/followme/grptime)} + ${DB(AMPUSER/702/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/702/followme/grplist)})
exten => 702,n,Goto(nextstep)
exten => 702,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/702/followme/grptime)} + ${DB(AMPUSER/702/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/702/followme/grplist)},702)
exten => 702,n(nextstep),Set(RingGroupMethod=)
exten => 702,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 702,n,Set(__NODEST=)
exten => 702,n,Set(__PICKUPMARK=)
exten => 702,n,Macro(blkvm-clr,)
exten => 702,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 702,n,Goto(ext-local,702,dest)
exten => 702,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM1301,1,Goto(1301,FM1301)

exten => 1301,1,GotoIf($[ "${DB(AMPUSER/1301/followme/ddial)}" = "EXTENSION" ]?ext-local,1301,1)
exten => 1301,n(FM1301),Macro(user-callerid,)
exten => 1301,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1301,n,Set(CONNECTEDLINE(num,i)=1301)
exten => 1301,n,Gosub(sub-presencestate-display,s,1(1301))
exten => 1301,n,Set(CONNECTEDLINE(name)=${DB(AMPUSER/1301/cidname)}${PRESENCESTATE_DISPLAY})
exten => 1301,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1301@ext-local)})
exten => 1301,n,Set(__EXTTOCALL=${EXTEN})
exten => 1301,n,Set(__PICKUPMARK=${EXTEN})
exten => 1301,n,Macro(blkvm-setifempty,)
exten => 1301,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1301,n,Macro(blkvm-set,reset)
exten => 1301,n,Set(__NODEST=)
exten => 1301,n(skipov),Set(RRNODEST=${NODEST})
exten => 1301,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1301,n,GosubIf($[${DB_EXISTS(AMPUSER/1301/followme/changecid)} = 1 & "${DB(AMPUSER/1301/followme/changecid)}" != "default" & "${DB(AMPUSER/1301/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1301,n,Set(RecordMethod=Group)
exten => 1301,n(checkrecord),Gosub(sub-record-check,s,1(exten,1301,))
exten => 1301,n(skipsimple),Set(RingGroupMethod=ringallv2)
exten => 1301,n,Set(_FMGRP=1301)
exten => 1301,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1301/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1301,n,Macro(dial,$[ ${DB(AMPUSER/1301/followme/grptime)} + ${DB(AMPUSER/1301/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1301/followme/grplist)})
exten => 1301,n,Goto(nextstep)
exten => 1301,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1301/followme/grptime)} + ${DB(AMPUSER/1301/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1301/followme/grplist)},1301)
exten => 1301,n(nextstep),Set(RingGroupMethod=)
exten => 1301,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1301,n,Set(__NODEST=)
exten => 1301,n,Set(__PICKUPMARK=)
exten => 1301,n,Macro(blkvm-clr,)
exten => 1301,n,Set(DIALSTATUS=${IF($["${FM_DIALSTATUS}"="NOT_INUSE"&"${DIALSTATUS}"!="CHANUNAVAIL"]?NOANSWER:${IF($["${DIALSTATUS}"="CHANUNAVAIL"|"${FM_DIALSTATUS}"="UNAVAILABLE"|"${FM_DIALSTATUS}"="UNKNOWN"|"${FM_DIALSTATUS}"="INVALID"]?CHANUNAVAIL:BUSY)})})
exten => 1301,n,Goto(ext-local,1301,dest)
exten => 1301,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

;--== end of [ext-findmefollow] ==--;


[fmgrps]
include => fmgrps-custom
exten => _RG-1.,1,NoCDR()
exten => _RG-1.,n,Macro(dial,${DB(AMPUSER/1/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1),${EXTEN:5})

exten => _RG-2.,1,NoCDR()
exten => _RG-2.,n,Macro(dial,${DB(AMPUSER/2/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2),${EXTEN:5})

exten => _RG-611.,1,NoCDR()
exten => _RG-611.,n,Macro(dial,${DB(AMPUSER/611/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^611),${EXTEN:7})

exten => _RG-701.,1,NoCDR()
exten => _RG-701.,n,Macro(dial,${DB(AMPUSER/701/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^701),${EXTEN:7})

exten => _RG-702.,1,NoCDR()
exten => _RG-702.,n,Macro(dial,${DB(AMPUSER/702/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^702),${EXTEN:7})

exten => _RG-1301.,1,NoCDR()
exten => _RG-1301.,n,Macro(dial,${DB(AMPUSER/1301/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1301),${EXTEN:8})

;--== end of [fmgrps] ==--;


[sub-fmsetcid]
include => sub-fmsetcid-custom
exten => s,1,Goto(s-${DB(AMPUSER/${EXTTOCALL}/followme/changecid)},1)

exten => s-fixed,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${DB(AMPUSER/${EXTTOCALL}/followme/fixedcid)})}" = "1"]?Set(__TRUNKCIDOVERRIDE=${DB(AMPUSER/${EXTTOCALL}/followme/fixedcid)}))
exten => s-fixed,n,Return()

exten => s-extern,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${DB(AMPUSER/${EXTTOCALL}/followme/fixedcid)})}" == "1" & "${FROM_DID}" != ""]?Set(__TRUNKCIDOVERRIDE=${DB(AMPUSER/${EXTTOCALL}/followme/fixedcid)}))
exten => s-extern,n,Return()

exten => s-did,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]?Set(__REALCALLERIDNUM=${FROM_DID}))
exten => s-did,n,Return()

exten => s-forcedid,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]?Set(__TRUNKCIDOVERRIDE=${FROM_DID}))
exten => s-forcedid,n,Return()

exten => _s-.,1,Noop(Unknown value for AMPUSER/${EXTTOCALL}/followme/changecid of ${DB(AMPUSER/${EXTTOCALL}/followme/changecid)} set to "default")
exten => _s-.,n,Set(DB(AMPUSER/${EXTTOCALL}/followme/changecid)=default)
exten => _s-.,n,Return()

;--== end of [sub-fmsetcid] ==--;


[app-hotelwakeup]
include => app-hotelwakeup-custom
exten => *68,1,Macro(user-callerid,)
exten => *68,n,Answer
exten => *68,n,Wait(1)
exten => *68,n,AGI(wakeupphp)
exten => *68,n,Hangup

;--== end of [app-hotelwakeup] ==--;


[app-calltrace]
include => app-calltrace-custom
exten => *69,1,Goto(app-calltrace-perform,s,1)

;--== end of [app-calltrace] ==--;


[app-calltrace-perform]
include => app-calltrace-perform-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Playback(info-about-last-call&telephone-number)
exten => s,n,Set(lastcaller=${DB(CALLTRACE/${AMPUSER})})
exten => s,n,GotoIf($[ $[ "${lastcaller}" = "" ] | $[ "${lastcaller}" = "unknown" ] ]?noinfo)
exten => s,n,SayDigits(${lastcaller})
exten => s,n,Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=7)
exten => s,n,Background(to-call-this-number&press-1)
exten => s,n,Goto(fin)
exten => s,n(noinfo),Playback(from-unknown-caller)
exten => s,n,Macro(hangupcall,)
exten => s,n(fin),Noop(Waiting for input)
exten => s,n,WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)

exten => 1,1,Goto(from-internal,${lastcaller},1)

exten => i,1,Playback(vm-goodbye)
exten => i,n,Macro(hangupcall,)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Macro(hangupcall,)

;--== end of [app-calltrace-perform] ==--;


[app-speakextennum]
include => app-speakextennum-custom
exten => *65,1,Answer
exten => *65,n,Wait(1)
exten => *65,n,Macro(user-callerid,)
exten => *65,n,Playback(your)
exten => *65,n,Playback(extension)
exten => *65,n,Playback(number)
exten => *65,n,Playback(is)
exten => *65,n,SayDigits(${AMPUSER})
exten => *65,n,Wait(2)
exten => *65,n,Hangup

;--== end of [app-speakextennum] ==--;


[sub-hr12format]
include => sub-hr12format-custom
exten => s,1,Goto(${CHANNEL(language)},1)
exten => s,n,GotoIf($[${DIALPLAN_EXISTS(sub-hr12format,${CHANNEL(language)},1)}]?${CHANNEL(language)},1:en,1)

exten => i,1,Playback(at-tone-time-exactly)
exten => i,n,SayUnixTime(${FutureTime},,IM 'and' S 'seconds' p)
exten => i,n,Return()

exten => de,1,Playback(at-tone-time-exactly)
exten => de,n,SayUnixTime(${FutureTime},,IMSp)
exten => de,n,Return()
exten => de,n,Playback(at-tone-time-exactly)
exten => de,n,SayUnixTime(${FutureTime},,IMSp)
exten => de,n,Return()

exten => en,1,Playback(at-tone-time-exactly)
exten => en,n,SayUnixTime(${FutureTime},,IM 'and' S 'seconds' p)
exten => en,n,Return()

;--== end of [sub-hr12format] ==--;


[app-speakingclock]
include => app-speakingclock-custom
exten => *60,1,Macro(user-callerid,)
exten => *60,n,Answer
exten => *60,n,Wait(1)
exten => *60,n,Set(NumLoops=0)
exten => *60,n(start),Set(FutureTime=$[${EPOCH} + 11])
exten => *60,n,Gosub(sub-hr12format,s,1())
exten => *60,n(waitloop),Set(TimeLeft=$[${FutureTime} - ${EPOCH}])
exten => *60,n,GotoIf($[${TimeLeft} < 1]?playbeep)
exten => *60,n,Wait(1)
exten => *60,n,Goto(waitloop)
exten => *60,n(playbeep),Playback(beep)
exten => *60,n,Wait(5)
exten => *60,n,Set(NumLoops=$[${NumLoops} + 1])
exten => *60,n,GotoIf($[${NumLoops} < 5]?start)
exten => *60,n,Playback(goodbye)
exten => *60,n,Hangup

;--== end of [app-speakingclock] ==--;


[sub-hr24format]
include => sub-hr24format-custom
exten => s,1,GotoIf($[${DIALPLAN_EXISTS(sub-hr24format,${CHANNEL(language)},1)}]?${CHANNEL(language)},1:en,1)

exten => en,1,Playback(at-tone-time-exactly)
exten => en,n,SayUnixTime(${FutureTime},,kM 'and' S 'seconds')
exten => en,n,Return()

exten => de,1,Playback(at-tone-time-exactly)
exten => de,n,SayUnixTime(${FutureTime},,kMS)
exten => de,n,Return()

;--== end of [sub-hr24format] ==--;


[app-echo-test]
include => app-echo-test-custom
exten => *43,1,Answer
exten => *43,n,Macro(user-callerid,)
exten => *43,n,Wait(1)
exten => *43,n,Playback(infoservices/echo-test)
exten => *43,n,Echo()
exten => *43,n,Playback(demo-echodone)
exten => *43,n,Hangup

;--== end of [app-echo-test] ==--;


[ivr-4] ; AcuitasIVR
include => ivr-4-custom
include => from-ivr-directory-2
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/AcuitasIVR2)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(10,)

exten => 1,1(ivrsel-1),Goto(from-did-direct,2071,1)

exten => 2,1(ivrsel-2),Goto(from-did-direct,2072,1)

exten => 3,1(ivrsel-3),Goto(from-did-direct,2073,1)

exten => 4,1(ivrsel-4),Goto(from-did-direct,2074,1)

exten => 5,1(ivrsel-5),Goto(from-did-direct,2605,1)

exten => 6,1(ivrsel-6),Goto(from-did-direct,2607,1)

exten => 9,1(ivrsel-9),Goto(ext-meetme,7003,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 5]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(app-blackhole,hangup,1)

exten => t,1,Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1])
exten => t,n,GotoIf($[${TIMEOUT_LOOPCOUNT} > 5]?final)
exten => t,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => t,n,Goto(s,start)
exten => t,n(final),Playback(no-valid-responce-transfering)
exten => t,n,Goto(app-blackhole,hangup,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/AcuitasIVR2)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-4] ==--;


[ivr-1] ; Matisia AA
include => ivr-1-custom
include => from-ivr-directory-1
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/MatisiaAA)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(10,)

exten => 0,1(ivrsel-0),Goto(ext-group,601,1)

exten => 1,1,GotoIf($["x${IVR_CONTEXT_${CONTEXT}}" = "x"]?directory,1,1:${IVR_CONTEXT_${CONTEXT}},return,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 3]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(ivr-1,s,1)

exten => t,1,Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1])
exten => t,n,GotoIf($[${TIMEOUT_LOOPCOUNT} > 3]?final)
exten => t,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => t,n,Goto(s,start)
exten => t,n(final),Playback(no-valid-responce-transfering)
exten => t,n,Goto(ivr-1,s,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/MatisiaAA)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-1] ==--;


[ivr-6] ; Matisia Conf. AA
include => ivr-6-custom
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/MatisiaConfBridge)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(10,)

exten => 1,1(ivrsel-1),Goto(ext-meetme,7000,1)

exten => 2,1(ivrsel-2),Goto(ext-meetme,7001,1)

exten => 3,1(ivrsel-3),Goto(ext-meetme,7002,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 3]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(ivr-6,s,1)

exten => t,1,Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1])
exten => t,n,GotoIf($[${TIMEOUT_LOOPCOUNT} > 3]?final)
exten => t,n,Set(IVR_MSG=no-valid-responce-pls-try-again&custom/MatisiaConfBridge)
exten => t,n,Goto(s,start)
exten => t,n(final),Playback(no-valid-responce-transfering)
exten => t,n,Goto(ivr-6,s,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/MatisiaConfBridge)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-6] ==--;


[ivr-8] ; MatisiaCAConfAA
include => ivr-8-custom
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/MatisiaConfCAAA)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(10,)

exten => 1,1(ivrsel-1),Goto(ext-meetme,7004,1)

exten => 2,1(ivrsel-2),Goto(ext-meetme,7005,1)

exten => 3,1(ivrsel-3),Goto(ext-meetme,7006,1)

exten => 4,1(ivrsel-4),Goto(ext-meetme,7007,1)

exten => 5,1(ivrsel-5),Goto(ext-meetme,7008,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 3]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(app-blackhole,hangup,1)

exten => t,1,Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1])
exten => t,n,GotoIf($[${TIMEOUT_LOOPCOUNT} > 3]?final)
exten => t,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => t,n,Goto(s,start)
exten => t,n(final),Playback(no-valid-responce-transfering)
exten => t,n,Goto(app-blackhole,hangup,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/MatisiaConfCAAA)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-8] ==--;


[ivr-7] ; SWA Main
include => ivr-7-custom
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/SovereignIVR)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(10,)

exten => 0,1(ivrsel-0),Goto(from-did-direct,199,1)

exten => 1,1(ivrsel-1),Goto(from-did-direct,103,1)

exten => 2,1(ivrsel-2),Goto(from-did-direct,104,1)

exten => 3,1(ivrsel-3),Goto(from-did-direct,102,1)

exten => 4,1(ivrsel-4),Goto(from-did-direct,105,1)

exten => 5,1(ivrsel-5),Goto(from-did-direct,101,1)

exten => 6,1(ivrsel-6),Goto(from-did-direct,100,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 3]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(app-blackhole,hangup,1)

exten => t,1,Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1])
exten => t,n,GotoIf($[${TIMEOUT_LOOPCOUNT} > 3]?final)
exten => t,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => t,n,Goto(s,start)
exten => t,n(final),Playback(no-valid-responce-transfering)
exten => t,n,Goto(app-blackhole,hangup,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/SovereignIVR)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-7] ==--;


[ivr-9] ; WSCAA
include => ivr-9-custom
exten => s,1,Set(INVALID_LOOPCOUNT=0)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?skip)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(skip),Set(IVR_MSG=custom/WSCIVR)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(5,)

exten => 1,1(ivrsel-1),Goto(app-announcement-11,s,1)

exten => i,1,Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1])
exten => i,n,GotoIf($[${INVALID_LOOPCOUNT} > 3]?final)
exten => i,n,Set(IVR_MSG=no-valid-responce-pls-try-again)
exten => i,n,Goto(s,start)
exten => i,n(final),Playback(no-valid-responce-transfering)
exten => i,n,Goto(app-blackhole,hangup,1)

exten => t,1(final),Goto(ext-group,1402,1)

exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Set(IVR_MSG=custom/WSCIVR)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-9] ==--;


[from-ivr-directory-2]
include => from-ivr-directory-2-custom
exten => 2075,1,Macro(blkvm-clr,)
exten => 2075,n,Set(__NODEST=)
exten => 2075,n,Goto(from-internal,2075,1)

exten => 2074,1,Macro(blkvm-clr,)
exten => 2074,n,Set(__NODEST=)
exten => 2074,n,Goto(from-internal,2074,1)

exten => 2073,1,Macro(blkvm-clr,)
exten => 2073,n,Set(__NODEST=)
exten => 2073,n,Goto(from-internal,2073,1)

exten => 2071,1,Macro(blkvm-clr,)
exten => 2071,n,Set(__NODEST=)
exten => 2071,n,Goto(from-internal,2071,1)

exten => 2072,1,Macro(blkvm-clr,)
exten => 2072,n,Set(__NODEST=)
exten => 2072,n,Goto(from-internal,2072,1)

exten => 2607,1,Macro(blkvm-clr,)
exten => 2607,n,Set(__NODEST=)
exten => 2607,n,Goto(from-internal,2607,1)

exten => 2605,1,Macro(blkvm-clr,)
exten => 2605,n,Set(__NODEST=)
exten => 2605,n,Goto(from-internal,2605,1)

exten => 2608,1,Macro(blkvm-clr,)
exten => 2608,n,Set(__NODEST=)
exten => 2608,n,Goto(from-internal,2608,1)

;--== end of [from-ivr-directory-2] ==--;


[from-ivr-directory-1]
include => from-ivr-directory-1-custom
exten => 700,1,Macro(blkvm-clr,)
exten => 700,n,Set(__NODEST=)
exten => 700,n,Goto(from-internal,700,1)

exten => 715,1,Macro(blkvm-clr,)
exten => 715,n,Set(__NODEST=)
exten => 715,n,Goto(from-internal,715,1)

exten => 701,1,Macro(blkvm-clr,)
exten => 701,n,Set(__NODEST=)
exten => 701,n,Goto(from-internal,701,1)

exten => 704,1,Macro(blkvm-clr,)
exten => 704,n,Set(__NODEST=)
exten => 704,n,Goto(from-internal,704,1)

exten => 703,1,Macro(blkvm-clr,)
exten => 703,n,Set(__NODEST=)
exten => 703,n,Goto(from-internal,703,1)

exten => 705,1,Macro(blkvm-clr,)
exten => 705,n,Set(__NODEST=)
exten => 705,n,Goto(from-internal,705,1)

exten => 702,1,Macro(blkvm-clr,)
exten => 702,n,Set(__NODEST=)
exten => 702,n,Goto(from-internal,702,1)

exten => 711,1,Macro(blkvm-clr,)
exten => 711,n,Set(__NODEST=)
exten => 711,n,Goto(from-internal,711,1)

exten => 706,1,Macro(blkvm-clr,)
exten => 706,n,Set(__NODEST=)
exten => 706,n,Goto(from-internal,706,1)

exten => 707,1,Macro(blkvm-clr,)
exten => 707,n,Set(__NODEST=)
exten => 707,n,Goto(from-internal,707,1)

exten => 709,1,Macro(blkvm-clr,)
exten => 709,n,Set(__NODEST=)
exten => 709,n,Goto(from-internal,709,1)

;--== end of [from-ivr-directory-1] ==--;


[app-miscapps]
include => app-miscapps-custom
exten => **1350,1,Noop(Running miscapp 3: PageWSCEveryone)
exten => **1350,n,Macro(user-callerid,)
exten => **1350,n,Goto(app-pagegroups,1350,1)

exten => **1380,1,Noop(Running miscapp 1: PageWSC_FC)
exten => **1380,n,Macro(user-callerid,)
exten => **1380,n,Goto(app-pagegroups,1380,1)

exten => **1381,1,Noop(Running miscapp 2: PageWSC_TechBench)
exten => **1381,n,Macro(user-callerid,)
exten => **1381,n,Goto(app-pagegroups,1381,1)

exten => **1389,1,Noop(Running miscapp 4: PageWSC_Test)
exten => **1389,n,Macro(user-callerid,)
exten => **1389,n,Goto(app-pagegroups,1389,1)

;--== end of [app-miscapps] ==--;


[ext-miscdests]
include => ext-miscdests-custom
exten => 2,1,Noop(MiscDest: AbshirCell)
exten => 2,n,Goto(from-internal,2063492220,1)

exten => 1,1,Noop(MiscDest: Greg mobile)
exten => 1,n,Goto(from-internal,2066016062,1)

;--== end of [ext-miscdests] ==--;


[macro-outisbusy]
include => macro-outisbusy-custom
exten => s,1,Progress
exten => s,n,GotoIf($["${EMERGENCYROUTE}" = "YES"]?emergency,1)
exten => s,n,GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?intracompany,1)
exten => s,n,Playback(all-circuits-busy-now&pls-try-call-later, noanswer)
exten => s,n,Congestion(20)
exten => s,n,Hangup

exten => intracompany,1,Playback(all-circuits-busy-now&pls-try-call-later, noanswer)
exten => intracompany,n,Congestion(20)
exten => intracompany,n,Hangup

exten => emergency,1,Playback(all-circuits-busy-now&pls-try-call-later)
exten => emergency,n,Congestion(20)
exten => emergency,n,Hangup

;--== end of [macro-outisbusy] ==--;


[ext-intercom]
include => ext-intercom-custom
exten => _*80.,1,Macro(user-callerid,)
exten => _*80.,n,Set(dialnumber=${EXTEN:3})
exten => _*80.,n,Set(INTERCOM_CALL=TRUE)
exten => _*80.,n,Gosub(sub-record-check,s,1(exten,${dialnumber}))
exten => _*80.,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/intercom/block)}" = "blocked"]?end)
exten => _*80.,n,GotoIf($["${DB(DND/${dialnumber})}" = "YES"]?end)
exten => _*80.,n,GotoIf($["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "allow" ]?allow)
exten => _*80.,n,GotoIf($["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "deny" ]?nointercom)
exten => _*80.,n,GotoIf($["${DB(AMPUSER/${dialnumber}/intercom)}" = "disabled" ]?nointercom)
exten => _*80.,n(allow),Set(DEVICES=${DB(AMPUSER/${dialnumber}/device)})
exten => _*80.,n,GotoIf($["${DEVICES}" = "" ]?end)
exten => _*80.,n,Set(OVERRIDE=${DB(AMPUSER/${dialnumber}/intercom/override)})
exten => _*80.,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => _*80.,n,Set(_SIPURI=)
exten => _*80.,n,Set(_ALERTINFO=Ring Answer)
exten => _*80.,n,Set(_CALLINFO=<uri>\;answer-after=0)
exten => _*80.,n,Set(_SIPURI=intercom=true)
exten => _*80.,n,Set(_DTIME=5)
exten => _*80.,n,Set(_ANSWERMACRO=)
exten => _*80.,n,GotoIf($[${LOOPCNT} > 1 ]?pagemode)
exten => _*80.,n,Macro(autoanswer,${DEVICES})
exten => _*80.,n,Set(_DOPTIONS=A(beep)b(autoanswer^s^1(${ALERTINFO},${CALLINFO})))
exten => _*80.,n(check),ChanIsAvail(${DEVICE},s)
exten => _*80.,n,ExecIf($["${AVAILSTATUS}" = "6"]?Set(AVAILORIGCHAN=${DEVICE}))
exten => _*80.,n,GotoIf($["${AVAILORIGCHAN}" != ""]?continue)
exten => _*80.,n,ExecIf($["${OVERRIDE}" = ""]?Set(OVERRIDE=reject))
exten => _*80.,n,GotoIf($["${OVERRIDE}" = "reject"]?end)
exten => _*80.,n,Set(DTIME=30)
exten => _*80.,n,ExecIf($["${OVERRIDE}" = "ring"]?Set(DOPTIONS=A(beep)))
exten => _*80.,n(continue),Noop(Continuing with page)
exten => _*80.,n,GotoIf($["${DB(AMPUSER/${EXTEN:3}/cidname)}" = ""]?godial)
exten => _*80.,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/${EXTEN:3}/cidname)})
exten => _*80.,n,Set(CONNECTEDLINE(num)=${EXTEN:3})
exten => _*80.,n(godial),Dial(${DIAL},${DTIME},I${DOPTIONS}${INTERCOM_EXT_DOPTIONS})
exten => _*80.,n(end),ExecIf($[${INTERCOM_RETURN}]?Return())
exten => _*80.,n,Busy(20)
exten => _*80.,n,Macro(hangupcall,)
exten => _*80.,n(pagemode),Set(ITER=1)
exten => _*80.,n,Set(DIALSTR=)
exten => _*80.,n(begin),ChanIsAvail(${DB(DEVICE/${CUT(DEVICES,&,${ITER})}/dial)},s)
exten => _*80.,n,GotoIf($["${AVAILORIGCHAN}" = ""]?skip)
exten => _*80.,n,Set(DIALSTR=${DIALSTR}-${CUT(DEVICES,&,${ITER})})
exten => _*80.,n(skip),Set(ITER=$[${ITER} + 1])
exten => _*80.,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => _*80.,n,Set(DIALSTR=${DIALSTR:1})
exten => _*80.,n,GotoIf($["${DIALSTR}" = ""]?end2)
exten => _*80.,n,Set(_AMPUSER=${AMPUSER})
exten => _*80.,n,Gosub(page,1(${DIALSTR}))
exten => _*80.,n(end2),ExecIf($[${INTERCOM_RETURN}]?Return())
exten => _*80.,n,Busy(20)
exten => _*80.,n,Macro(hangupcall,)
exten => _*80.,n(nointercom),Noop(Intercom disallowed by ${dialnumber})
exten => _*80.,n,ExecIf($[${INTERCOM_RETURN}]?Return())
exten => _*80.,n,Playback(intercom&for&extension)
exten => _*80.,n,SayDigits(${dialnumber})
exten => _*80.,n,Playback(is&disabled)
exten => _*80.,n,Congestion(20)

exten => page,1,Set(PAGE_CONF=${EPOCH}${RAND(100,999)})
exten => page,n,Set(PAGEMODE=PAGE)
exten => page,n,Set(PAGE_MEMBERS=${ARG1})
exten => page,n,Set(PAGE_CONF_OPTS=duplex)
exten => page,n,AGI(page.agi)
exten => page,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => page,n,Set(CONFBRIDGE(user,admin)=yes)
exten => page,n,Set(CONFBRIDGE(user,marked)=yes)
exten => page,n,ConfBridge(${PAGE_CONF},,,admin_menu)
exten => page,n,Hangup

;--== end of [ext-intercom] ==--;


[ext-intercom-users]
include => ext-intercom-users-custom
exten => *801,1,Goto(ext-intercom,${EXTEN},1)

exten => *802,1,Goto(ext-intercom,${EXTEN},1)

exten => *803,1,Goto(ext-intercom,${EXTEN},1)

exten => *80100,1,Goto(ext-intercom,${EXTEN},1)

exten => *80101,1,Goto(ext-intercom,${EXTEN},1)

exten => *80102,1,Goto(ext-intercom,${EXTEN},1)

exten => *80103,1,Goto(ext-intercom,${EXTEN},1)

exten => *80104,1,Goto(ext-intercom,${EXTEN},1)

exten => *80105,1,Goto(ext-intercom,${EXTEN},1)

exten => *80106,1,Goto(ext-intercom,${EXTEN},1)

exten => *80108,1,Goto(ext-intercom,${EXTEN},1)

exten => *80109,1,Goto(ext-intercom,${EXTEN},1)

exten => *80110,1,Goto(ext-intercom,${EXTEN},1)

exten => *80113,1,Goto(ext-intercom,${EXTEN},1)

exten => *80124,1,Goto(ext-intercom,${EXTEN},1)

exten => *80197,1,Goto(ext-intercom,${EXTEN},1)

exten => *80198,1,Goto(ext-intercom,${EXTEN},1)

exten => *80199,1,Goto(ext-intercom,${EXTEN},1)

exten => *80611,1,Goto(ext-intercom,${EXTEN},1)

exten => *80700,1,Goto(ext-intercom,${EXTEN},1)

exten => *80701,1,Goto(ext-intercom,${EXTEN},1)

exten => *80702,1,Goto(ext-intercom,${EXTEN},1)

exten => *80703,1,Goto(ext-intercom,${EXTEN},1)

exten => *80704,1,Goto(ext-intercom,${EXTEN},1)

exten => *80705,1,Goto(ext-intercom,${EXTEN},1)

exten => *80706,1,Goto(ext-intercom,${EXTEN},1)

exten => *80707,1,Goto(ext-intercom,${EXTEN},1)

exten => *80709,1,Goto(ext-intercom,${EXTEN},1)

exten => *80711,1,Goto(ext-intercom,${EXTEN},1)

exten => *80712,1,Goto(ext-intercom,${EXTEN},1)

exten => *80713,1,Goto(ext-intercom,${EXTEN},1)

exten => *80714,1,Goto(ext-intercom,${EXTEN},1)

exten => *80715,1,Goto(ext-intercom,${EXTEN},1)

exten => *801300,1,Goto(ext-intercom,${EXTEN},1)

exten => *801301,1,Goto(ext-intercom,${EXTEN},1)

exten => *801302,1,Goto(ext-intercom,${EXTEN},1)

exten => *801303,1,Goto(ext-intercom,${EXTEN},1)

exten => *801304,1,Goto(ext-intercom,${EXTEN},1)

exten => *801305,1,Goto(ext-intercom,${EXTEN},1)

exten => *801306,1,Goto(ext-intercom,${EXTEN},1)

exten => *801307,1,Goto(ext-intercom,${EXTEN},1)

exten => *801308,1,Goto(ext-intercom,${EXTEN},1)

exten => *801309,1,Goto(ext-intercom,${EXTEN},1)

exten => *801310,1,Goto(ext-intercom,${EXTEN},1)

exten => *801311,1,Goto(ext-intercom,${EXTEN},1)

exten => *801312,1,Goto(ext-intercom,${EXTEN},1)

exten => *801313,1,Goto(ext-intercom,${EXTEN},1)

exten => *801996,1,Goto(ext-intercom,${EXTEN},1)

exten => *801997,1,Goto(ext-intercom,${EXTEN},1)

exten => *801998,1,Goto(ext-intercom,${EXTEN},1)

exten => *801999,1,Goto(ext-intercom,${EXTEN},1)

exten => *802071,1,Goto(ext-intercom,${EXTEN},1)

exten => *802072,1,Goto(ext-intercom,${EXTEN},1)

exten => *802073,1,Goto(ext-intercom,${EXTEN},1)

exten => *802074,1,Goto(ext-intercom,${EXTEN},1)

exten => *802075,1,Goto(ext-intercom,${EXTEN},1)

exten => *802605,1,Goto(ext-intercom,${EXTEN},1)

exten => *802607,1,Goto(ext-intercom,${EXTEN},1)

exten => *802608,1,Goto(ext-intercom,${EXTEN},1)

exten => *808181,1,Goto(ext-intercom,${EXTEN},1)

exten => *808182,1,Goto(ext-intercom,${EXTEN},1)

exten => *808585,1,Goto(ext-intercom,${EXTEN},1)

exten => *80130199,1,Goto(ext-intercom,${EXTEN},1)

exten => *54,1,Answer
exten => *54,n,Wait(1)
exten => *54,n,Macro(user-callerid,)
exten => *54,n,Set(DB(AMPUSER/${AMPUSER}/intercom)=enabled)
exten => *54,n,Playback(intercom&enabled)
exten => *54,n,Macro(hangupcall,)

exten => _*54.,1,Answer
exten => _*54.,n,Wait(1)
exten => _*54.,n,Macro(user-callerid,)
exten => _*54.,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})}" = "allow" ]}?unset)
exten => _*54.,n,GotoIf($[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]?invaliduser)
exten => _*54.,n,Set(DB(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})=allow)
exten => _*54.,n,Playback(intercom&enabled&for&extension&number)
exten => _*54.,n,SayDigits(${EXTEN:3})
exten => _*54.,n,Macro(hangupcall,)
exten => _*54.,n(unset),dbDeltree(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})
exten => _*54.,n,Playback(intercom&enabled&cancelled&for&extension&number)
exten => _*54.,n,SayDigits(${EXTEN:3})
exten => _*54.,n,Macro(hangupcall,)
exten => _*54.,n(invaliduser),Playback(extension&number)
exten => _*54.,n,SayDigits(${EXTEN:3})
exten => _*54.,n,Playback(is&invalid)
exten => _*54.,n,Macro(hangupcall,)

exten => *55,1,Answer
exten => *55,n,Wait(1)
exten => *55,n,Macro(user-callerid,)
exten => *55,n,Set(DB(AMPUSER/${AMPUSER}/intercom)=disabled)
exten => *55,n,Playback(intercom&disabled)
exten => *55,n,Macro(hangupcall,)

exten => _*55.,1,Answer
exten => _*55.,n,Wait(1)
exten => _*55.,n,Macro(user-callerid,)
exten => _*55.,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})}" = "deny" ]}?unset2)
exten => _*55.,n,GotoIf($[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]?invaliduser2)
exten => _*55.,n,Set(DB(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})=deny)
exten => _*55.,n,Playback(intercom&disabled&for&extension&number)
exten => _*55.,n,SayDigits(${EXTEN:3})
exten => _*55.,n,Macro(hangupcall,)
exten => _*55.,n(unset2),dbDeltree(AMPUSER/${AMPUSER}/intercom/${EXTEN:3})
exten => _*55.,n,Playback(intercom&disabled&cancelled&for&extension&number)
exten => _*55.,n,SayDigits(${EXTEN:3})
exten => _*55.,n,Macro(hangupcall,)
exten => _*55.,n(invaliduser2),Playback(extension&number)
exten => _*55.,n,SayDigits(${EXTEN:3})
exten => _*55.,n,Playback(is&invalid)
exten => _*55.,n,Macro(hangupcall,)

;--== end of [ext-intercom-users] ==--;


[macro-autoanswer]
include => macro-autoanswer-custom
exten => s,1,GotoIf($["${KNOWNDIAL}" != ""]?knowndial)
exten => s,n,Set(DEVICE=${DB(DEVICE/${ARG1}/dial)})
exten => s,n,GotoIf($["${DEVICE:0:5}" == "PJSIP" ]?dopjsip)
exten => s,n,Set(KNOWNDIAL=${DEVICE})
exten => s,n,Goto(knowndial)
exten => s,n(dopjsip),Set(KNOWNDIAL=${PJSIP_DIAL_CONTACTS(${ARG1})})
exten => s,n,GotoIf($[${REGEX("&" ${KNOWNDIAL})} == 0]?knowndial)
exten => s,n,Gosub(app-paging,ssetup,1())
exten => s,n,Set(PAGEMODE=PAGE)
exten => s,n,Set(PAGE_CONF_OPTS=duplex)
exten => s,n,Set(STREAM=NONE)
exten => s,n,Set(PAGE_MEMBERS=${ARG1})
exten => s,n,AGI(page.agi)
exten => s,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => s,n,Set(CONFBRIDGE(user,admin)=yes)
exten => s,n,Set(CONFBRIDGE(user,marked)=yes)
exten => s,n,ConfBridge(${PAGE_CONF},,,admin_menu)
exten => s,n,Hangup
exten => s,n(knowndial),Set(DIAL=${KNOWNDIAL})
exten => s,n,ExecIf($["${DIAL:0:3}" = "ZAP"]?Set(DIAL=DAHDI${DIAL:3}))
exten => s,n,GotoIf($["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]?macro)
exten => s,n,Set(USERAGENT=${SIPPEER(${CUT(DIAL,/,2)},useragent)})
exten => s,n,ExecIf($["${KNOWNAGENT}" != ""]?Set(USERAGENT=${KNOWNAGENT}))
exten => s,n,ExecIf($["${USERAGENT:0:5}" = "Mitel"]?Set(CALLINFO=<sip:broadworks.net>\;answer-after=0))
exten => s,n,ExecIf($["${USERAGENT:0:9}" = "Panasonic"]?Set(ALERTINFO=Intercom))
exten => s,n,ExecIf($["${USERAGENT:0:7}" = "Polycom"]?Set(ALERTINFO=info=Ring Answer))
exten => s,n,ExecIf($["${USERAGENT:0:6}" = "Digium"]?Set(ALERTINFO=ring-answer))
exten => s,n,ExecIf($["${SIPURI}" != ""]?Set(__SIP_URI_OPTIONS=${SIPURI}))
exten => s,n+2(macro),Macro(${DB(DEVICE/${ARG1}/autoanswer/macro)},${ARG1})

;--== end of [macro-autoanswer] ==--;


[autoanswer]
include => autoanswer-custom
exten => s,1,GosubIf($["${ARG1}" != ""]?addheader,1(Alert-Info,${ARG1}))
exten => s,n,GosubIf($["${ARG2}" != ""]?addheader,1(Call-Info,${ARG2}))
exten => s,n,Return()

exten => addheader,1,SIPAddHeader(${ARG1}: ${ARG2})
exten => addheader,n,Set(PJSIP_HEADER(add,${ARG1})=${ARG2})
exten => addheader,n,Return()

;--== end of [autoanswer] ==--;


[app-paging]
include => app-paging-custom
exten => ssetup,1,Set(_SIPURI=)
exten => ssetup,n,Set(_ALERTINFO=Ring Answer)
exten => ssetup,n,Set(_CALLINFO=<uri>\;answer-after=0)
exten => ssetup,n,Set(_SIPURI=intercom=true)
exten => ssetup,n,Set(_DTIME=5)
exten => ssetup,n,Set(_ANSWERMACRO=)
exten => ssetup,n,Set(PAGE_CONF=${EPOCH}${RAND(100,999)})
exten => ssetup,n,Return()

exten => _PAGE.,1(SKIPCHECK),Macro(autoanswer,${EXTEN:4})
exten => _PAGE.,n,Set(_DOPTIONS=A(beep)b(autoanswer^s^1(${ALERTINFO},${CALLINFO})))
exten => _PAGE.,n,Dial(${DIAL},${DTIME},${DOPTIONS})
exten => _PAGE.,n(skipself),Hangup

exten => _SPAGE.,1(chanspy),ChanSpy(${SP_DEVICE}-,qW)
exten => _SPAGE.,n,Hangup

;--== end of [app-paging] ==--;


[app-page-stream]
include => app-page-stream-custom
exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => s,n,Set(CONFBRIDGE(user,marked)=yes)
exten => s,n,ConfBridge(${PAGE_CONF},,,)
exten => s,n,Hangup

;--== end of [app-page-stream] ==--;


[ext-paging]
include => ext-paging-custom
exten => 1350,1,Goto(app-pagegroups,1350,1)
exten => 1350,hint,Custom:PAGE1350

exten => 1380,1,Goto(app-pagegroups,1380,1)
exten => 1380,hint,Custom:PAGE1380

exten => 1381,1,Goto(app-pagegroups,1381,1)
exten => 1381,hint,Custom:PAGE1381

exten => 1389,1,Goto(app-pagegroups,1389,1)
exten => 1389,hint,Custom:PAGE1389

;--== end of [ext-paging] ==--;


[app-pagegroups]
include => app-pagegroups-custom
exten => 1350,1,Macro(user-callerid,)
exten => 1350,n,Set(_PAGEGROUP=1350)
exten => 1350,n(busy-check),GotoIf($[${TRYLOCK(apppagegroups1350)}]?:busy)
exten => 1350,n(devstate),Set(DEVICE_STATE(Custom:PAGE1350)=INUSE)
exten => 1350,n,Gosub(app-paging,ssetup,1())
exten => 1350,n,Set(PAGEMODE=PAGE)
exten => 1350,n,Set(PAGE_MEMBERS=1301-1302-1303-1306-1307-1308-1309-1310-1311)
exten => 1350,n,Set(PAGE_CONF_OPTS=duplex)
exten => 1350,n(agi),AGI(page.agi)
exten => 1350,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => 1350,n,Set(CONFBRIDGE(user,admin)=yes)
exten => 1350,n,Set(CONFBRIDGE(user,marked)=yes)
exten => 1350,n,Answer
exten => 1350,n(page),ConfBridge(${PAGE_CONF},,,admin_menu)
exten => 1350,n,Hangup
exten => 1350,n(busy),Set(PAGE${PAGEGROUP}BUSY=TRUE)
exten => 1350,n(play-busy),Busy(3)
exten => 1350,n(busy-hang),Goto(app-pagegroups,h,1)

exten => 1380,1,Macro(user-callerid,)
exten => 1380,n,Set(_PAGEGROUP=1380)
exten => 1380,n(busy-check),GotoIf($[${TRYLOCK(apppagegroups1380)}]?:busy)
exten => 1380,n(devstate),Set(DEVICE_STATE(Custom:PAGE1380)=INUSE)
exten => 1380,n,Gosub(app-paging,ssetup,1())
exten => 1380,n,Set(PAGEMODE=PAGE)
exten => 1380,n,Set(PAGE_MEMBERS=1304-1305)
exten => 1380,n,Set(PAGE_CONF_OPTS=duplex)
exten => 1380,n(agi),AGI(page.agi)
exten => 1380,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => 1380,n,Set(CONFBRIDGE(user,admin)=yes)
exten => 1380,n,Set(CONFBRIDGE(user,marked)=yes)
exten => 1380,n,Answer
exten => 1380,n(page),ConfBridge(${PAGE_CONF},,,admin_menu)
exten => 1380,n,Hangup
exten => 1380,n(busy),Set(PAGE${PAGEGROUP}BUSY=TRUE)
exten => 1380,n(play-busy),Busy(3)
exten => 1380,n(busy-hang),Goto(app-pagegroups,h,1)

exten => 1381,1,Macro(user-callerid,)
exten => 1381,n,Set(_PAGEGROUP=1381)
exten => 1381,n(busy-check),GotoIf($[${TRYLOCK(apppagegroups1381)}]?:busy)
exten => 1381,n(devstate),Set(DEVICE_STATE(Custom:PAGE1381)=INUSE)
exten => 1381,n,Gosub(app-paging,ssetup,1())
exten => 1381,n,Set(PAGEMODE=PAGE)
exten => 1381,n,Set(PAGE_MEMBERS=1306-1307-1308-1309-1310)
exten => 1381,n,Set(PAGE_CONF_OPTS=duplex)
exten => 1381,n(agi),AGI(page.agi)
exten => 1381,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => 1381,n,Set(CONFBRIDGE(user,admin)=yes)
exten => 1381,n,Set(CONFBRIDGE(user,marked)=yes)
exten => 1381,n,Answer
exten => 1381,n(page),ConfBridge(${PAGE_CONF},,,admin_menu)
exten => 1381,n,Hangup
exten => 1381,n(busy),Set(PAGE${PAGEGROUP}BUSY=TRUE)
exten => 1381,n(play-busy),Busy(3)
exten => 1381,n(busy-hang),Goto(app-pagegroups,h,1)

exten => 1389,1,Macro(user-callerid,)
exten => 1389,n,Set(_PAGEGROUP=1389)
exten => 1389,n(busy-check),GotoIf($[${TRYLOCK(apppagegroups1389)}]?:busy)
exten => 1389,n(devstate),Set(DEVICE_STATE(Custom:PAGE1389)=INUSE)
exten => 1389,n,Gosub(app-paging,ssetup,1())
exten => 1389,n,Set(PAGEMODE=FPAGE)
exten => 1389,n,Set(PAGE_MEMBERS=1303)
exten => 1389,n,Set(PAGE_CONF_OPTS=)
exten => 1389,n(agi),AGI(page.agi)
exten => 1389,n,Set(CONFBRIDGE(user,template)=page_user_duplex)
exten => 1389,n,Set(CONFBRIDGE(user,admin)=yes)
exten => 1389,n,Set(CONFBRIDGE(user,marked)=yes)
exten => 1389,n,Answer
exten => 1389,n(page),ConfBridge(${PAGE_CONF},,,admin_menu)
exten => 1389,n,Hangup
exten => 1389,n(busy),Set(PAGE${PAGEGROUP}BUSY=TRUE)
exten => 1389,n(play-busy),Busy(3)
exten => 1389,n(busy-hang),Goto(app-pagegroups,h,1)

exten => h,1,ExecIf($[${ISNULL(${PAGE${PAGEGROUP}BUSY})}]?Set(DEVICE_STATE(Custom:PAGE${PAGEGROUP})=NOT_INUSE))

;--== end of [app-pagegroups] ==--;


[macro-parked-call]
include => macro-parked-call-custom
exten => s,1,Macro(user-callerid,)
exten => s,n,Gosub(sub-record-check,s,1(parking,${AMPUSER},${AMPUSER}))
exten => s,n,Noop(PARKRETURNTO: ${SHARED(PARKRETURNTO,${CHANNEL})})
exten => s,n,GotoIf($[${LEN(${SHARED(PARKRETURNTO,${CHANNEL})})} > 0]?backtosender)
exten => s,n,GotoIf($[${LEN(${BLINDTRANSFER})} > 0 | ${LEN(${ATTENDEDTRANSFER})} > 0]?attemptpark)
exten => s,n,AGI(parkfetch.agi,${ARG1},${ARG2})
exten => s,n,GotoIf($["${REC_STATUS}" != "RECORDING"]?next)
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => s,n(next),Set(CCSS_SETUP=TRUE)
exten => s,n,GotoIf($["${ARG1}" = "" | ${DIALPLAN_EXISTS(${IF($["${ARG2}" = "default"]?parkedcalls:${ARG2})},${ARG1},1)} = 1]?pcall)
exten => s,n,ResetCDR()
exten => s,n,NoCDR()
exten => s,n,Wait(1)
exten => s,n,Playback(pbx-invalidpark)
exten => s,n,Wait(1)
exten => s,n,Hangup
exten => s,n(pcall),Noop(User: ${CALLERID(all)} attempting to pick up Parked Call Slot ${ARG1})
exten => s,n,Noop(PARKIE: ${PARKIE})
exten => s,n,Set(SHARED(PARKRETURNTO,${PARKIE})=)
exten => s,n,Set(PARKOWNER=1)
exten => s,n,ParkedCall(${ARG2},${ARG1})
exten => s,n(attemptpark),Noop(User: ${CALLERID(all)} attempting to Park into slot ${ARG1})
exten => s,n,Noop(Blind Transfer: ${BLINDTRANSFER}, Attended Transfer: ${ATTENDEDTRANSFER})
exten => s,n,Noop($[${LEN(${PARKOWNER})} = 0])
exten => s,n,GotoIf($[${LEN(${PARKOWNER})} = 0]?parkit)
exten => s,n,Macro(hangupcall,)
exten => s,n(parkit),Set(PARKINGEXTEN=${ARG1})
exten => s,n,ExecIf($[${LEN(${BLINDTRANSFER})} > 0]?Set(SHARED(PARKRETURNTO,${CHANNEL})=${CUT(BLINDTRANSFER,-,1)}):Set(SHARED(PARKRETURNTO,${CHANNEL})=${CUT(ATTENDEDTRANSFER,-,1)}))
exten => s,n,Noop(PARKRETURNTO: ${SHARED(PARKRETURNTO,${CHANNEL})})
exten => s,n,Park(${ARG2},sc(${CONTEXT},s,200))
exten => s,1+199(backtosender),Noop(Attempting to go back to sender)
exten => s,n,Set(PARKCALLBACK=${PARKER})
exten => s,n,Set(SHARED(PARKRETURNTO,${CHANNEL})=)
exten => s,n,Goto(park-return-routing,${PARKINGSLOT},1)

exten => h,1,Macro(hangupcall,)

;--== end of [macro-parked-call] ==--;


[parkedcallstimeout]
include => parkedcallstimeout-custom
exten => _[0-9a-zA-Z*#].,1,Set(PARKCALLBACK=${REPLACE(EXTEN,_,/)})
exten => _[0-9a-zA-Z*#].,n,GotoIf($["${REC_STATUS}" != "RECORDING"]?next)
exten => _[0-9a-zA-Z*#].,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => _[0-9a-zA-Z*#].,n,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST})
exten => _[0-9a-zA-Z*#].,n(next),Goto(park-return-routing,${PARKINGSLOT},1)

;--== end of [parkedcallstimeout] ==--;


[park-dial]
include => park-dial-custom
exten => t,1,Noop(WARNING: PARKRETURN to: [${EXTEN}] failed with: [${DIALSTATUS}]. Trying Alternate Dest On Parking Lot ${PARKINGSLOT})
exten => t,n,Goto(park-orphan-routing,70,1)

exten => _[0-9a-zA-Z*#].,1,Noop(WARNING: PARKRETURN to: [${EXTEN}] failed with: [${DIALSTATUS}]. Trying Alternate Dest On Parking Lot ${PARKINGSLOT})
exten => _[0-9a-zA-Z*#].,n,Goto(park-orphan-routing,70,1)

;--== end of [park-dial] ==--;


[park-orphan-routing]
include => park-orphan-routing-custom
exten => 70,1,Goto(app-blackhole,hangup,1)

;--== end of [park-orphan-routing] ==--;


[park-return-routing]
include => park-return-routing-custom
exten => 70,1,Set(PLOT=70)
exten => 70,n,ExecIf($[${LEN(${PREPARK_CID})} = 0]?Set(PREPARK_CID=${CALLERID(name)}))
exten => 70,n,Set(CALLERID(name)=${PARKINGSLOT}:${PREPARK_CID})
exten => 70,n,Dial(${PARKCALLBACK},15,tr)
exten => 70,n,Set(PARKCALLBACK=)
exten => 70,n,Goto(app-blackhole,hangup,1)

exten => 71,1,Goto(70,1)

exten => 72,1,Goto(70,1)

exten => 73,1,Goto(70,1)

exten => 74,1,Goto(70,1)

;--== end of [park-return-routing] ==--;


[park-hints]
include => park-hints-custom
include => parkedcalls ; WestSeattleParking
exten => 71,1,Macro(parked-call,71,default)
exten => 71,hint,park:71@parkedcalls

exten => 72,1,Macro(parked-call,72,default)
exten => 72,hint,park:72@parkedcalls

exten => 73,1,Macro(parked-call,73,default)
exten => 73,hint,park:73@parkedcalls

exten => 74,1,Macro(parked-call,74,default)
exten => 74,hint,park:74@parkedcalls

exten => *85,1,Macro(parked-call,,default)
exten => *85,hint,park:71@parkedcalls&park:72@parkedcalls&park:73@parkedcalls&park:74@parkedcalls

exten => *8570,1,Macro(parked-call,,default)
exten => *8570,hint,park:71@parkedcalls&park:72@parkedcalls&park:73@parkedcalls&park:74@parkedcalls

exten => *85100,1,Macro(parked-call,,default)
exten => *85100,hint,Custom:PARK100

exten => *85101,1,Macro(parked-call,,default)
exten => *85101,hint,Custom:PARK101

exten => *85102,1,Macro(parked-call,,default)
exten => *85102,hint,Custom:PARK102

exten => *85103,1,Macro(parked-call,,default)
exten => *85103,hint,Custom:PARK103

exten => *85104,1,Macro(parked-call,,default)
exten => *85104,hint,Custom:PARK104

exten => *85105,1,Macro(parked-call,,default)
exten => *85105,hint,Custom:PARK105

exten => *85106,1,Macro(parked-call,,default)
exten => *85106,hint,Custom:PARK106

exten => *85108,1,Macro(parked-call,,default)
exten => *85108,hint,Custom:PARK108

exten => *85109,1,Macro(parked-call,,default)
exten => *85109,hint,Custom:PARK109

exten => *85110,1,Macro(parked-call,,default)
exten => *85110,hint,Custom:PARK110

exten => *85113,1,Macro(parked-call,,default)
exten => *85113,hint,Custom:PARK113

exten => *85124,1,Macro(parked-call,,default)
exten => *85124,hint,Custom:PARK124

exten => *851300,1,Macro(parked-call,,default)
exten => *851300,hint,Custom:PARK1300

exten => *851301,1,Macro(parked-call,,default)
exten => *851301,hint,Custom:PARK1301

exten => *85130199,1,Macro(parked-call,,default)
exten => *85130199,hint,Custom:PARK130199

exten => *851302,1,Macro(parked-call,,default)
exten => *851302,hint,Custom:PARK1302

exten => *851303,1,Macro(parked-call,,default)
exten => *851303,hint,Custom:PARK1303

exten => *851304,1,Macro(parked-call,,default)
exten => *851304,hint,Custom:PARK1304

exten => *851305,1,Macro(parked-call,,default)
exten => *851305,hint,Custom:PARK1305

exten => *851306,1,Macro(parked-call,,default)
exten => *851306,hint,Custom:PARK1306

exten => *851307,1,Macro(parked-call,,default)
exten => *851307,hint,Custom:PARK1307

exten => *851308,1,Macro(parked-call,,default)
exten => *851308,hint,Custom:PARK1308

exten => *851309,1,Macro(parked-call,,default)
exten => *851309,hint,Custom:PARK1309

exten => *851310,1,Macro(parked-call,,default)
exten => *851310,hint,Custom:PARK1310

exten => *851311,1,Macro(parked-call,,default)
exten => *851311,hint,Custom:PARK1311

exten => *851312,1,Macro(parked-call,,default)
exten => *851312,hint,Custom:PARK1312

exten => *85197,1,Macro(parked-call,,default)
exten => *85197,hint,Custom:PARK197

exten => *85198,1,Macro(parked-call,,default)
exten => *85198,hint,Custom:PARK198

exten => *85199,1,Macro(parked-call,,default)
exten => *85199,hint,Custom:PARK199

exten => *851996,1,Macro(parked-call,,default)
exten => *851996,hint,Custom:PARK1996

exten => *851997,1,Macro(parked-call,,default)
exten => *851997,hint,Custom:PARK1997

exten => *851998,1,Macro(parked-call,,default)
exten => *851998,hint,Custom:PARK1998

exten => *851999,1,Macro(parked-call,,default)
exten => *851999,hint,Custom:PARK1999

exten => *852,1,Macro(parked-call,,default)
exten => *852,hint,Custom:PARK2

exten => *852071,1,Macro(parked-call,,default)
exten => *852071,hint,Custom:PARK2071

exten => *852072,1,Macro(parked-call,,default)
exten => *852072,hint,Custom:PARK2072

exten => *852073,1,Macro(parked-call,,default)
exten => *852073,hint,Custom:PARK2073

exten => *852074,1,Macro(parked-call,,default)
exten => *852074,hint,Custom:PARK2074

exten => *852075,1,Macro(parked-call,,default)
exten => *852075,hint,Custom:PARK2075

exten => *852605,1,Macro(parked-call,,default)
exten => *852605,hint,Custom:PARK2605

exten => *852607,1,Macro(parked-call,,default)
exten => *852607,hint,Custom:PARK2607

exten => *852608,1,Macro(parked-call,,default)
exten => *852608,hint,Custom:PARK2608

exten => *853,1,Macro(parked-call,,default)
exten => *853,hint,Custom:PARK3

exten => *85700,1,Macro(parked-call,,default)
exten => *85700,hint,Custom:PARK700

exten => *85701,1,Macro(parked-call,,default)
exten => *85701,hint,Custom:PARK701

exten => *85702,1,Macro(parked-call,,default)
exten => *85702,hint,Custom:PARK702

exten => *85703,1,Macro(parked-call,,default)
exten => *85703,hint,Custom:PARK703

exten => *85704,1,Macro(parked-call,,default)
exten => *85704,hint,Custom:PARK704

exten => *85705,1,Macro(parked-call,,default)
exten => *85705,hint,Custom:PARK705

exten => *85706,1,Macro(parked-call,,default)
exten => *85706,hint,Custom:PARK706

exten => *85707,1,Macro(parked-call,,default)
exten => *85707,hint,Custom:PARK707

exten => *85709,1,Macro(parked-call,,default)
exten => *85709,hint,Custom:PARK709

exten => *85711,1,Macro(parked-call,,default)
exten => *85711,hint,Custom:PARK711

exten => *85712,1,Macro(parked-call,,default)
exten => *85712,hint,Custom:PARK712

exten => *85713,1,Macro(parked-call,,default)
exten => *85713,hint,Custom:PARK713

exten => *85714,1,Macro(parked-call,,default)
exten => *85714,hint,Custom:PARK714

exten => *85715,1,Macro(parked-call,,default)
exten => *85715,hint,Custom:PARK715

exten => *858181,1,Macro(parked-call,,default)
exten => *858181,hint,Custom:PARK8181

exten => *858182,1,Macro(parked-call,,default)
exten => *858182,hint,Custom:PARK8182

exten => *858585,1,Macro(parked-call,,default)
exten => *858585,hint,Custom:PARK8585

exten => *85991236,1,Macro(parked-call,,default)
exten => *85991236,hint,Custom:PARK991236

exten => *8599502,1,Macro(parked-call,,default)
exten => *8599502,hint,Custom:PARK99502

;--== end of [park-hints] ==--;


[app-pbdirectory]
include => app-pbdirectory-custom
exten => 411,1,Goto(pbdirectory,1)

exten => pbdirectory,1,Answer
exten => pbdirectory,n,Wait(1)
exten => pbdirectory,n,Macro(user-callerid,)
exten => pbdirectory,n,AGI(pbdirectory)
exten => pbdirectory,n,GotoIf($["${dialnumber}"=""]?hangup,1)
exten => pbdirectory,n,Noop(Got number to dial: ${dialnumber})
exten => pbdirectory,n,Dial(Local/${dialnumber}@from-internal/n,)

exten => hangup,1,Hangup

;--== end of [app-pbdirectory] ==--;


[app-queue-toggle]
include => app-queue-toggle-custom
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Set(QUEUEUSER=${IF($[${LEN(${QUEUEUSER})}>0]?${QUEUEUSER}:${AMPUSER})})
exten => s,n,Set(QUEUESTAT=LOGGEDOUT)
exten => s,n,AGI(queue_devstate.agi,getqueues,${QUEUEUSER})
exten => s,n,GotoIf($["${QUEUESTAT}" = "LOGGEDOUT"]?activate)
exten => s,n,GotoIf($["${QUEUESTAT}" = "LOGGEDIN"]?deactivate)
exten => s,n,GotoIf($["${QUEUESTAT}" = "STATIC"]?static:end)
exten => s,n(deactivate),Noop(Agent Logged out)
exten => s,n,Macro(toggle-del-agent,)
exten => s,n(logout),Set(STATE=NOT_INUSE)
exten => s,n,Gosub(sstate,1())
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Macro(hangupcall,)
exten => s,n(activate),Noop(Agent Logged In)
exten => s,n,Macro(toggle-add-agent,)
exten => s,n,GotoIf($["${QAGENT_UNAUTHORIZED}"="1"]?logout)
exten => s,n,Set(STATE=INUSE)
exten => s,n,Gosub(sstate,1())
exten => s,n,Playback(agent-loginok)
exten => s,n,SayDigits(${QUEUEUSER})
exten => s,n,Macro(hangupcall,)
exten => s,n(static),Noop(User is a Static Agent)
exten => s,n,Set(STATE=INUSE)
exten => s,n,Gosub(sstate,1())
exten => s,n,Playback(agent-loginok)
exten => s,n,Macro(hangupcall,)

exten => sstate,1,Set(DEVICES=${DB(AMPUSER/${QUEUEUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:QUEUE${CUT(DEVICES,&,${ITER})}*${QUEUENO})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()

;--== end of [app-queue-toggle] ==--;


[app-all-queue-toggle]
include => app-all-queue-toggle-custom
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,AGI(queue_devstate.agi,getall,${AMPUSER})
exten => s,n,GotoIf($["${QUEUESTAT}" = "NOQUEUES"]?skip)
exten => s,n,Set(TOGGLE_MACRO=${IF($["${QUEUESTAT}"="LOGGEDOUT"]?toggle-add-agent:toggle-del-agent)})
exten => s,n,Set(STATE=${IF($["${QUEUESTAT}"="LOGGEDOUT"]?INUSE:NOT_INUSE)})
exten => s,n,Set(LOOPCNTALL=${FIELDQTY(USERQUEUES,-)})
exten => s,n,Set(ITERALL=1)
exten => s,n(begin),Set(QUEUENO=${CUT(USERQUEUES,-,${ITERALL})})
exten => s,n,Set(ITERALL=$[${ITERALL}+1])
exten => s,n,Macro(${TOGGLE_MACRO},)
exten => s,n,Gosub(app-queue-toggle,sstate,1())
exten => s,n,GotoIf($[${ITERALL} <= ${LOOPCNTALL}]?begin)
exten => s,n(skip),ExecIf($["${QUEUESTAT}"="LOGGEDIN" | "${QUEUESTAT}"="NOQUEUES"]?Playback(agent-loggedoff))
exten => s,n,ExecIf($["${QUEUESTAT}"="LOGGEDOUT"]?Playback(agent-loginok))
exten => s,n,ExecIf($["${QUEUESTAT}"="LOGGEDOUT"]?SayDigits(${AMPUSER}))
exten => s,n,Macro(hangupcall,)

;--== end of [app-all-queue-toggle] ==--;


[macro-toggle-del-agent]
include => macro-toggle-del-agent-custom
exten => s,1,Macro(user-callerid,SKIPTTL,)
exten => s,n,Set(QUEUEUSER=${IF($[${LEN(${QUEUEUSER})}>0]?${QUEUEUSER}:${AMPUSER})})
exten => s,n,Set(QUEUEUSERCIDNAME=${DB(AMPUSER/${QUEUEUSER}/cidname)})
exten => s,n,RemoveQueueMember(${QUEUENO},Local/${QUEUEUSER}@from-queue/n)
exten => s,n,RemoveQueueMember(${QUEUENO},Local/${QUEUEUSER}@from-internal/n)
exten => s,n,UserEvent(RefreshQueue)
exten => s,n,QueueLog(${QUEUENO},MANAGER,${IF($[${LEN(${QUEUEUSERCIDNAME})}>0]?${QUEUEUSERCIDNAME}:${QUEUEUSER})},REMOVEMEMBER,)
exten => s,n,MacroExit()

;--== end of [macro-toggle-del-agent] ==--;


[macro-toggle-add-agent]
include => macro-toggle-add-agent-custom
exten => s,1,Macro(user-callerid,SKIPTTL,)
exten => s,n,Set(QUEUEUSER=${IF($[${LEN(${QUEUEUSER})}>0]?${QUEUEUSER}:${AMPUSER})})
exten => s,n,Set(QUEUEUSERCIDNAME=${DB(AMPUSER/${QUEUEUSER}/cidname)})
exten => s,n,GotoIf($["${DB(QPENALTY/${QUEUENO}/dynmemberonly)}" = "yes" & ${DB_EXISTS(QPENALTY/${QUEUENO}/agents/${QUEUEUSER})} != 1]?invalid)
exten => s,n,ExecIf($["${DB(AMPUSER/${QUEUEUSER}/queues/qnostate)}" != "ignorestate"]?AddQueueMember(${QUEUENO},Local/${QUEUEUSER}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${QUEUEUSER})},,${QUEUEUSERCIDNAME},hint:${QUEUEUSER}@ext-local))
exten => s,n,ExecIf($["${DB(AMPUSER/${QUEUEUSER}/queues/qnostate)}" = "ignorestate"]?AddQueueMember(${QUEUENO},Local/${QUEUEUSER}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${QUEUEUSER})},,${QUEUEUSERCIDNAME}))
exten => s,n,UserEvent(AgentLogin,Agent: ${QUEUEUSER})
exten => s,n,QueueLog(${QUEUENO},MANAGER,${IF($[${LEN(${QUEUEUSERCIDNAME})}>0]?${QUEUEUSERCIDNAME}:${QUEUEUSER})},ADDMEMBER,)
exten => s,n,MacroExit()
exten => s,n(invalid),Playback(pbx-invalid)
exten => s,n,Set(QAGENT_UNAUTHORIZED=1)
exten => s,n,MacroExit()

;--== end of [macro-toggle-add-agent] ==--;


[app-queue-pause-toggle]
include => app-queue-pause-toggle-custom
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Set(QUEUEUSER=${IF($[${LEN(${ARG2})}>0]?${ARG2}:${AMPUSER})})
exten => s,n,Set(MEMBR=Local/${QUEUEUSER}@from-queue/n)
exten => s,n,Set(PAUSE_STATE=${QUEUE_MEMBER(${ARG1},paused,${MEMBR})})
exten => s,n,Set(QUEUE_MEMBER(${ARG1},paused,${MEMBR})=${IF($[${PAUSE_STATE}]?0:1)})
exten => s,n,Playback(dictate/pause&${IF($[${PAUSE_STATE}]?de-activated:activated)})
exten => s,n,ExecIf($[${ARG2}]?Return())
exten => s,n,Macro(hangupcall,)

;--== end of [app-queue-pause-toggle] ==--;


[app-all-queue-pause-toggle]
include => app-all-queue-pause-toggle-custom
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,AGI(queue_devstate.agi,toggle-pause-all,${AMPUSER})
exten => s,n,Playback(dictate/pause&${IF($[${TOGGLEPAUSED}]?activated:de-activated)})
exten => s,n,Macro(hangupcall,)

;--== end of [app-all-queue-pause-toggle] ==--;


[ext-queues]
include => ext-queues-custom
exten => 1391,1,Macro(user-callerid,)
exten => 1391,n,Answer
exten => 1391,n,Macro(blkvm-set,reset)
exten => 1391,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"]?Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)))
exten => 1391,n,Set(__NODEST=${EXTEN})
exten => 1391,n,Set(QCIDPP=${IF($[${LEN(${VQ_CIDPP})}>0]?${VQ_CIDPP}: )})
exten => 1391,n,Set(VQ_CIDPP=)
exten => 1391,n,ExecIf($["${QCIDPP}"!=""]?Macro(prepend-cid,${QCIDPP}))
exten => 1391,n,Set(QAINFO=${IF($[${LEN(${VQ_AINFO})}>0]?${VQ_AINFO}: )})
exten => 1391,n,Set(VQ_AINFO=)
exten => 1391,n,ExecIf($["${QAINFO}"!=""]?Set(__ALERT_INFO=${QAINFO}))
exten => 1391,n,Set(QJOINMSG=${IF($[${LEN(${VQ_JOINMSG})}>0]?${IF($["${VQ_JOINMSG}"!="0"]?${VQ_JOINMSG}: )}: )})
exten => 1391,n,Set(VQ_JOINMSG=)
exten => 1391,n,Set(QRINGOPTS=r)
exten => 1391,n,Set(QRETRY=${IF($[${LEN(${VQ_RETRY})}>0]?${VQ_RETRY}: )})
exten => 1391,n,Set(VQ_RETRY=)
exten => 1391,n(qoptions),Set(QOPTIONS=${IF($[${LEN(${VQ_OPTIONS})}>0]?${VQ_OPTIONS}:t)}${QCANCELMISSED}${QRINGOPTS}${QRETRY})
exten => 1391,n,Set(VQ_OPTIONS=)
exten => 1391,n(qgosub),Set(QGOSUB=${IF($[${LEN(${VQ_GOSUB})}>0]?${VQ_GOSUB}:${QGOSUB})})
exten => 1391,n,Set(VQ_GOSUB=)
exten => 1391,n(qagi),Set(QAGI=${IF($[${LEN(${VQ_AGI})}>0]?${VQ_AGI}:${QAGI})})
exten => 1391,n,Set(VQ_AGI=)
exten => 1391,n(qrule),Set(QRULE=${IF($[${LEN(${VQ_RULE})}>0]?${IF($["${VQ_RULE}"!="0"]?${VQ_RULE}: )}:${QRULE})})
exten => 1391,n,Set(VQ_RULE=)
exten => 1391,n(qposition),Set(QPOSITION=${IF($[${LEN(${VQ_POSITION})}>0]?${VQ_POSITION}:${QPOSITION})})
exten => 1391,n,Set(VQ_POSITION=)
exten => 1391,n,Gosub(sub-record-check,s,1(q,1391,dontcare))
exten => 1391,n,ExecIf($["${QJOINMSG}"!=""]?Playback(${QJOINMSG}, ))
exten => 1391,n,QueueLog(1391,${UNIQUEID},NONE,DID,${FROM_DID})
exten => 1391,n,Set(QAANNOUNCE=${IF($[${LEN(${VQ_AANNOUNCE})}>0]?${IF($["${VQ_AANNOUNCE}"!="0"]?${VQ_AANNOUNCE}: )}: )})
exten => 1391,n,Set(VQ_AANNOUNCE=)
exten => 1391,n,Set(QMOH=${IF($["${VQ_MOH}"!=""]?${VQ_MOH}:default)})
exten => 1391,n,Set(VQ_MOH=)
exten => 1391,n,ExecIf($["${QMOH}"!=""]?Set(__MOHCLASS=${QMOH}))
exten => 1391,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => 1391,n,Set(QMAXWAIT=${IF($[${LEN(${VQ_MAXWAIT})}>0]?${VQ_MAXWAIT}:20)})
exten => 1391,n,Set(VQ_MAXWAIT=)
exten => 1391,n,Set(QUEUENUM=1391)
exten => 1391,n,Set(QUEUEJOINTIME=${EPOCH})
exten => 1391,n(qcall),Queue(1391,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})
exten => 1391,n,Macro(blkvm-clr,)
exten => 1391,n,Gosub(sub-record-cancel,s,1())
exten => 1391,n,Set(__NODEST=)
exten => 1391,n,Set(_QUEUE_PRIO=0)
exten => 1391,n,Set(QRINGOPTS=)
exten => 1391,n,Set(QDEST=${VQ_DEST})
exten => 1391,n,Set(VQ_DEST=)
exten => 1391,n(gotodest),GotoIf($["${QDEST}"=""]?ext-local,vmu1305,1:${CUT(QDEST,^,1)},${CUT(QDEST,^,2)},${CUT(QDEST,^,3)})

exten => 1391*,1,Macro(agent-add,1391,Elanr000!)

exten => 1391**,1,Macro(agent-del,1391)

exten => *451391,1,Set(QUEUENO=1391)
exten => *451391,n,Goto(app-queue-toggle,s,start)

exten => *461391,1,Gosub(app-queue-pause-toggle,s,1(1391))

exten => 5149,1,Macro(user-callerid,)
exten => 5149,n,Answer
exten => 5149,n,Macro(blkvm-set,reset)
exten => 5149,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"]?Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)))
exten => 5149,n,Set(__NODEST=${EXTEN})
exten => 5149,n,Set(QCIDPP=${IF($[${LEN(${VQ_CIDPP})}>0]?${VQ_CIDPP}: )})
exten => 5149,n,Set(VQ_CIDPP=)
exten => 5149,n,ExecIf($["${QCIDPP}"!=""]?Macro(prepend-cid,${QCIDPP}))
exten => 5149,n,Set(QAINFO=${IF($[${LEN(${VQ_AINFO})}>0]?${VQ_AINFO}: )})
exten => 5149,n,Set(VQ_AINFO=)
exten => 5149,n,ExecIf($["${QAINFO}"!=""]?Set(__ALERT_INFO=${QAINFO}))
exten => 5149,n,Set(QJOINMSG=${IF($[${LEN(${VQ_JOINMSG})}>0]?${IF($["${VQ_JOINMSG}"!="0"]?${VQ_JOINMSG}: )}:custom/Juba3)})
exten => 5149,n,Set(VQ_JOINMSG=)
exten => 5149,n,Set(QRINGOPTS=r)
exten => 5149,n,Set(QRETRY=${IF($[${LEN(${VQ_RETRY})}>0]?${VQ_RETRY}: )})
exten => 5149,n,Set(VQ_RETRY=)
exten => 5149,n(qoptions),Set(QOPTIONS=${IF($[${LEN(${VQ_OPTIONS})}>0]?${VQ_OPTIONS}:t)}${QCANCELMISSED}${QRINGOPTS}${QRETRY})
exten => 5149,n,Set(VQ_OPTIONS=)
exten => 5149,n(qgosub),Set(QGOSUB=${IF($[${LEN(${VQ_GOSUB})}>0]?${VQ_GOSUB}:${QGOSUB})})
exten => 5149,n,Set(VQ_GOSUB=)
exten => 5149,n(qagi),Set(QAGI=${IF($[${LEN(${VQ_AGI})}>0]?${VQ_AGI}:${QAGI})})
exten => 5149,n,Set(VQ_AGI=)
exten => 5149,n(qrule),Set(QRULE=${IF($[${LEN(${VQ_RULE})}>0]?${IF($["${VQ_RULE}"!="0"]?${VQ_RULE}: )}:${QRULE})})
exten => 5149,n,Set(VQ_RULE=)
exten => 5149,n(qposition),Set(QPOSITION=${IF($[${LEN(${VQ_POSITION})}>0]?${VQ_POSITION}:${QPOSITION})})
exten => 5149,n,Set(VQ_POSITION=)
exten => 5149,n,Gosub(sub-record-check,s,1(q,5149,dontcare))
exten => 5149,n,Set(__CWIGNORE=TRUE)
exten => 5149,n,ExecIf($["${QJOINMSG}"!=""]?Playback(${QJOINMSG}, ))
exten => 5149,n,QueueLog(5149,${UNIQUEID},NONE,DID,${FROM_DID})
exten => 5149,n,Set(QAANNOUNCE=${IF($[${LEN(${VQ_AANNOUNCE})}>0]?${IF($["${VQ_AANNOUNCE}"!="0"]?${VQ_AANNOUNCE}: )}: )})
exten => 5149,n,Set(VQ_AANNOUNCE=)
exten => 5149,n,Set(QMOH=${IF($["${VQ_MOH}"!=""]?${VQ_MOH}: )})
exten => 5149,n,Set(VQ_MOH=)
exten => 5149,n,ExecIf($["${QMOH}"!=""]?Set(__MOHCLASS=${QMOH}))
exten => 5149,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => 5149,n,Set(QMAXWAIT=${IF($[${LEN(${VQ_MAXWAIT})}>0]?${VQ_MAXWAIT}: )})
exten => 5149,n,Set(VQ_MAXWAIT=)
exten => 5149,n,Set(QUEUENUM=5149)
exten => 5149,n,Set(QUEUEJOINTIME=${EPOCH})
exten => 5149,n(qcall),Queue(5149,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})
exten => 5149,n,Macro(blkvm-clr,)
exten => 5149,n,Gosub(sub-record-cancel,s,1())
exten => 5149,n,Set(__NODEST=)
exten => 5149,n,Set(_QUEUE_PRIO=0)
exten => 5149,n,Set(__CWIGNORE=)
exten => 5149,n,Set(QRINGOPTS=)
exten => 5149,n,Set(QDEST=${VQ_DEST})
exten => 5149,n,Set(VQ_DEST=)
exten => 5149,n(gotodest),GotoIf($["${QDEST}"=""]?ext-local,vmu2,1:${CUT(QDEST,^,1)},${CUT(QDEST,^,2)},${CUT(QDEST,^,3)})

exten => 5149*,1,Macro(agent-add,5149,)

exten => 5149**,1,Macro(agent-del,5149)

exten => *455149,1,Set(QUEUENO=5149)
exten => *455149,n,Goto(app-queue-toggle,s,start)

exten => *465149,1,Gosub(app-queue-pause-toggle,s,1(5149))

exten => *45,1,Goto(app-all-queue-toggle,s,start)

exten => _*45*X.,1,Goto(app-all-queue-toggle,s,start)

exten => *45*100,1,Goto(app-all-queue-toggle,s,start)

exten => *45*101,1,Goto(app-all-queue-toggle,s,start)

exten => *45*102,1,Goto(app-all-queue-toggle,s,start)

exten => *45*103,1,Goto(app-all-queue-toggle,s,start)

exten => *45*104,1,Goto(app-all-queue-toggle,s,start)

exten => *45*105,1,Goto(app-all-queue-toggle,s,start)

exten => *45*106,1,Goto(app-all-queue-toggle,s,start)

exten => *45*108,1,Goto(app-all-queue-toggle,s,start)

exten => *45*109,1,Goto(app-all-queue-toggle,s,start)

exten => *45*110,1,Goto(app-all-queue-toggle,s,start)

exten => *45*113,1,Goto(app-all-queue-toggle,s,start)

exten => *45*124,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1300,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1301,1,Goto(app-all-queue-toggle,s,start)

exten => *45*130199,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1302,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1303,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1304,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1305,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1306,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1307,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1308,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1309,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1310,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1311,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1312,1,Goto(app-all-queue-toggle,s,start)

exten => *45*197,1,Goto(app-all-queue-toggle,s,start)

exten => *45*198,1,Goto(app-all-queue-toggle,s,start)

exten => *45*199,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1996,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1997,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1998,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1999,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2071,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2072,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2073,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2074,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2075,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2605,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2607,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2608,1,Goto(app-all-queue-toggle,s,start)

exten => *45*3,1,Goto(app-all-queue-toggle,s,start)

exten => *45*700,1,Goto(app-all-queue-toggle,s,start)

exten => *45*701,1,Goto(app-all-queue-toggle,s,start)

exten => *45*702,1,Goto(app-all-queue-toggle,s,start)

exten => *45*703,1,Goto(app-all-queue-toggle,s,start)

exten => *45*704,1,Goto(app-all-queue-toggle,s,start)

exten => *45*705,1,Goto(app-all-queue-toggle,s,start)

exten => *45*706,1,Goto(app-all-queue-toggle,s,start)

exten => *45*707,1,Goto(app-all-queue-toggle,s,start)

exten => *45*709,1,Goto(app-all-queue-toggle,s,start)

exten => *45*711,1,Goto(app-all-queue-toggle,s,start)

exten => *45*712,1,Goto(app-all-queue-toggle,s,start)

exten => *45*713,1,Goto(app-all-queue-toggle,s,start)

exten => *45*714,1,Goto(app-all-queue-toggle,s,start)

exten => *45*715,1,Goto(app-all-queue-toggle,s,start)

exten => *45*8181,1,Goto(app-all-queue-toggle,s,start)

exten => *45*8182,1,Goto(app-all-queue-toggle,s,start)

exten => *45*8585,1,Goto(app-all-queue-toggle,s,start)

exten => *45*991236,1,Goto(app-all-queue-toggle,s,start)

exten => *45*99502,1,Goto(app-all-queue-toggle,s,start)

exten => *46,1,Goto(app-all-queue-pause-toggle,s,1)

exten => _*46*X.,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*100,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*101,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*102,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*103,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*104,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*105,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*106,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*108,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*109,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*110,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*113,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*124,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1300,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1301,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*130199,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1302,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1303,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1304,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1305,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1306,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1307,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1308,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1309,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1310,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1311,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1312,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*197,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*198,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*199,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1996,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1997,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1998,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1999,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2*5149,1,Gosub(app-queue-pause-toggle,s,1(5149,2))
exten => *46*2*5149,hint,Queue:5149_pause_Local/2@from-queue/n

exten => *46*2,1,Goto(app-all-queue-pause-toggle,s,1)
exten => *46*2,hint,Queue:5149_pause_Local/2@from-queue/n

exten => *46*2071,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2072,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2073,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2074,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2075,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2605,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2607,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2608,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*3,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*700,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*701,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*702,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*703,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*704,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*705,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*706,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*707,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*709,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*711,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*712,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*713,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*714,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*715,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*8181,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*8182,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*8585,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*991236,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*99502,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *47*2*5149,1,Gosub(app-queue-caller-count,s,1(5149))
exten => *47*2*5149,n,Hangup
exten => *47*2*5149,hint,Queue:5149

exten => *47*2,1,Gosub(app-queue-caller-count,s,1(5149))
exten => *47*2,n,Hangup
exten => *47*2,hint,Queue:5149

exten => h,1,Macro(hangupcall,)

;--== end of [ext-queues] ==--;


[from-queue]
include => from-queue-custom
exten => 1391,1,Goto(from-internal,${QAGENT},1)

exten => 5149,1,Goto(from-internal,${QAGENT},1)

exten => _.,1,Set(QAGENT=${EXTEN})
exten => _.,n,Goto(${NODEST},1)

;--== end of [from-queue] ==--;


[app-queue-caller-count]
include => app-queue-caller-count-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(QUEUES=${ARG1})
exten => s,n,Set(COUNT=0)
exten => s,n,Set(LOOPCNT=${FIELDQTY(QUEUES,&)})
exten => s,n,Set(ITER=1)
exten => s,n(begin1),Set(QUEUE=${CUT(QUEUES,&,${ITER})})
exten => s,n,Set(COUNT=$[${COUNT} + ${QUEUE_WAITING_COUNT(${QUEUE})}])
exten => s,n(end1),Set(ITER=$[${ITER} + 1])
exten => s,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin1)
exten => s,n,SayNumber(${COUNT},f)
exten => s,n,Playback(queue-quantity2)
exten => s,n,Return()

;--== end of [app-queue-caller-count] ==--;


[from-queue-exten-internal]
include => from-queue-exten-internal-custom
include => from-queue-exten-only
include => from-internal
exten => foo,1,Noop(bar)

;--== end of [from-queue-exten-internal] ==--;


[from-queue-exten-only]
include => from-queue-exten-only-custom
exten => 1,1,Set(RingGroupMethod=none)
exten => 1,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1,n,Gosub(sub-record-check,s,1(exten,1,))
exten => 1,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1)
exten => 1,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1,n,Hangup

exten => 2,1,Set(RingGroupMethod=none)
exten => 2,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2,n,Gosub(sub-record-check,s,1(exten,2,))
exten => 2,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2)
exten => 2,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2,n,Hangup

exten => 3,1,Set(RingGroupMethod=none)
exten => 3,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 3,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 3,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 3,n,Gosub(sub-record-check,s,1(exten,3,))
exten => 3,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},3)
exten => 3,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 3,n,Hangup

exten => 100,1,Set(RingGroupMethod=none)
exten => 100,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 100,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 100,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 100,n,Gosub(sub-record-check,s,1(exten,100,))
exten => 100,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},100)
exten => 100,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 100,n,Hangup

exten => 101,1,Set(RingGroupMethod=none)
exten => 101,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 101,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 101,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 101,n,Gosub(sub-record-check,s,1(exten,101,))
exten => 101,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},101)
exten => 101,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 101,n,Hangup

exten => 102,1,Set(RingGroupMethod=none)
exten => 102,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 102,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 102,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 102,n,Gosub(sub-record-check,s,1(exten,102,))
exten => 102,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},102)
exten => 102,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 102,n,Hangup

exten => 103,1,Set(RingGroupMethod=none)
exten => 103,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 103,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 103,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 103,n,Gosub(sub-record-check,s,1(exten,103,))
exten => 103,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},103)
exten => 103,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 103,n,Hangup

exten => 104,1,Set(RingGroupMethod=none)
exten => 104,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 104,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 104,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 104,n,Gosub(sub-record-check,s,1(exten,104,))
exten => 104,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},104)
exten => 104,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 104,n,Hangup

exten => 105,1,Set(RingGroupMethod=none)
exten => 105,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 105,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 105,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 105,n,Gosub(sub-record-check,s,1(exten,105,))
exten => 105,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},105)
exten => 105,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 105,n,Hangup

exten => 106,1,Set(RingGroupMethod=none)
exten => 106,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 106,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 106,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 106,n,Gosub(sub-record-check,s,1(exten,106,))
exten => 106,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},106)
exten => 106,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 106,n,Hangup

exten => 108,1,Set(RingGroupMethod=none)
exten => 108,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 108,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 108,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 108,n,Gosub(sub-record-check,s,1(exten,108,))
exten => 108,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},108)
exten => 108,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 108,n,Hangup

exten => 109,1,Set(RingGroupMethod=none)
exten => 109,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 109,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 109,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 109,n,Gosub(sub-record-check,s,1(exten,109,))
exten => 109,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},109)
exten => 109,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 109,n,Hangup

exten => 110,1,Set(RingGroupMethod=none)
exten => 110,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 110,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 110,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 110,n,Gosub(sub-record-check,s,1(exten,110,))
exten => 110,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},110)
exten => 110,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 110,n,Hangup

exten => 113,1,Set(RingGroupMethod=none)
exten => 113,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 113,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 113,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 113,n,Gosub(sub-record-check,s,1(exten,113,))
exten => 113,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},113)
exten => 113,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 113,n,Hangup

exten => 124,1,Set(RingGroupMethod=none)
exten => 124,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 124,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 124,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 124,n,Gosub(sub-record-check,s,1(exten,124,))
exten => 124,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},124)
exten => 124,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 124,n,Hangup

exten => 197,1,Set(RingGroupMethod=none)
exten => 197,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 197,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 197,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 197,n,Gosub(sub-record-check,s,1(exten,197,))
exten => 197,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},197)
exten => 197,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 197,n,Hangup

exten => 198,1,Set(RingGroupMethod=none)
exten => 198,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 198,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 198,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 198,n,Gosub(sub-record-check,s,1(exten,198,))
exten => 198,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},198)
exten => 198,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 198,n,Hangup

exten => 199,1,Set(RingGroupMethod=none)
exten => 199,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 199,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 199,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 199,n,Gosub(sub-record-check,s,1(exten,199,))
exten => 199,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},199)
exten => 199,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 199,n,Hangup

exten => 611,1,Set(RingGroupMethod=none)
exten => 611,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 611,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 611,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 611,n,Gosub(sub-record-check,s,1(exten,611,))
exten => 611,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},611)
exten => 611,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 611,n,Hangup

exten => 700,1,Set(RingGroupMethod=none)
exten => 700,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 700,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 700,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 700,n,Gosub(sub-record-check,s,1(exten,700,))
exten => 700,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},700)
exten => 700,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 700,n,Hangup

exten => 701,1,Set(RingGroupMethod=none)
exten => 701,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 701,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 701,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 701,n,Gosub(sub-record-check,s,1(exten,701,))
exten => 701,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},701)
exten => 701,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 701,n,Hangup

exten => 702,1,Set(RingGroupMethod=none)
exten => 702,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 702,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 702,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 702,n,Gosub(sub-record-check,s,1(exten,702,))
exten => 702,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},702)
exten => 702,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 702,n,Hangup

exten => 703,1,Set(RingGroupMethod=none)
exten => 703,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 703,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 703,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 703,n,Gosub(sub-record-check,s,1(exten,703,))
exten => 703,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},703)
exten => 703,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 703,n,Hangup

exten => 704,1,Set(RingGroupMethod=none)
exten => 704,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 704,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 704,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 704,n,Gosub(sub-record-check,s,1(exten,704,))
exten => 704,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},704)
exten => 704,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 704,n,Hangup

exten => 705,1,Set(RingGroupMethod=none)
exten => 705,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 705,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 705,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 705,n,Gosub(sub-record-check,s,1(exten,705,))
exten => 705,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},705)
exten => 705,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 705,n,Hangup

exten => 706,1,Set(RingGroupMethod=none)
exten => 706,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 706,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 706,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 706,n,Gosub(sub-record-check,s,1(exten,706,))
exten => 706,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},706)
exten => 706,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 706,n,Hangup

exten => 707,1,Set(RingGroupMethod=none)
exten => 707,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 707,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 707,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 707,n,Gosub(sub-record-check,s,1(exten,707,))
exten => 707,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},707)
exten => 707,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 707,n,Hangup

exten => 709,1,Set(RingGroupMethod=none)
exten => 709,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 709,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 709,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 709,n,Gosub(sub-record-check,s,1(exten,709,))
exten => 709,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},709)
exten => 709,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 709,n,Hangup

exten => 711,1,Set(RingGroupMethod=none)
exten => 711,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 711,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 711,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 711,n,Gosub(sub-record-check,s,1(exten,711,))
exten => 711,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},711)
exten => 711,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 711,n,Hangup

exten => 712,1,Set(RingGroupMethod=none)
exten => 712,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 712,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 712,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 712,n,Gosub(sub-record-check,s,1(exten,712,))
exten => 712,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},712)
exten => 712,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 712,n,Hangup

exten => 713,1,Set(RingGroupMethod=none)
exten => 713,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 713,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 713,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 713,n,Gosub(sub-record-check,s,1(exten,713,))
exten => 713,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},713)
exten => 713,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 713,n,Hangup

exten => 714,1,Set(RingGroupMethod=none)
exten => 714,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 714,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 714,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 714,n,Gosub(sub-record-check,s,1(exten,714,))
exten => 714,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},714)
exten => 714,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 714,n,Hangup

exten => 715,1,Set(RingGroupMethod=none)
exten => 715,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 715,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 715,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 715,n,Gosub(sub-record-check,s,1(exten,715,))
exten => 715,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},715)
exten => 715,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 715,n,Hangup

exten => 1300,1,Set(RingGroupMethod=none)
exten => 1300,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1300,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1300,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1300,n,Gosub(sub-record-check,s,1(exten,1300,))
exten => 1300,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1300)
exten => 1300,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1300,n,Hangup

exten => 1301,1,Set(RingGroupMethod=none)
exten => 1301,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1301,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1301,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1301,n,Gosub(sub-record-check,s,1(exten,1301,))
exten => 1301,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1301)
exten => 1301,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1301,n,Hangup

exten => 1302,1,Set(RingGroupMethod=none)
exten => 1302,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1302,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1302,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1302,n,Gosub(sub-record-check,s,1(exten,1302,))
exten => 1302,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1302)
exten => 1302,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1302,n,Hangup

exten => 1303,1,Set(RingGroupMethod=none)
exten => 1303,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1303,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1303,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1303,n,Gosub(sub-record-check,s,1(exten,1303,))
exten => 1303,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1303)
exten => 1303,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1303,n,Hangup

exten => 1304,1,Set(RingGroupMethod=none)
exten => 1304,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1304,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1304,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1304,n,Gosub(sub-record-check,s,1(exten,1304,))
exten => 1304,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1304)
exten => 1304,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1304,n,Hangup

exten => 1305,1,Set(RingGroupMethod=none)
exten => 1305,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1305,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1305,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1305,n,Gosub(sub-record-check,s,1(exten,1305,))
exten => 1305,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1305)
exten => 1305,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1305,n,Hangup

exten => 1306,1,Set(RingGroupMethod=none)
exten => 1306,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1306,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1306,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1306,n,Gosub(sub-record-check,s,1(exten,1306,))
exten => 1306,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1306)
exten => 1306,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1306,n,Hangup

exten => 1307,1,Set(RingGroupMethod=none)
exten => 1307,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1307,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1307,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1307,n,Gosub(sub-record-check,s,1(exten,1307,))
exten => 1307,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1307)
exten => 1307,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1307,n,Hangup

exten => 1308,1,Set(RingGroupMethod=none)
exten => 1308,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1308,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1308,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1308,n,Gosub(sub-record-check,s,1(exten,1308,))
exten => 1308,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1308)
exten => 1308,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1308,n,Hangup

exten => 1309,1,Set(RingGroupMethod=none)
exten => 1309,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1309,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1309,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1309,n,Gosub(sub-record-check,s,1(exten,1309,))
exten => 1309,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1309)
exten => 1309,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1309,n,Hangup

exten => 1310,1,Set(RingGroupMethod=none)
exten => 1310,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1310,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1310,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1310,n,Gosub(sub-record-check,s,1(exten,1310,))
exten => 1310,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1310)
exten => 1310,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1310,n,Hangup

exten => 1311,1,Set(RingGroupMethod=none)
exten => 1311,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1311,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1311,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1311,n,Gosub(sub-record-check,s,1(exten,1311,))
exten => 1311,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1311)
exten => 1311,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1311,n,Hangup

exten => 1312,1,Set(RingGroupMethod=none)
exten => 1312,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1312,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1312,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1312,n,Gosub(sub-record-check,s,1(exten,1312,))
exten => 1312,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1312)
exten => 1312,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1312,n,Hangup

exten => 1313,1,Set(RingGroupMethod=none)
exten => 1313,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1313,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1313,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1313,n,Gosub(sub-record-check,s,1(exten,1313,))
exten => 1313,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1313)
exten => 1313,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1313,n,Hangup

exten => 1996,1,Set(RingGroupMethod=none)
exten => 1996,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1996,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1996,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1996,n,Gosub(sub-record-check,s,1(exten,1996,))
exten => 1996,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1996)
exten => 1996,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1996,n,Hangup

exten => 1997,1,Set(RingGroupMethod=none)
exten => 1997,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1997,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1997,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1997,n,Gosub(sub-record-check,s,1(exten,1997,))
exten => 1997,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1997)
exten => 1997,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1997,n,Hangup

exten => 1998,1,Set(RingGroupMethod=none)
exten => 1998,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1998,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1998,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1998,n,Gosub(sub-record-check,s,1(exten,1998,))
exten => 1998,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1998)
exten => 1998,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1998,n,Hangup

exten => 1999,1,Set(RingGroupMethod=none)
exten => 1999,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1999,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 1999,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 1999,n,Gosub(sub-record-check,s,1(exten,1999,))
exten => 1999,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1999)
exten => 1999,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1999,n,Hangup

exten => 2071,1,Set(RingGroupMethod=none)
exten => 2071,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2071,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2071,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2071,n,Gosub(sub-record-check,s,1(exten,2071,))
exten => 2071,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2071)
exten => 2071,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2071,n,Hangup

exten => 2072,1,Set(RingGroupMethod=none)
exten => 2072,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2072,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2072,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2072,n,Gosub(sub-record-check,s,1(exten,2072,))
exten => 2072,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2072)
exten => 2072,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2072,n,Hangup

exten => 2073,1,Set(RingGroupMethod=none)
exten => 2073,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2073,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2073,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2073,n,Gosub(sub-record-check,s,1(exten,2073,))
exten => 2073,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2073)
exten => 2073,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2073,n,Hangup

exten => 2074,1,Set(RingGroupMethod=none)
exten => 2074,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2074,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2074,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2074,n,Gosub(sub-record-check,s,1(exten,2074,))
exten => 2074,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2074)
exten => 2074,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2074,n,Hangup

exten => 2075,1,Set(RingGroupMethod=none)
exten => 2075,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2075,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2075,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2075,n,Gosub(sub-record-check,s,1(exten,2075,))
exten => 2075,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2075)
exten => 2075,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2075,n,Hangup

exten => 2605,1,Set(RingGroupMethod=none)
exten => 2605,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2605,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2605,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2605,n,Gosub(sub-record-check,s,1(exten,2605,))
exten => 2605,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2605)
exten => 2605,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2605,n,Hangup

exten => 2607,1,Set(RingGroupMethod=none)
exten => 2607,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2607,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2607,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2607,n,Gosub(sub-record-check,s,1(exten,2607,))
exten => 2607,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2607)
exten => 2607,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2607,n,Hangup

exten => 2608,1,Set(RingGroupMethod=none)
exten => 2608,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2608,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 2608,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 2608,n,Gosub(sub-record-check,s,1(exten,2608,))
exten => 2608,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2608)
exten => 2608,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2608,n,Hangup

exten => 8181,1,Set(RingGroupMethod=none)
exten => 8181,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 8181,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 8181,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 8181,n,Gosub(sub-record-check,s,1(exten,8181,))
exten => 8181,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},8181)
exten => 8181,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 8181,n,Hangup

exten => 8182,1,Set(RingGroupMethod=none)
exten => 8182,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 8182,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 8182,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 8182,n,Gosub(sub-record-check,s,1(exten,8182,))
exten => 8182,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},8182)
exten => 8182,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 8182,n,Hangup

exten => 8585,1,Set(RingGroupMethod=none)
exten => 8585,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 8585,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 8585,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 8585,n,Gosub(sub-record-check,s,1(exten,8585,))
exten => 8585,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},8585)
exten => 8585,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 8585,n,Hangup

exten => 130199,1,Set(RingGroupMethod=none)
exten => 130199,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 130199,n(checkrecord),Set(CALLTYPE_OVERRIDE=external)
exten => 130199,n,ExecIf($[!${LEN(${FROMEXTEN})}]?Set(FROMEXTEN=${IF(${LEN(${NODEST})}?${NODEST}:external)}))
exten => 130199,n,Gosub(sub-record-check,s,1(exten,130199,))
exten => 130199,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},130199)
exten => 130199,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 130199,n,Hangup

exten => h,1,Macro(hangupcall,)

;--== end of [from-queue-exten-only] ==--;


[macro-agent-add]
include => macro-agent-add-custom
exten => s,1,Wait(1)
exten => s,n,Set(QUEUENO=${ARG1})
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n(a3),Read(CALLBACKNUM,agent-login,,,,)
exten => s,n,GotoIf($[${LEN(${CALLBACKNUM})}=0]?a5:a7)
exten => s,n(a5),Set(CALLBACKNUM=${IF($[${LEN(${AMPUSER})}=0]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,Set(THISDEVICE=${DB(DEVICE/${REALCALLERIDNUM}/dial)})
exten => s,n,GotoIf($["${CALLBACKNUM}" = ""]?a3)
exten => s,n(a7),GotoIf($["${CALLBACKNUM}" = "${QUEUENO}"]?invalid)
exten => s,n,GotoIf($["${ARG3}" = "EXTEN" & ${DB_EXISTS(AMPUSER/${CALLBACKNUM}/cidname)} = 0]?invalid)
exten => s,n,GotoIf($["${DB(QPENALTY/${QUEUENO}/dynmemberonly)}" = "yes" & ${DB_EXISTS(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})} != 1]?invalid)
exten => s,n,ExecIf($["${QREGEX}" != ""]?GotoIf($["${REGEX("${QREGEX}" ${CALLBACKNUM})}" = "0"]?invalid))
exten => s,n,ExecIf($["${ARG2}" != ""]?Authenticate(${ARG2}))
exten => s,n,Set(STATE=INUSE)
exten => s,n,Gosub(app-queue-toggle,sstate,1())
exten => s,n,ExecIf($[${DB_EXISTS(AMPUSER/${CALLBACKNUM}/cidname)} = 1 & "${DB(AMPUSER/${CALLBACKNUM}/queues/qnostate)}" != "ignorestate"]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})},,${DB(AMPUSER/${CALLBACKNUM}/cidname)},hint:${CALLBACKNUM}@ext-local))
exten => s,n,ExecIf($[${DB_EXISTS(AMPUSER/${CALLBACKNUM}/cidname)} = 1 & "${DB(AMPUSER/${CALLBACKNUM}/queues/qnostate)}" = "ignorestate"]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})},,${DB(AMPUSER/${CALLBACKNUM}/cidname)}))
exten => s,n,ExecIf($[${DB_EXISTS(AMPUSER/${CALLBACKNUM}/cidname)} = 0]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})}))
exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loginok&with&extension)
exten => s,n,SayDigits(${CALLBACKNUM})
exten => s,n,Hangup
exten => s,n,MacroExit()
exten => s,n(invalid),Playback(pbx-invalid)
exten => s,n,Goto(a3)

;--== end of [macro-agent-add] ==--;


[macro-agent-del]
include => macro-agent-del-custom
exten => s,1,Wait(1)
exten => s,n,Set(QUEUENO=${ARG1})
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n(a3),Read(CALLBACKNUM,agent-logoff,,,,)
exten => s,n,GotoIf($[${LEN(${CALLBACKNUM})}=0]?a5:a7)
exten => s,n(a5),Set(CALLBACKNUM=${IF($[${LEN(${AMPUSER})}=0]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CALLBACKNUM}" = ""]?a3)
exten => s,n,Set(STATE=NOT_INUSE)
exten => s,n,Gosub(app-queue-toggle,sstate,1())
exten => s,n(a7),RemoveQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n)
exten => s,n,RemoveQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-internal/n)
exten => s,n,UserEvent(RefreshQueue)
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup

;--== end of [macro-agent-del] ==--;


[app-recordings]
include => app-recordings-custom
exten => *77,1,Macro(user-callerid,)
exten => *77,n,Wait(2)
exten => *77,n,Macro(systemrecording,dorecord)

exten => *99,1,Macro(user-callerid,)
exten => *99,n,Wait(2)
exten => *99,n,Macro(systemrecording,docheck)

exten => *2939,1,Macro(user-callerid,)
exten => *2939,n,Wait(2)
exten => *2939,n,Macro(systemrecording,docheck,custom/JubaRamadan)

;--== end of [app-recordings] ==--;


[macro-systemrecording]
include => macro-systemrecording-custom
exten => s,1,Set(RECFILE=${IF($["${ARG2}" = ""]?/var/spool/asterisk/tmp/${AMPUSER}-ivrrecording:${ARG2})})
exten => s,n,ExecIf($["${ARG3}" != ""]?Authenticate(${ARG3}))
exten => s,n,Goto(${ARG1},1)

exten => dorecord,1,GotoIf($["${ARG2}" = ""]?skipremove)
exten => dorecord,n,System(rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*)
exten => dorecord,n(skipremove),Record(${RECFILE}.wav,,,k)
exten => dorecord,n,Wait(1)
exten => dorecord,n,Goto(confmenu,1)

exten => docheck,1,Playback(beep)
exten => docheck,n(dc_start),Background(${RECFILE},m,${CHANNEL(language)},macro-systemrecording)
exten => docheck,n,Wait(1)
exten => docheck,n,Goto(confmenu,1)

exten => confmenu,1,Background(to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording)
exten => confmenu,n,Read(RECRESULT,,1,,,4)
exten => confmenu,n,GotoIf($["x${RECRESULT}"="x*"]?dorecord,1)
exten => confmenu,n,GotoIf($["x${RECRESULT}"="x1"]?docheck,2)
exten => confmenu,n,Goto(1)

exten => 1,1,Goto(docheck,dc_start)

exten => *,1,Goto(dorecord,1)

exten => t,1,Playback(goodbye)
exten => t,n,Hangup

exten => i,1,Playback(pm-invalid-option)
exten => i,n,Goto(confmenu,1)

exten => h,1,Hangup

;--== end of [macro-systemrecording] ==--;


[ext-group]
include => ext-group-custom
exten => 601,1,Macro(user-callerid,)
exten => 601,n,Macro(blkvm-setifempty,)
exten => 601,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 601,n,Macro(blkvm-set,reset)
exten => 601,n,Set(__NODEST=)
exten => 601,n(skipov),Set(RRNODEST=${NODEST})
exten => 601,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 601,n,GosubIf($[${DB_EXISTS(RINGGROUP/601/changecid)} = 1 & "${DB(RINGGROUP/601/changecid)}" != "default" & "${DB(RINGGROUP/601/changecid)}" != ""]?sub-rgsetcid,s,1())
exten => 601,n,Gosub(sub-record-check,s,1(rg,601,dontcare))
exten => 601,n,Set(RingGroupMethod=ringall)
exten => 601,n(DIALGRP),Macro(dial,20,${DIAL_OPTIONS},703-707-711)
exten => 601,n,Gosub(sub-record-cancel,s,1())
exten => 601,n,Set(RingGroupMethod=)
exten => 601,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 601,n,Set(__NODEST=)
exten => 601,n,Macro(blkvm-clr,)
exten => 601,n,Goto(ivr-1,s,1)
exten => 601,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => 1400,1,Macro(user-callerid,)
exten => 1400,n,Macro(blkvm-setifempty,)
exten => 1400,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1400,n,Macro(blkvm-set,reset)
exten => 1400,n,Set(__NODEST=)
exten => 1400,n(skipov),Set(RRNODEST=${NODEST})
exten => 1400,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1400,n,GosubIf($[${DB_EXISTS(RINGGROUP/1400/changecid)} = 1 & "${DB(RINGGROUP/1400/changecid)}" != "default" & "${DB(RINGGROUP/1400/changecid)}" != ""]?sub-rgsetcid,s,1())
exten => 1400,n,Gosub(sub-record-check,s,1(rg,1400,dontcare))
exten => 1400,n,Set(RingGroupMethod=ringall)
exten => 1400,n(DIALGRP),Macro(dial,20,${DIAL_OPTIONS},100-101-105)
exten => 1400,n,Gosub(sub-record-cancel,s,1())
exten => 1400,n,Set(RingGroupMethod=)
exten => 1400,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1400,n,Set(__NODEST=)
exten => 1400,n,Macro(blkvm-clr,)
exten => 1400,n,Goto(ivr-7,s,1)
exten => 1400,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => 1401,1,Macro(user-callerid,)
exten => 1401,n,Macro(blkvm-setifempty,)
exten => 1401,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1401,n,Macro(blkvm-set,reset)
exten => 1401,n,Set(__NODEST=)
exten => 1401,n(skipov),Set(RRNODEST=${NODEST})
exten => 1401,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1401,n,GosubIf($[${DB_EXISTS(RINGGROUP/1401/changecid)} = 1 & "${DB(RINGGROUP/1401/changecid)}" != "default" & "${DB(RINGGROUP/1401/changecid)}" != ""]?sub-rgsetcid,s,1())
exten => 1401,n,Gosub(sub-record-check,s,1(rg,1401,dontcare))
exten => 1401,n,Set(RingGroupMethod=ringall)
exten => 1401,n(DIALGRP),Macro(dial,25,${DIAL_OPTIONS},1301-1302-1304-1305-1307-1308-1309-1310-1311-130199)
exten => 1401,n,Gosub(sub-record-cancel,s,1())
exten => 1401,n,Set(RingGroupMethod=)
exten => 1401,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1401,n,Set(__NODEST=)
exten => 1401,n,Macro(blkvm-clr,)
exten => 1401,n,Goto(ivr-9,s,1)
exten => 1401,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => 1402,1,Macro(user-callerid,)
exten => 1402,n,Macro(blkvm-setifempty,)
exten => 1402,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1402,n,Macro(blkvm-set,reset)
exten => 1402,n,Set(__NODEST=)
exten => 1402,n(skipov),Set(RRNODEST=${NODEST})
exten => 1402,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1402,n,GosubIf($[${DB_EXISTS(RINGGROUP/1402/changecid)} = 1 & "${DB(RINGGROUP/1402/changecid)}" != "default" & "${DB(RINGGROUP/1402/changecid)}" != ""]?sub-rgsetcid,s,1())
exten => 1402,n,Gosub(sub-record-check,s,1(rg,1402,dontcare))
exten => 1402,n,Set(RingGroupMethod=ringall)
exten => 1402,n(DIALGRP),Macro(dial,25,${DIAL_OPTIONS},1301-1302-1304-1305-1307-1308-1309-1310-1311-130199)
exten => 1402,n,Gosub(sub-record-cancel,s,1())
exten => 1402,n,Set(RingGroupMethod=)
exten => 1402,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1402,n,Set(__NODEST=)
exten => 1402,n,Macro(blkvm-clr,)
exten => 1402,n,Goto(app-announcement-11,s,1)
exten => 1402,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => 1403,1,Macro(user-callerid,)
exten => 1403,n,Macro(blkvm-setifempty,)
exten => 1403,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1403,n,Macro(blkvm-set,reset)
exten => 1403,n,Set(__NODEST=)
exten => 1403,n(skipov),Set(RRNODEST=${NODEST})
exten => 1403,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1403,n,GosubIf($[${DB_EXISTS(RINGGROUP/1403/changecid)} = 1 & "${DB(RINGGROUP/1403/changecid)}" != "default" & "${DB(RINGGROUP/1403/changecid)}" != ""]?sub-rgsetcid,s,1())
exten => 1403,n,Gosub(sub-record-check,s,1(rg,1403,dontcare))
exten => 1403,n,Set(RingGroupMethod=ringall)
exten => 1403,n(DIALGRP),Macro(dial,15,${DIAL_OPTIONS},1301-1302-1304-1305-1307-1308-1309-1310-1311-130199)
exten => 1403,n,Gosub(sub-record-cancel,s,1())
exten => 1403,n,Set(RingGroupMethod=)
exten => 1403,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1403,n,Set(__NODEST=)
exten => 1403,n,Macro(blkvm-clr,)
exten => 1403,n,Goto(app-announcement-12,s,1)
exten => 1403,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => h,1,Macro(hangupcall,)

;--== end of [ext-group] ==--;


[sub-rgsetcid]
include => sub-rgsetcid-custom
exten => s,1,Goto(s-${DB(RINGGROUP/${NODEST}/changecid)},1)

exten => s-fixed,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${DB(RINGGROUP/${NODEST}/fixedcid)})}" = "1"]?Set(__TRUNKCIDOVERRIDE=${DB(RINGGROUP/${NODEST}/fixedcid)}))
exten => s-fixed,n,Return()

exten => s-extern,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${DB(RINGGROUP/${NODEST}/fixedcid)})}" == "1" & "${FROM_DID}" != ""]?Set(__TRUNKCIDOVERRIDE=${DB(RINGGROUP/${NODEST}/fixedcid)}))
exten => s-extern,n,Return()

exten => s-did,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]?Set(__REALCALLERIDNUM=${FROM_DID}))
exten => s-did,n,Return()

exten => s-forcedid,1,ExecIf($["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]?Set(__TRUNKCIDOVERRIDE=${FROM_DID}))
exten => s-forcedid,n,Return()

exten => _s-.,1,Noop(Unknown value for RINGGROUP/${NODEST}/changecid of ${DB(RINGGROUP/${NODEST}/changecid)} set to "default")
exten => _s-.,n,Set(DB(RINGGROUP/${NODEST}/changecid)=default)
exten => _s-.,n,Return()

;--== end of [sub-rgsetcid] ==--;


[macro-speeddial-lookup]
include => macro-speeddial-lookup-custom
exten => s,1,GotoIf($["${ARG2}"=""]]?lookupsys)
exten => s,n,Set(SPEEDDIALNUMBER=)
exten => s,n(lookupuser),Set(SPEEDDIALNUMBER=${DB(AMPUSER/${ARG2}/speeddials/${ARG1})})
exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?lookupsys)
exten => s,n,Noop(Found speeddial ${ARG1} for user ${ARG2}: ${SPEEDDIALNUMBER})
exten => s,n,Goto(end)
exten => s,lookupuser+101(lookupsys),Set(SPEEDDIALNUMBER=${DB(sysspeeddials/${ARG1})})
exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?failed)
exten => s,n,Noop(Found system speeddial ${ARG1}: ${SPEEDDIALNUMBER})
exten => s,n,Goto(end)
exten => s,lookupsys+101(failed),Noop(No system or user speeddial found)
exten => s,n(end),Noop(End of Speeddial-lookup)

;--== end of [macro-speeddial-lookup] ==--;


[app-speeddial]
include => app-speeddial-custom
exten => _*0.,1,Macro(user-callerid,)
exten => _*0.,n,Set(SPEEDDIALLOCATION=${EXTEN:2})
exten => _*0.,n(lookup),Macro(speeddial-lookup,${SPEEDDIALLOCATION},${AMPUSER})
exten => _*0.,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?failed)
exten => _*0.,n,Goto(from-internal,${SPEEDDIALNUMBER},1)
exten => _*0.,lookup+101(failed),Playback(speed-dial-empty)
exten => _*0.,n,Congestion()

exten => *75,1,Goto(app-speeddial-set,s,1)

;--== end of [app-speeddial] ==--;


[app-speeddial-set]
include => app-speeddial-set-custom
exten => s,1,Macro(user-callerid,)
exten => s,n(setloc),Read(newlocation,speed-enterlocation,,,,)
exten => s,n(lookup),Macro(speeddial-lookup,${newlocation},${AMPUSER})
exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"!=""]?conflicts)
exten => s,n(setnum),Read(newnum,speed-enternumber,,,,)
exten => s,n(success),Set(DB(AMPUSER/${AMPUSER}/speeddials/${newlocation})=${newnum})
exten => s,n,Playback(speed-dial)
exten => s,n,SayDigits(${newlocation})
exten => s,n,Playback(is-set-to)
exten => s,n,SayDigits(${newnum})
exten => s,n,Hangup
exten => s,n(conflicts),Playback(speed-dial)
exten => s,n,SayDigits(${newlocation})
exten => s,n,Playback(is-in-use)
exten => s,n,Background(press-1&to-listen-to-it&press-2&to-enter-a-diff&location&press-3&to-change&telephone-number)
exten => s,n,WaitExten(60,)

exten => 1,1,Playback(speed-dial)
exten => 1,n,SayDigits(${newlocation})
exten => 1,n,Playback(is-set-to)
exten => 1,n,SayDigits(${SPEEDDIALNUMBER})
exten => 1,n,Goto(s,conflicts)

exten => 2,1,Goto(s,setloc)

exten => 3,1,Goto(s,setnum)

exten => t,1,Congestion()

;--== end of [app-speeddial-set] ==--;


[tc-maint]
include => tc-maint-custom
exten => s,1,NoCDR()
exten => s,n,Set(TCMAINT=RETURN)
exten => s,n,Gosub(timeconditions,1,1())
exten => s,n,Gosub(timeconditions,3,1())
exten => s,n,System(/var/lib/asterisk/bin/schedtc.php 60 /var/spool/asterisk/outgoing ${CALLERID(number)})
exten => s,n,Answer
exten => s,n,Hangup

;--== end of [tc-maint] ==--;


[timeconditions]
include => timeconditions-custom
exten => 1,1,Set(DB(TC/1/INUSESTATE)=INUSE)
exten => 1,n,Set(DB(TC/1/NOT_INUSESTATE)=NOT_INUSE)
exten => 1,n,GotoIfTime(09:00-18:00,mon-fri,*,*?truestate)
exten => 1,n,GotoIfTime(10:00-17:00,sat,*,*?truestate)
exten => 1,n(falsestate),GotoIf($["${DB(TC/1):0:4}" = "true"]?truegoto)
exten => 1,n,ExecIf($["${DB(TC/1)}" = "false"]?Set(DB(TC/1)=))
exten => 1,n(falsegoto),Set(DEVICE_STATE(Custom:TC1)=INUSE)
exten => 1,n,ExecIf($["${DB(TC/1)}" = "false_sticky"]?Set(NOT_INUSE))
exten => 1,n,GotoIf($["${TCMAINT}"!="RETURN"]?ext-group,1403,1)
exten => 1,n,Set(TCSTATE=false)
exten => 1,n,Set(TCOVERRIDE=${IF($["${DB(TC/1):0:5}" = "false"]?true:false)})
exten => 1,n,Return()
exten => 1,n(truestate),GotoIf($["${DB(TC/1):0:5}" = "false"]?falsegoto)
exten => 1,n,ExecIf($["${DB(TC/1)}" = "true"]?Set(DB(TC/1)=))
exten => 1,n(truegoto),Set(DEVICE_STATE(Custom:TC1)=NOT_INUSE)
exten => 1,n,ExecIf($["${DB(TC/1)}" = "true_sticky"]?Set(NOT_INUSE))
exten => 1,n,GotoIf($["${TCMAINT}"!="RETURN"]?ext-group,1401,1)
exten => 1,n,Set(TCSTATE=true)
exten => 1,n,Set(TCOVERRIDE=${IF($["${DB(TC/1):0:4}" = "true"]?true:false)})
exten => 1,n,Return()

exten => 3,1,Set(DB(TC/3/INUSESTATE)=INUSE)
exten => 3,n,Set(DB(TC/3/NOT_INUSESTATE)=NOT_INUSE)
exten => 3,n,GotoIfTime(07:00-22:01,mon-sun,*,*?truestate)
exten => 3,n(falsestate),GotoIf($["${DB(TC/3):0:4}" = "true"]?truegoto)
exten => 3,n,ExecIf($["${DB(TC/3)}" = "false"]?Set(DB(TC/3)=))
exten => 3,n(falsegoto),Set(DEVICE_STATE(Custom:TC3)=INUSE)
exten => 3,n,ExecIf($["${DB(TC/3)}" = "false_sticky"]?Set(NOT_INUSE))
exten => 3,n,GotoIf($["${TCMAINT}"!="RETURN"]?app-announcement-15,s,1)
exten => 3,n,Set(TCSTATE=false)
exten => 3,n,Set(TCOVERRIDE=${IF($["${DB(TC/3):0:5}" = "false"]?true:false)})
exten => 3,n,Return()
exten => 3,n(truestate),GotoIf($["${DB(TC/3):0:5}" = "false"]?falsegoto)
exten => 3,n,ExecIf($["${DB(TC/3)}" = "true"]?Set(DB(TC/3)=))
exten => 3,n(truegoto),Set(DEVICE_STATE(Custom:TC3)=NOT_INUSE)
exten => 3,n,ExecIf($["${DB(TC/3)}" = "true_sticky"]?Set(NOT_INUSE))
exten => 3,n,GotoIf($["${TCMAINT}"!="RETURN"]?ext-queues,5149,1)
exten => 3,n,Set(TCSTATE=true)
exten => 3,n,Set(TCOVERRIDE=${IF($["${DB(TC/3):0:4}" = "true"]?true:false)})
exten => 3,n,Return()

;--== end of [timeconditions] ==--;


[timeconditions-toggles]
include => timeconditions-toggles-custom
exten => *271,1,Macro(user-callerid,)
exten => *271,n,Macro(toggle-tc,1)
exten => *271,n,Hangup
exten => *271,hint,Custom:TC1

exten => *273,1,Macro(user-callerid,)
exten => *273,n,Macro(toggle-tc,3)
exten => *273,n,Hangup
exten => *273,hint,Custom:TC3

exten => *27,1,Macro(user-callerid,)
exten => *27,n,Goto(timeconditions-toggles,${EXTEN}*${AMPUSER},1)

exten => *27*1,1,Macro(toggle-tc,1&3)
exten => *27*1,hint,Custom:TC1&Custom:TC3

exten => *27*2,1,Macro(toggle-tc,1&3)
exten => *27*2,hint,Custom:TC1&Custom:TC3

exten => *27*3,1,Macro(toggle-tc,1&3)
exten => *27*3,hint,Custom:TC1&Custom:TC3

exten => *27*100,1,Macro(toggle-tc,1&3)
exten => *27*100,hint,Custom:TC1&Custom:TC3

exten => *27*101,1,Macro(toggle-tc,1&3)
exten => *27*101,hint,Custom:TC1&Custom:TC3

exten => *27*102,1,Macro(toggle-tc,1&3)
exten => *27*102,hint,Custom:TC1&Custom:TC3

exten => *27*103,1,Macro(toggle-tc,1&3)
exten => *27*103,hint,Custom:TC1&Custom:TC3

exten => *27*104,1,Macro(toggle-tc,1&3)
exten => *27*104,hint,Custom:TC1&Custom:TC3

exten => *27*105,1,Macro(toggle-tc,1&3)
exten => *27*105,hint,Custom:TC1&Custom:TC3

exten => *27*106,1,Macro(toggle-tc,1&3)
exten => *27*106,hint,Custom:TC1&Custom:TC3

exten => *27*108,1,Macro(toggle-tc,1&3)
exten => *27*108,hint,Custom:TC1&Custom:TC3

exten => *27*109,1,Macro(toggle-tc,1&3)
exten => *27*109,hint,Custom:TC1&Custom:TC3

exten => *27*110,1,Macro(toggle-tc,1&3)
exten => *27*110,hint,Custom:TC1&Custom:TC3

exten => *27*113,1,Macro(toggle-tc,1&3)
exten => *27*113,hint,Custom:TC1&Custom:TC3

exten => *27*124,1,Macro(toggle-tc,1&3)
exten => *27*124,hint,Custom:TC1&Custom:TC3

exten => *27*197,1,Macro(toggle-tc,1&3)
exten => *27*197,hint,Custom:TC1&Custom:TC3

exten => *27*198,1,Macro(toggle-tc,1&3)
exten => *27*198,hint,Custom:TC1&Custom:TC3

exten => *27*199,1,Macro(toggle-tc,1&3)
exten => *27*199,hint,Custom:TC1&Custom:TC3

exten => *27*611,1,Macro(toggle-tc,1&3)
exten => *27*611,hint,Custom:TC1&Custom:TC3

exten => *27*700,1,Macro(toggle-tc,1&3)
exten => *27*700,hint,Custom:TC1&Custom:TC3

exten => *27*701,1,Macro(toggle-tc,1&3)
exten => *27*701,hint,Custom:TC1&Custom:TC3

exten => *27*702,1,Macro(toggle-tc,1&3)
exten => *27*702,hint,Custom:TC1&Custom:TC3

exten => *27*703,1,Macro(toggle-tc,1&3)
exten => *27*703,hint,Custom:TC1&Custom:TC3

exten => *27*704,1,Macro(toggle-tc,1&3)
exten => *27*704,hint,Custom:TC1&Custom:TC3

exten => *27*705,1,Macro(toggle-tc,1&3)
exten => *27*705,hint,Custom:TC1&Custom:TC3

exten => *27*706,1,Macro(toggle-tc,1&3)
exten => *27*706,hint,Custom:TC1&Custom:TC3

exten => *27*707,1,Macro(toggle-tc,1&3)
exten => *27*707,hint,Custom:TC1&Custom:TC3

exten => *27*709,1,Macro(toggle-tc,1&3)
exten => *27*709,hint,Custom:TC1&Custom:TC3

exten => *27*711,1,Macro(toggle-tc,1&3)
exten => *27*711,hint,Custom:TC1&Custom:TC3

exten => *27*712,1,Macro(toggle-tc,1&3)
exten => *27*712,hint,Custom:TC1&Custom:TC3

exten => *27*713,1,Macro(toggle-tc,1&3)
exten => *27*713,hint,Custom:TC1&Custom:TC3

exten => *27*714,1,Macro(toggle-tc,1&3)
exten => *27*714,hint,Custom:TC1&Custom:TC3

exten => *27*715,1,Macro(toggle-tc,1&3)
exten => *27*715,hint,Custom:TC1&Custom:TC3

exten => *27*1300,1,Macro(toggle-tc,1&3)
exten => *27*1300,hint,Custom:TC1&Custom:TC3

exten => *27*1301,1,Macro(toggle-tc,1&3)
exten => *27*1301,hint,Custom:TC1&Custom:TC3

exten => *27*1302,1,Macro(toggle-tc,1&3)
exten => *27*1302,hint,Custom:TC1&Custom:TC3

exten => *27*1303,1,Macro(toggle-tc,1&3)
exten => *27*1303,hint,Custom:TC1&Custom:TC3

exten => *27*1304,1,Macro(toggle-tc,1&3)
exten => *27*1304,hint,Custom:TC1&Custom:TC3

exten => *27*1305,1,Macro(toggle-tc,1&3)
exten => *27*1305,hint,Custom:TC1&Custom:TC3

exten => *27*1306,1,Macro(toggle-tc,1&3)
exten => *27*1306,hint,Custom:TC1&Custom:TC3

exten => *27*1307,1,Macro(toggle-tc,1&3)
exten => *27*1307,hint,Custom:TC1&Custom:TC3

exten => *27*1308,1,Macro(toggle-tc,1&3)
exten => *27*1308,hint,Custom:TC1&Custom:TC3

exten => *27*1309,1,Macro(toggle-tc,1&3)
exten => *27*1309,hint,Custom:TC1&Custom:TC3

exten => *27*1310,1,Macro(toggle-tc,1&3)
exten => *27*1310,hint,Custom:TC1&Custom:TC3

exten => *27*1311,1,Macro(toggle-tc,1&3)
exten => *27*1311,hint,Custom:TC1&Custom:TC3

exten => *27*1312,1,Macro(toggle-tc,1&3)
exten => *27*1312,hint,Custom:TC1&Custom:TC3

exten => *27*1313,1,Macro(toggle-tc,1&3)
exten => *27*1313,hint,Custom:TC1&Custom:TC3

exten => *27*1996,1,Macro(toggle-tc,1&3)
exten => *27*1996,hint,Custom:TC1&Custom:TC3

exten => *27*1997,1,Macro(toggle-tc,1&3)
exten => *27*1997,hint,Custom:TC1&Custom:TC3

exten => *27*1998,1,Macro(toggle-tc,1&3)
exten => *27*1998,hint,Custom:TC1&Custom:TC3

exten => *27*1999,1,Macro(toggle-tc,1&3)
exten => *27*1999,hint,Custom:TC1&Custom:TC3

exten => *27*2071,1,Macro(toggle-tc,1&3)
exten => *27*2071,hint,Custom:TC1&Custom:TC3

exten => *27*2072,1,Macro(toggle-tc,1&3)
exten => *27*2072,hint,Custom:TC1&Custom:TC3

exten => *27*2073,1,Macro(toggle-tc,1&3)
exten => *27*2073,hint,Custom:TC1&Custom:TC3

exten => *27*2074,1,Macro(toggle-tc,1&3)
exten => *27*2074,hint,Custom:TC1&Custom:TC3

exten => *27*2075,1,Macro(toggle-tc,1&3)
exten => *27*2075,hint,Custom:TC1&Custom:TC3

exten => *27*2605,1,Macro(toggle-tc,1&3)
exten => *27*2605,hint,Custom:TC1&Custom:TC3

exten => *27*2607,1,Macro(toggle-tc,1&3)
exten => *27*2607,hint,Custom:TC1&Custom:TC3

exten => *27*2608,1,Macro(toggle-tc,1&3)
exten => *27*2608,hint,Custom:TC1&Custom:TC3

exten => *27*8181,1,Macro(toggle-tc,1&3)
exten => *27*8181,hint,Custom:TC1&Custom:TC3

exten => *27*8182,1,Macro(toggle-tc,1&3)
exten => *27*8182,hint,Custom:TC1&Custom:TC3

exten => *27*8585,1,Macro(toggle-tc,1&3)
exten => *27*8585,hint,Custom:TC1&Custom:TC3

exten => *27*130199,1,Macro(toggle-tc,1&3)
exten => *27*130199,hint,Custom:TC1&Custom:TC3

exten => h,1,Hangup

;--== end of [timeconditions-toggles] ==--;


[macro-toggle-tc]
include => macro-toggle-tc-custom
exten => s,1,Set(INDEXES=${ARG1})
exten => s,n,Set(TCMAINT=RETURN)
exten => s,n,Set(TCSTATE=false)
exten => s,n,Set(TCINUSE=${DB(TC/${ARG1}/INUSESTATE)})
exten => s,n,Set(TCNOTINUSE=${DB(TC/${ARG1}/NOT_INUSESTATE)})
exten => s,n,Set(LOOPCNT=${FIELDQTY(INDEXES,&)})
exten => s,n,Set(ITER=1)
exten => s,n(begin1),Set(INDEX=${CUT(INDEXES,&,${ITER})})
exten => s,n,Gosub(timeconditions,${INDEX},1())
exten => s,n,Set(TCSTATE_${INDEX}=${TCSTATE})
exten => s,n,ExecIf($["${TCOVERRIDE}" = "true"]?Set(OVERRIDE=true))
exten => s,n(end1),Set(ITER=$[${ITER} + 1])
exten => s,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin1)
exten => s,n,Set(LOOPCNT=${FIELDQTY(INDEXES,&)})
exten => s,n,Set(ITER=1)
exten => s,n(begin2),Set(INDEX=${CUT(INDEXES,&,${ITER})})
exten => s,n,Set(DB(TC/${INDEX})=${IF($["${OVERRIDE}" = "true"]?:${IF($["${TCSTATE_${INDEX}}" == "true"]?false:true)})})
exten => s,n,Gosub(timeconditions,${INDEX},1())
exten => s,n(end2),Set(ITER=$[${ITER} + 1])
exten => s,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin2)
exten => s,n,GotoIf($["${STAT(e,/var/spool/asterisk/outgoing/schedtc.0.call)}"="1" | "${STAT(e,/var/spool/asterisk/outgoing/schedtc.1.call)}"="1"]?playback)
exten => s,n,System(/var/lib/asterisk/bin/schedtc.php 60 /var/spool/asterisk/outgoing 0)
exten => s,n(playback),Playback(beep&silence/1&time&${IF($["${TCSTATE}" = "true"]?de-activated:activated)})

;--== end of [macro-toggle-tc] ==--;


[vm-callme]
include => vm-callme-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n(repeat),Background(${MSG}&silence/2&vm-repeat&vm-starmain)
exten => s,n,WaitExten(15,)

exten => 5,1,Goto(s,repeat)

exten => #,1,Playback(vm-goodbye)
exten => #,n,Hangup

exten => *,1,Macro(get-vmcontext,${MBOX})
exten => *,n,VoiceMailMain(${MBOX}@${VMCONTEXT},s)

exten => i,1,Playback(pm-invalid-option)
exten => i,n,Goto(s,repeat)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup

exten => h,1,Hangup

;--== end of [vm-callme] ==--;


[app-dialvm]
include => app-dialvm-custom
exten => *98,1,Macro(user-callerid,)
exten => *98,n,Answer
exten => *98,n(start),Wait(1)
exten => *98,n,Noop(app-dialvm: Asking for mailbox)
exten => *98,n,Read(MAILBOX,vm-login,,,3,2)
exten => *98,n(check),Noop(app-dialvm: Got Mailbox ${MAILBOX})
exten => *98,n,Macro(get-vmcontext,${MAILBOX})
exten => *98,n,Set(VMBOXEXISTSSTATUS=${IF(${VM_INFO(${MAILBOX}@${VMCONTEXT},exists)}?SUCCESS:FAILED)})
exten => *98,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?good:bad)
exten => *98,n,Macro(hangupcall,)
exten => *98,n(good),Noop(app-dialvm: Good mailbox ${MAILBOX}@${VMCONTEXT})
exten => *98,n,VoiceMailMain(${MAILBOX}@${VMCONTEXT})
exten => *98,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => *98,n,Macro(hangupcall,)
exten => *98,n(bad),Noop(app-dialvm: BAD mailbox ${MAILBOX}@${VMCONTEXT})
exten => *98,n,Wait(1)
exten => *98,n,Noop(app-dialvm: Asking for password so people can't probe for existence of a mailbox)
exten => *98,n,Read(FAKEPW,vm-password,,,3,2)
exten => *98,n,Noop(app-dialvm: Asking for mailbox again)
exten => *98,n,Read(MAILBOX,vm-incorrect-mailbox,,,3,2)
exten => *98,n,Goto(check)
exten => *98,n,Macro(hangupcall,)
exten => *98,n(playret),Playback(beep&you-will-be-transfered-menu&silence/1)
exten => *98,n,Goto(${IVR_CONTEXT},return,1)

exten => _*98.,1,Answer
exten => _*98.,n,Wait(1)
exten => _*98.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _*98.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _*98.,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?${IVR_CONTEXT},return,1)
exten => _*98.,n,Macro(hangupcall,)

;--== end of [app-dialvm] ==--;


[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),Set(VMBOXEXISTSSTATUS=${IF(${VM_INFO(${AMPUSER}@${VMCONTEXT},exists)}?SUCCESS:FAILED)})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),GotoIf($["${DB(AMPUSER/${AMPUSER}/novmpw)}"!=""]?novmpw:vmpw)
exten => *97,n(novmpw),Noop(Verifying channel ${CHANNEL} is actually ${AMPUSER})
exten => *97,n,GotoIf($["${REGEX("^${DB(DEVICE/${AMPUSER}/dial)}-[0-9a-fx]+$" ${CHANNEL})}"!="1"]?vmpws)
exten => *97,n,VoiceMailMain(${AMPUSER}@${VMCONTEXT},s)
exten => *97,n,Goto(vmend)
exten => *97,n(vmpws),Noop(Channel ${CHANNEL} is NOT ${AMPUSER} forcing VM Password)
exten => *97,n(vmpw),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,Goto(vmend)
exten => *97,n(vmend),GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => *97,n,Macro(hangupcall,)
exten => *97,n(playret),Playback(beep&you-will-be-transfered-menu&silence/1)
exten => *97,n,Goto(${IVR_CONTEXT},return,1)

;--== end of [app-vmmain] ==--;


[from-did-direct-ivr]
include => from-did-direct-ivr-custom
exten => *2,1,Macro(blkvm-clr,)
exten => *2,n,Set(__NODEST=)
exten => *2,n,Macro(vm,2,DIRECTDIAL,${IVR_RETVM})
exten => *2,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *100,1,Macro(blkvm-clr,)
exten => *100,n,Set(__NODEST=)
exten => *100,n,Macro(vm,100,DIRECTDIAL,${IVR_RETVM})
exten => *100,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *101,1,Macro(blkvm-clr,)
exten => *101,n,Set(__NODEST=)
exten => *101,n,Macro(vm,101,DIRECTDIAL,${IVR_RETVM})
exten => *101,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *102,1,Macro(blkvm-clr,)
exten => *102,n,Set(__NODEST=)
exten => *102,n,Macro(vm,102,DIRECTDIAL,${IVR_RETVM})
exten => *102,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *103,1,Macro(blkvm-clr,)
exten => *103,n,Set(__NODEST=)
exten => *103,n,Macro(vm,103,DIRECTDIAL,${IVR_RETVM})
exten => *103,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *104,1,Macro(blkvm-clr,)
exten => *104,n,Set(__NODEST=)
exten => *104,n,Macro(vm,104,DIRECTDIAL,${IVR_RETVM})
exten => *104,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *105,1,Macro(blkvm-clr,)
exten => *105,n,Set(__NODEST=)
exten => *105,n,Macro(vm,105,DIRECTDIAL,${IVR_RETVM})
exten => *105,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *109,1,Macro(blkvm-clr,)
exten => *109,n,Set(__NODEST=)
exten => *109,n,Macro(vm,109,DIRECTDIAL,${IVR_RETVM})
exten => *109,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *113,1,Macro(blkvm-clr,)
exten => *113,n,Set(__NODEST=)
exten => *113,n,Macro(vm,113,DIRECTDIAL,${IVR_RETVM})
exten => *113,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *199,1,Macro(blkvm-clr,)
exten => *199,n,Set(__NODEST=)
exten => *199,n,Macro(vm,199,DIRECTDIAL,${IVR_RETVM})
exten => *199,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *700,1,Macro(blkvm-clr,)
exten => *700,n,Set(__NODEST=)
exten => *700,n,Macro(vm,700,DIRECTDIAL,${IVR_RETVM})
exten => *700,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *701,1,Macro(blkvm-clr,)
exten => *701,n,Set(__NODEST=)
exten => *701,n,Macro(vm,701,DIRECTDIAL,${IVR_RETVM})
exten => *701,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *702,1,Macro(blkvm-clr,)
exten => *702,n,Set(__NODEST=)
exten => *702,n,Macro(vm,702,DIRECTDIAL,${IVR_RETVM})
exten => *702,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *703,1,Macro(blkvm-clr,)
exten => *703,n,Set(__NODEST=)
exten => *703,n,Macro(vm,703,DIRECTDIAL,${IVR_RETVM})
exten => *703,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *704,1,Macro(blkvm-clr,)
exten => *704,n,Set(__NODEST=)
exten => *704,n,Macro(vm,704,DIRECTDIAL,${IVR_RETVM})
exten => *704,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *705,1,Macro(blkvm-clr,)
exten => *705,n,Set(__NODEST=)
exten => *705,n,Macro(vm,705,DIRECTDIAL,${IVR_RETVM})
exten => *705,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *706,1,Macro(blkvm-clr,)
exten => *706,n,Set(__NODEST=)
exten => *706,n,Macro(vm,706,DIRECTDIAL,${IVR_RETVM})
exten => *706,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *707,1,Macro(blkvm-clr,)
exten => *707,n,Set(__NODEST=)
exten => *707,n,Macro(vm,707,DIRECTDIAL,${IVR_RETVM})
exten => *707,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *709,1,Macro(blkvm-clr,)
exten => *709,n,Set(__NODEST=)
exten => *709,n,Macro(vm,709,DIRECTDIAL,${IVR_RETVM})
exten => *709,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *711,1,Macro(blkvm-clr,)
exten => *711,n,Set(__NODEST=)
exten => *711,n,Macro(vm,711,DIRECTDIAL,${IVR_RETVM})
exten => *711,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *713,1,Macro(blkvm-clr,)
exten => *713,n,Set(__NODEST=)
exten => *713,n,Macro(vm,713,DIRECTDIAL,${IVR_RETVM})
exten => *713,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1300,1,Macro(blkvm-clr,)
exten => *1300,n,Set(__NODEST=)
exten => *1300,n,Macro(vm,1300,DIRECTDIAL,${IVR_RETVM})
exten => *1300,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1301,1,Macro(blkvm-clr,)
exten => *1301,n,Set(__NODEST=)
exten => *1301,n,Macro(vm,1301,DIRECTDIAL,${IVR_RETVM})
exten => *1301,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1303,1,Macro(blkvm-clr,)
exten => *1303,n,Set(__NODEST=)
exten => *1303,n,Macro(vm,1303,DIRECTDIAL,${IVR_RETVM})
exten => *1303,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1304,1,Macro(blkvm-clr,)
exten => *1304,n,Set(__NODEST=)
exten => *1304,n,Macro(vm,1304,DIRECTDIAL,${IVR_RETVM})
exten => *1304,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1305,1,Macro(blkvm-clr,)
exten => *1305,n,Set(__NODEST=)
exten => *1305,n,Macro(vm,1305,DIRECTDIAL,${IVR_RETVM})
exten => *1305,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1306,1,Macro(blkvm-clr,)
exten => *1306,n,Set(__NODEST=)
exten => *1306,n,Macro(vm,1306,DIRECTDIAL,${IVR_RETVM})
exten => *1306,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1307,1,Macro(blkvm-clr,)
exten => *1307,n,Set(__NODEST=)
exten => *1307,n,Macro(vm,1307,DIRECTDIAL,${IVR_RETVM})
exten => *1307,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1309,1,Macro(blkvm-clr,)
exten => *1309,n,Set(__NODEST=)
exten => *1309,n,Macro(vm,1309,DIRECTDIAL,${IVR_RETVM})
exten => *1309,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1310,1,Macro(blkvm-clr,)
exten => *1310,n,Set(__NODEST=)
exten => *1310,n,Macro(vm,1310,DIRECTDIAL,${IVR_RETVM})
exten => *1310,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1313,1,Macro(blkvm-clr,)
exten => *1313,n,Set(__NODEST=)
exten => *1313,n,Macro(vm,1313,DIRECTDIAL,${IVR_RETVM})
exten => *1313,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1996,1,Macro(blkvm-clr,)
exten => *1996,n,Set(__NODEST=)
exten => *1996,n,Macro(vm,1996,DIRECTDIAL,${IVR_RETVM})
exten => *1996,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1997,1,Macro(blkvm-clr,)
exten => *1997,n,Set(__NODEST=)
exten => *1997,n,Macro(vm,1997,DIRECTDIAL,${IVR_RETVM})
exten => *1997,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1998,1,Macro(blkvm-clr,)
exten => *1998,n,Set(__NODEST=)
exten => *1998,n,Macro(vm,1998,DIRECTDIAL,${IVR_RETVM})
exten => *1998,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *1999,1,Macro(blkvm-clr,)
exten => *1999,n,Set(__NODEST=)
exten => *1999,n,Macro(vm,1999,DIRECTDIAL,${IVR_RETVM})
exten => *1999,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2071,1,Macro(blkvm-clr,)
exten => *2071,n,Set(__NODEST=)
exten => *2071,n,Macro(vm,2071,DIRECTDIAL,${IVR_RETVM})
exten => *2071,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2072,1,Macro(blkvm-clr,)
exten => *2072,n,Set(__NODEST=)
exten => *2072,n,Macro(vm,2072,DIRECTDIAL,${IVR_RETVM})
exten => *2072,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2073,1,Macro(blkvm-clr,)
exten => *2073,n,Set(__NODEST=)
exten => *2073,n,Macro(vm,2073,DIRECTDIAL,${IVR_RETVM})
exten => *2073,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2074,1,Macro(blkvm-clr,)
exten => *2074,n,Set(__NODEST=)
exten => *2074,n,Macro(vm,2074,DIRECTDIAL,${IVR_RETVM})
exten => *2074,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2605,1,Macro(blkvm-clr,)
exten => *2605,n,Set(__NODEST=)
exten => *2605,n,Macro(vm,2605,DIRECTDIAL,${IVR_RETVM})
exten => *2605,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2607,1,Macro(blkvm-clr,)
exten => *2607,n,Set(__NODEST=)
exten => *2607,n,Macro(vm,2607,DIRECTDIAL,${IVR_RETVM})
exten => *2607,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2608,1,Macro(blkvm-clr,)
exten => *2608,n,Set(__NODEST=)
exten => *2608,n,Macro(vm,2608,DIRECTDIAL,${IVR_RETVM})
exten => *2608,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *8181,1,Macro(blkvm-clr,)
exten => *8181,n,Set(__NODEST=)
exten => *8181,n,Macro(vm,8181,DIRECTDIAL,${IVR_RETVM})
exten => *8181,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => 1,1,Macro(blkvm-clr,)
exten => 1,n,Set(__NODEST=)
exten => 1,n,Goto(from-did-direct,1,1)

exten => 2,1,Macro(blkvm-clr,)
exten => 2,n,Set(__NODEST=)
exten => 2,n,Goto(from-did-direct,2,1)

exten => 3,1,Macro(blkvm-clr,)
exten => 3,n,Set(__NODEST=)
exten => 3,n,Goto(from-did-direct,3,1)

exten => 100,1,Macro(blkvm-clr,)
exten => 100,n,Set(__NODEST=)
exten => 100,n,Goto(from-did-direct,100,1)

exten => 101,1,Macro(blkvm-clr,)
exten => 101,n,Set(__NODEST=)
exten => 101,n,Goto(from-did-direct,101,1)

exten => 102,1,Macro(blkvm-clr,)
exten => 102,n,Set(__NODEST=)
exten => 102,n,Goto(from-did-direct,102,1)

exten => 103,1,Macro(blkvm-clr,)
exten => 103,n,Set(__NODEST=)
exten => 103,n,Goto(from-did-direct,103,1)

exten => 104,1,Macro(blkvm-clr,)
exten => 104,n,Set(__NODEST=)
exten => 104,n,Goto(from-did-direct,104,1)

exten => 105,1,Macro(blkvm-clr,)
exten => 105,n,Set(__NODEST=)
exten => 105,n,Goto(from-did-direct,105,1)

exten => 106,1,Macro(blkvm-clr,)
exten => 106,n,Set(__NODEST=)
exten => 106,n,Goto(from-did-direct,106,1)

exten => 108,1,Macro(blkvm-clr,)
exten => 108,n,Set(__NODEST=)
exten => 108,n,Goto(from-did-direct,108,1)

exten => 109,1,Macro(blkvm-clr,)
exten => 109,n,Set(__NODEST=)
exten => 109,n,Goto(from-did-direct,109,1)

exten => 110,1,Macro(blkvm-clr,)
exten => 110,n,Set(__NODEST=)
exten => 110,n,Goto(from-did-direct,110,1)

exten => 113,1,Macro(blkvm-clr,)
exten => 113,n,Set(__NODEST=)
exten => 113,n,Goto(from-did-direct,113,1)

exten => 124,1,Macro(blkvm-clr,)
exten => 124,n,Set(__NODEST=)
exten => 124,n,Goto(from-did-direct,124,1)

exten => 197,1,Macro(blkvm-clr,)
exten => 197,n,Set(__NODEST=)
exten => 197,n,Goto(from-did-direct,197,1)

exten => 198,1,Macro(blkvm-clr,)
exten => 198,n,Set(__NODEST=)
exten => 198,n,Goto(from-did-direct,198,1)

exten => 199,1,Macro(blkvm-clr,)
exten => 199,n,Set(__NODEST=)
exten => 199,n,Goto(from-did-direct,199,1)

exten => 611,1,Macro(blkvm-clr,)
exten => 611,n,Set(__NODEST=)
exten => 611,n,Goto(from-did-direct,611,1)

exten => 700,1,Macro(blkvm-clr,)
exten => 700,n,Set(__NODEST=)
exten => 700,n,Goto(from-did-direct,700,1)

exten => 701,1,Macro(blkvm-clr,)
exten => 701,n,Set(__NODEST=)
exten => 701,n,Goto(from-did-direct,701,1)

exten => 702,1,Macro(blkvm-clr,)
exten => 702,n,Set(__NODEST=)
exten => 702,n,Goto(from-did-direct,702,1)

exten => 703,1,Macro(blkvm-clr,)
exten => 703,n,Set(__NODEST=)
exten => 703,n,Goto(from-did-direct,703,1)

exten => 704,1,Macro(blkvm-clr,)
exten => 704,n,Set(__NODEST=)
exten => 704,n,Goto(from-did-direct,704,1)

exten => 705,1,Macro(blkvm-clr,)
exten => 705,n,Set(__NODEST=)
exten => 705,n,Goto(from-did-direct,705,1)

exten => 706,1,Macro(blkvm-clr,)
exten => 706,n,Set(__NODEST=)
exten => 706,n,Goto(from-did-direct,706,1)

exten => 707,1,Macro(blkvm-clr,)
exten => 707,n,Set(__NODEST=)
exten => 707,n,Goto(from-did-direct,707,1)

exten => 709,1,Macro(blkvm-clr,)
exten => 709,n,Set(__NODEST=)
exten => 709,n,Goto(from-did-direct,709,1)

exten => 711,1,Macro(blkvm-clr,)
exten => 711,n,Set(__NODEST=)
exten => 711,n,Goto(from-did-direct,711,1)

exten => 712,1,Macro(blkvm-clr,)
exten => 712,n,Set(__NODEST=)
exten => 712,n,Goto(from-did-direct,712,1)

exten => 713,1,Macro(blkvm-clr,)
exten => 713,n,Set(__NODEST=)
exten => 713,n,Goto(from-did-direct,713,1)

exten => 714,1,Macro(blkvm-clr,)
exten => 714,n,Set(__NODEST=)
exten => 714,n,Goto(from-did-direct,714,1)

exten => 715,1,Macro(blkvm-clr,)
exten => 715,n,Set(__NODEST=)
exten => 715,n,Goto(from-did-direct,715,1)

exten => 1300,1,Macro(blkvm-clr,)
exten => 1300,n,Set(__NODEST=)
exten => 1300,n,Goto(from-did-direct,1300,1)

exten => 1301,1,Macro(blkvm-clr,)
exten => 1301,n,Set(__NODEST=)
exten => 1301,n,Goto(from-did-direct,1301,1)

exten => 1302,1,Macro(blkvm-clr,)
exten => 1302,n,Set(__NODEST=)
exten => 1302,n,Goto(from-did-direct,1302,1)

exten => 1303,1,Macro(blkvm-clr,)
exten => 1303,n,Set(__NODEST=)
exten => 1303,n,Goto(from-did-direct,1303,1)

exten => 1304,1,Macro(blkvm-clr,)
exten => 1304,n,Set(__NODEST=)
exten => 1304,n,Goto(from-did-direct,1304,1)

exten => 1305,1,Macro(blkvm-clr,)
exten => 1305,n,Set(__NODEST=)
exten => 1305,n,Goto(from-did-direct,1305,1)

exten => 1306,1,Macro(blkvm-clr,)
exten => 1306,n,Set(__NODEST=)
exten => 1306,n,Goto(from-did-direct,1306,1)

exten => 1307,1,Macro(blkvm-clr,)
exten => 1307,n,Set(__NODEST=)
exten => 1307,n,Goto(from-did-direct,1307,1)

exten => 1308,1,Macro(blkvm-clr,)
exten => 1308,n,Set(__NODEST=)
exten => 1308,n,Goto(from-did-direct,1308,1)

exten => 1309,1,Macro(blkvm-clr,)
exten => 1309,n,Set(__NODEST=)
exten => 1309,n,Goto(from-did-direct,1309,1)

exten => 1310,1,Macro(blkvm-clr,)
exten => 1310,n,Set(__NODEST=)
exten => 1310,n,Goto(from-did-direct,1310,1)

exten => 1311,1,Macro(blkvm-clr,)
exten => 1311,n,Set(__NODEST=)
exten => 1311,n,Goto(from-did-direct,1311,1)

exten => 1312,1,Macro(blkvm-clr,)
exten => 1312,n,Set(__NODEST=)
exten => 1312,n,Goto(from-did-direct,1312,1)

exten => 1313,1,Macro(blkvm-clr,)
exten => 1313,n,Set(__NODEST=)
exten => 1313,n,Goto(from-did-direct,1313,1)

exten => 1996,1,Macro(blkvm-clr,)
exten => 1996,n,Set(__NODEST=)
exten => 1996,n,Goto(from-did-direct,1996,1)

exten => 1997,1,Macro(blkvm-clr,)
exten => 1997,n,Set(__NODEST=)
exten => 1997,n,Goto(from-did-direct,1997,1)

exten => 1998,1,Macro(blkvm-clr,)
exten => 1998,n,Set(__NODEST=)
exten => 1998,n,Goto(from-did-direct,1998,1)

exten => 1999,1,Macro(blkvm-clr,)
exten => 1999,n,Set(__NODEST=)
exten => 1999,n,Goto(from-did-direct,1999,1)

exten => 2071,1,Macro(blkvm-clr,)
exten => 2071,n,Set(__NODEST=)
exten => 2071,n,Goto(from-did-direct,2071,1)

exten => 2072,1,Macro(blkvm-clr,)
exten => 2072,n,Set(__NODEST=)
exten => 2072,n,Goto(from-did-direct,2072,1)

exten => 2073,1,Macro(blkvm-clr,)
exten => 2073,n,Set(__NODEST=)
exten => 2073,n,Goto(from-did-direct,2073,1)

exten => 2074,1,Macro(blkvm-clr,)
exten => 2074,n,Set(__NODEST=)
exten => 2074,n,Goto(from-did-direct,2074,1)

exten => 2075,1,Macro(blkvm-clr,)
exten => 2075,n,Set(__NODEST=)
exten => 2075,n,Goto(from-did-direct,2075,1)

exten => 2605,1,Macro(blkvm-clr,)
exten => 2605,n,Set(__NODEST=)
exten => 2605,n,Goto(from-did-direct,2605,1)

exten => 2607,1,Macro(blkvm-clr,)
exten => 2607,n,Set(__NODEST=)
exten => 2607,n,Goto(from-did-direct,2607,1)

exten => 2608,1,Macro(blkvm-clr,)
exten => 2608,n,Set(__NODEST=)
exten => 2608,n,Goto(from-did-direct,2608,1)

exten => 8181,1,Macro(blkvm-clr,)
exten => 8181,n,Set(__NODEST=)
exten => 8181,n,Goto(from-did-direct,8181,1)

exten => 8182,1,Macro(blkvm-clr,)
exten => 8182,n,Set(__NODEST=)
exten => 8182,n,Goto(from-did-direct,8182,1)

exten => 8585,1,Macro(blkvm-clr,)
exten => 8585,n,Set(__NODEST=)
exten => 8585,n,Goto(from-did-direct,8585,1)

exten => 130199,1,Macro(blkvm-clr,)
exten => 130199,n,Set(__NODEST=)
exten => 130199,n,Goto(from-did-direct,130199,1)

;--== end of [from-did-direct-ivr] ==--;


[app-userlogonoff]
include => app-userlogonoff-custom
exten => *12,1,Macro(user-logoff,)
exten => *12,n(hook_off),Hangup

exten => *11,1,Macro(user-logon,)
exten => *11,n(hook_on_1),Hangup

exten => _*11.,1,Macro(user-logon,${EXTEN:3},)
exten => _*11.,n(hook_on_2),Hangup

;--== end of [app-userlogonoff] ==--;


[ext-local-confirm]
include => ext-local-confirm-custom
exten => _LC-.,1,ExecIf($["${ALERT_INFO}"!=""]?SIPAddHeader(Alert-Info: ${ALERT_INFO}))
exten => _LC-.,n,Dial(${DB(DEVICE/${EXTEN:3}/dial)},${RT},${DIAL_OPTIONS}M(auto-confirm^${RG_IDX}))

;--== end of [ext-local-confirm] ==--;


[findmefollow-ringallv2]
include => findmefollow-ringallv2-custom
exten => _FMPR-.,1,NoCDR()
exten => _FMPR-.,n,Set(RingGroupMethod=)
exten => _FMPR-.,n,Set(USE_CONFIRMATION=)
exten => _FMPR-.,n,Set(RINGGROUP_INDEX=)
exten => _FMPR-.,n,Macro(simple-dial,${EXTEN:5},${FMREALPRERING})
exten => _FMPR-.,n,ExecIf($["${DIALSTATUS}" = "BUSY"]?Set(SHARED(FM_DND,${FMUNIQUE})=DND))
exten => _FMPR-.,n,Hangup

exten => _FMGL-.,1,NoCDR()
exten => _FMGL-.,n,Set(ENDLOOP=$[${EPOCH} + ${FMPRERING} + 2])
exten => _FMGL-.,n(start),GotoIf($["${SHARED(FM_DND,${FMUNIQUE})}" = "DND"]?dodnd)
exten => _FMGL-.,n,Wait(1)
exten => _FMGL-.,n,GotoIf($[${EPOCH} < ${ENDLOOP}]?start)
exten => _FMGL-.,n,Set(SHARED(FM_DND,${FMUNIQUE})=)
exten => _FMGL-.,n(dodial),Macro(dial,${FMGRPTIME},${DIAL_OPTIONS},${EXTEN:5})
exten => _FMGL-.,n,Hangup
exten => _FMGL-.,n+10(dodnd),Set(SHARED(FM_DND,${FMUNIQUE})=)
exten => _FMGL-.,n,GotoIf($["${FMPRIME}" = "FALSE"]?dodial)
exten => _FMGL-.,n,Hangup

;--== end of [findmefollow-ringallv2] ==--;


[app-pickup]
include => app-pickup-custom
exten => _**.,1,Macro(user-callerid,)
exten => _**.,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => _**.,n,Pickup(${EXTEN:2}&${EXTEN:2}@PICKUPMARK)
exten => _**.,n,Hangup

exten => _***80.,1,Macro(user-callerid,)
exten => _***80.,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => _***80.,n,Pickup(${EXTEN:5}&${EXTEN:5}@PICKUPMARK)
exten => _***80.,n,Hangup

exten => **703,1,Macro(user-callerid,)
exten => **703,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **703,n,Pickup(703&703@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => **703,n,Hangup

exten => ***80703,1,Macro(user-callerid,)
exten => ***80703,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80703,n,Pickup(703&703@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => ***80703,n,Hangup

exten => **707,1,Macro(user-callerid,)
exten => **707,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **707,n,Pickup(707&707@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => **707,n,Hangup

exten => ***80707,1,Macro(user-callerid,)
exten => ***80707,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80707,n,Pickup(707&707@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => ***80707,n,Hangup

exten => **711,1,Macro(user-callerid,)
exten => **711,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **711,n,Pickup(711&711@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => **711,n,Hangup

exten => ***80711,1,Macro(user-callerid,)
exten => ***80711,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80711,n,Pickup(711&711@PICKUPMARK&601@from-internal&601@from-internal-xfer&601@ext-group)
exten => ***80711,n,Hangup

exten => **100,1,Macro(user-callerid,)
exten => **100,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **100,n,Pickup(100&100@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => **100,n,Hangup

exten => ***80100,1,Macro(user-callerid,)
exten => ***80100,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80100,n,Pickup(100&100@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => ***80100,n,Hangup

exten => **101,1,Macro(user-callerid,)
exten => **101,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **101,n,Pickup(101&101@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => **101,n,Hangup

exten => ***80101,1,Macro(user-callerid,)
exten => ***80101,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80101,n,Pickup(101&101@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => ***80101,n,Hangup

exten => **105,1,Macro(user-callerid,)
exten => **105,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **105,n,Pickup(105&105@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => **105,n,Hangup

exten => ***80105,1,Macro(user-callerid,)
exten => ***80105,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80105,n,Pickup(105&105@PICKUPMARK&1400@from-internal&1400@from-internal-xfer&1400@ext-group)
exten => ***80105,n,Hangup

exten => **1301,1,Macro(user-callerid,)
exten => **1301,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1301,n,Pickup(1301&1301@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1301,n,Hangup

exten => ***801301,1,Macro(user-callerid,)
exten => ***801301,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801301,n,Pickup(1301&1301@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801301,n,Hangup

exten => **1302,1,Macro(user-callerid,)
exten => **1302,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1302,n,Pickup(1302&1302@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1302,n,Hangup

exten => ***801302,1,Macro(user-callerid,)
exten => ***801302,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801302,n,Pickup(1302&1302@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801302,n,Hangup

exten => **1304,1,Macro(user-callerid,)
exten => **1304,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1304,n,Pickup(1304&1304@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1304,n,Hangup

exten => ***801304,1,Macro(user-callerid,)
exten => ***801304,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801304,n,Pickup(1304&1304@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801304,n,Hangup

exten => **1305,1,Macro(user-callerid,)
exten => **1305,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1305,n,Pickup(1305&1305@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1305,n,Hangup

exten => ***801305,1,Macro(user-callerid,)
exten => ***801305,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801305,n,Pickup(1305&1305@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801305,n,Hangup

exten => **1307,1,Macro(user-callerid,)
exten => **1307,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1307,n,Pickup(1307&1307@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1307,n,Hangup

exten => ***801307,1,Macro(user-callerid,)
exten => ***801307,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801307,n,Pickup(1307&1307@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801307,n,Hangup

exten => **1308,1,Macro(user-callerid,)
exten => **1308,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1308,n,Pickup(1308&1308@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1308,n,Hangup

exten => ***801308,1,Macro(user-callerid,)
exten => ***801308,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801308,n,Pickup(1308&1308@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801308,n,Hangup

exten => **1309,1,Macro(user-callerid,)
exten => **1309,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1309,n,Pickup(1309&1309@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1309,n,Hangup

exten => ***801309,1,Macro(user-callerid,)
exten => ***801309,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801309,n,Pickup(1309&1309@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801309,n,Hangup

exten => **1310,1,Macro(user-callerid,)
exten => **1310,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1310,n,Pickup(1310&1310@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1310,n,Hangup

exten => ***801310,1,Macro(user-callerid,)
exten => ***801310,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801310,n,Pickup(1310&1310@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801310,n,Hangup

exten => **1311,1,Macro(user-callerid,)
exten => **1311,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **1311,n,Pickup(1311&1311@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **1311,n,Hangup

exten => ***801311,1,Macro(user-callerid,)
exten => ***801311,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***801311,n,Pickup(1311&1311@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***801311,n,Hangup

exten => **130199,1,Macro(user-callerid,)
exten => **130199,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => **130199,n,Pickup(130199&130199@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => **130199,n,Hangup

exten => ***80130199,1,Macro(user-callerid,)
exten => ***80130199,n,Set(PICKUP_EXTEN=${AMPUSER})
exten => ***80130199,n,Pickup(130199&130199@PICKUPMARK&1401@from-internal&1401@from-internal-xfer&1401@ext-group&1402@from-internal&1402@from-internal-xfer&1402@ext-group&1403@from-internal&1403@from-internal-xfer&1403@ext-group)
exten => ***80130199,n,Hangup

;--== end of [app-pickup] ==--;


[app-chanspy]
include => app-chanspy-custom
exten => 555,1,Macro(user-callerid,)
exten => 555,n,Answer
exten => 555,n,Wait(1)
exten => 555,n,ChanSpy()
exten => 555,n,Hangup

;--== end of [app-chanspy] ==--;


[ext-test]
include => ext-test-custom
exten => 7777,1,Macro(user-callerid,)
exten => 7777,n,Goto(from-pstn,${EXTEN},1)

exten => h,1,Macro(hangupcall,)

;--== end of [ext-test] ==--;


[ext-did]
include => ext-did-custom
include => ext-did-0001
include => ext-did-0002
exten => foo,1,Noop(bar)

;--== end of [ext-did] ==--;


[ext-did-0002]
include => ext-did-0002-custom
exten => 2062422011,1,Set(__FROM_DID=${EXTEN})
exten => 2062422011,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062422011,n,Gosub(app-blacklist-check,s,1())
exten => 2062422011,n,Set(CDR(did)=${FROM_DID})
exten => 2062422011,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062422011,n,Set(CHANNEL(musicclass)=default)
exten => 2062422011,n,Set(__MOHCLASS=default)
exten => 2062422011,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062422011,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062422011,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062422011,n(dest-ext),Goto(timeconditions,3,1)

exten => 2062992070,1,Set(__FROM_DID=${EXTEN})
exten => 2062992070,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992070,n,Gosub(app-blacklist-check,s,1())
exten => 2062992070,n,Set(CDR(did)=${FROM_DID})
exten => 2062992070,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992070,n,Set(CHANNEL(musicclass)=default)
exten => 2062992070,n,Set(__MOHCLASS=default)
exten => 2062992070,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992070,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992070,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992070,n(dest-ext),Goto(ivr-4,s,1)

exten => 2062992071,1,Set(__FROM_DID=${EXTEN})
exten => 2062992071,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992071,n,Gosub(app-blacklist-check,s,1())
exten => 2062992071,n,Set(CDR(did)=${FROM_DID})
exten => 2062992071,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992071,n,Set(CHANNEL(musicclass)=default)
exten => 2062992071,n,Set(__MOHCLASS=default)
exten => 2062992071,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992071,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992071,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992071,n(dest-ext),Goto(from-did-direct,2071,1)

exten => 2062992072,1,Set(__FROM_DID=${EXTEN})
exten => 2062992072,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992072,n,Gosub(app-blacklist-check,s,1())
exten => 2062992072,n,Set(CDR(did)=${FROM_DID})
exten => 2062992072,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992072,n,Set(CHANNEL(musicclass)=default)
exten => 2062992072,n,Set(__MOHCLASS=default)
exten => 2062992072,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992072,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992072,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992072,n(dest-ext),Goto(from-did-direct,2072,1)

exten => 2062992073,1,Set(__FROM_DID=${EXTEN})
exten => 2062992073,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992073,n,Gosub(app-blacklist-check,s,1())
exten => 2062992073,n,Set(CDR(did)=${FROM_DID})
exten => 2062992073,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992073,n,Set(CHANNEL(musicclass)=default)
exten => 2062992073,n,Set(__MOHCLASS=default)
exten => 2062992073,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992073,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992073,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992073,n(dest-ext),Goto(from-did-direct,2073,1)

exten => 2062992074,1,Set(__FROM_DID=${EXTEN})
exten => 2062992074,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992074,n,Gosub(app-blacklist-check,s,1())
exten => 2062992074,n,Set(CDR(did)=${FROM_DID})
exten => 2062992074,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992074,n,Set(CHANNEL(musicclass)=default)
exten => 2062992074,n,Set(__MOHCLASS=default)
exten => 2062992074,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992074,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992074,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992074,n(dest-ext),Goto(from-did-direct,2074,1)

exten => 2062992075,1,Set(__FROM_DID=${EXTEN})
exten => 2062992075,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2062992075,n,Gosub(app-blacklist-check,s,1())
exten => 2062992075,n,Set(CDR(did)=${FROM_DID})
exten => 2062992075,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2062992075,n,Set(CHANNEL(musicclass)=default)
exten => 2062992075,n,Set(__MOHCLASS=default)
exten => 2062992075,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2062992075,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2062992075,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2062992075,n(dest-ext),Goto(from-did-direct,2075,1)

exten => 2063952600,1,Set(__FROM_DID=${EXTEN})
exten => 2063952600,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2063952600,n,Gosub(app-blacklist-check,s,1())
exten => 2063952600,n,Set(CDR(did)=${FROM_DID})
exten => 2063952600,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2063952600,n,Set(CHANNEL(musicclass)=default)
exten => 2063952600,n,Set(__MOHCLASS=default)
exten => 2063952600,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2063952600,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2063952600,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2063952600,n,Set(FAX_DEST=from-did-direct^712^1)
exten => 2063952600,n,Set(FAXOPT(faxdetect)=yes)
exten => 2063952600,n,Answer
exten => 2063952600,n,Wait(5)
exten => 2063952600,n(dest-ext),Goto(ivr-1,s,1)

exten => 2066016062,1,Set(__FROM_DID=${EXTEN})
exten => 2066016062,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2066016062,n,Gosub(app-blacklist-check,s,1())
exten => 2066016062,n,Set(CDR(did)=${FROM_DID})
exten => 2066016062,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2066016062,n,Set(CHANNEL(musicclass)=WSC)
exten => 2066016062,n,Set(__MOHCLASS=WSC)
exten => 2066016062,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2066016062,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2066016062,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2066016062,n(dest-ext),Goto(timeconditions,1,1)

exten => 2066022605,1,Set(__FROM_DID=${EXTEN})
exten => 2066022605,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2066022605,n,Gosub(app-blacklist-check,s,1())
exten => 2066022605,n,Set(CDR(did)=${FROM_DID})
exten => 2066022605,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2066022605,n,Set(CHANNEL(musicclass)=default)
exten => 2066022605,n,Set(__MOHCLASS=default)
exten => 2066022605,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2066022605,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2066022605,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2066022605,n(dest-ext),Goto(from-did-direct,2605,1)

exten => 2066022607,1,Set(__FROM_DID=${EXTEN})
exten => 2066022607,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2066022607,n,Gosub(app-blacklist-check,s,1())
exten => 2066022607,n,Set(CDR(did)=${FROM_DID})
exten => 2066022607,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2066022607,n,Set(CHANNEL(musicclass)=default)
exten => 2066022607,n,Set(__MOHCLASS=default)
exten => 2066022607,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2066022607,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2066022607,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2066022607,n(dest-ext),Goto(from-did-direct,2607,1)

exten => 2066022608,1,Set(__FROM_DID=${EXTEN})
exten => 2066022608,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2066022608,n,Gosub(app-blacklist-check,s,1())
exten => 2066022608,n,Set(CDR(did)=${FROM_DID})
exten => 2066022608,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2066022608,n,Set(CHANNEL(musicclass)=default)
exten => 2066022608,n,Set(__MOHCLASS=default)
exten => 2066022608,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2066022608,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2066022608,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2066022608,n(dest-ext),Goto(from-did-direct,2608,1)

exten => 2069328795,1,Set(__FROM_DID=${EXTEN})
exten => 2069328795,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2069328795,n,Gosub(app-blacklist-check,s,1())
exten => 2069328795,n,Set(CDR(did)=${FROM_DID})
exten => 2069328795,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2069328795,n,Set(CHANNEL(musicclass)=WSC)
exten => 2069328795,n,Set(__MOHCLASS=WSC)
exten => 2069328795,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2069328795,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2069328795,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2069328795,n(dest-ext),Goto(timeconditions,1,1)

exten => 2069341759,1,Set(__FROM_DID=${EXTEN})
exten => 2069341759,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2069341759,n,Gosub(app-blacklist-check,s,1())
exten => 2069341759,n,Set(CDR(did)=${FROM_DID})
exten => 2069341759,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2069341759,n,Set(CHANNEL(musicclass)=default)
exten => 2069341759,n,Set(__MOHCLASS=default)
exten => 2069341759,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2069341759,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2069341759,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2069341759,n(dest-ext),Goto(ivr-6,s,1)

exten => 2069375675,1,Set(__FROM_DID=${EXTEN})
exten => 2069375675,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2069375675,n,Gosub(app-blacklist-check,s,1())
exten => 2069375675,n,Set(CDR(did)=${FROM_DID})
exten => 2069375675,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2069375675,n,Set(CHANNEL(musicclass)=WSC)
exten => 2069375675,n,Set(__MOHCLASS=WSC)
exten => 2069375675,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2069375675,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2069375675,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2069375675,n(dest-ext),Goto(timeconditions,1,1)

exten => 2069376800,1,Set(__FROM_DID=${EXTEN})
exten => 2069376800,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2069376800,n,Gosub(app-blacklist-check,s,1())
exten => 2069376800,n,Set(CDR(did)=${FROM_DID})
exten => 2069376800,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2069376800,n,Set(CHANNEL(musicclass)=WSC)
exten => 2069376800,n,Set(__MOHCLASS=WSC)
exten => 2069376800,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2069376800,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2069376800,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2069376800,n(dest-ext),Goto(timeconditions,1,1)

exten => 2069376830,1,Set(__FROM_DID=${EXTEN})
exten => 2069376830,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 2069376830,n,Gosub(app-blacklist-check,s,1())
exten => 2069376830,n,Set(CDR(did)=${FROM_DID})
exten => 2069376830,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2069376830,n,Set(CHANNEL(musicclass)=WSC)
exten => 2069376830,n,Set(__MOHCLASS=WSC)
exten => 2069376830,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2069376830,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2069376830,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2069376830,n(dest-ext),Goto(timeconditions,1,1)

exten => 2163719956,1,Set(__FROM_DID=${EXTEN})
exten => 2163719956,n,Gosub(app-blacklist-check,s,1())
exten => 2163719956,n,Set(CDR(did)=${FROM_DID})
exten => 2163719956,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 2163719956,n,Set(CHANNEL(musicclass)=default)
exten => 2163719956,n,Set(__MOHCLASS=default)
exten => 2163719956,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 2163719956,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 2163719956,n,Set(CALLERPRES()=allowed_not_screened)
exten => 2163719956,n(dest-ext),Goto(from-did-direct,1999,1)

exten => 3107500700,1,Set(__FROM_DID=${EXTEN})
exten => 3107500700,n,Gosub(app-blacklist-check,s,1())
exten => 3107500700,n,Set(CDR(did)=${FROM_DID})
exten => 3107500700,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 3107500700,n,Set(CHANNEL(musicclass)=default)
exten => 3107500700,n,Set(__MOHCLASS=default)
exten => 3107500700,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 3107500700,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 3107500700,n,Set(CALLERPRES()=allowed_not_screened)
exten => 3107500700,n(dest-ext),Goto(ivr-1,s,1)

exten => 4252891896,1,Set(__FROM_DID=${EXTEN})
exten => 4252891896,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252891896,n,Gosub(app-blacklist-check,s,1())
exten => 4252891896,n,Set(CDR(did)=${FROM_DID})
exten => 4252891896,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252891896,n,Set(CHANNEL(musicclass)=default)
exten => 4252891896,n,Set(__MOHCLASS=default)
exten => 4252891896,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252891896,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252891896,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252891896,n(dest-ext),Goto(from-did-direct,110,1)

exten => 4252894220,1,Set(__FROM_DID=${EXTEN})
exten => 4252894220,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894220,n,Gosub(app-blacklist-check,s,1())
exten => 4252894220,n,Set(CDR(did)=${FROM_DID})
exten => 4252894220,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894220,n,Set(CHANNEL(musicclass)=default)
exten => 4252894220,n,Set(__MOHCLASS=default)
exten => 4252894220,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894220,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894220,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894220,n(dest-ext),Goto(from-did-direct,102,1)

exten => 4252894221,1,Set(__FROM_DID=${EXTEN})
exten => 4252894221,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894221,n,Gosub(app-blacklist-check,s,1())
exten => 4252894221,n,Set(CDR(did)=${FROM_DID})
exten => 4252894221,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894221,n,Set(CHANNEL(musicclass)=default)
exten => 4252894221,n,Set(__MOHCLASS=default)
exten => 4252894221,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894221,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894221,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894221,n(dest-ext),Goto(from-did-direct,105,1)

exten => 4252894222,1,Set(__FROM_DID=${EXTEN})
exten => 4252894222,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894222,n,Gosub(app-blacklist-check,s,1())
exten => 4252894222,n,Set(CDR(did)=${FROM_DID})
exten => 4252894222,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894222,n,Set(CHANNEL(musicclass)=default)
exten => 4252894222,n,Set(__MOHCLASS=default)
exten => 4252894222,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894222,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894222,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894222,n(dest-ext),Goto(ext-group,1400,1)

exten => 4252894223,1,Set(__FROM_DID=${EXTEN})
exten => 4252894223,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894223,n,Gosub(app-blacklist-check,s,1())
exten => 4252894223,n,Set(CDR(did)=${FROM_DID})
exten => 4252894223,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894223,n,Set(CHANNEL(musicclass)=default)
exten => 4252894223,n,Set(__MOHCLASS=default)
exten => 4252894223,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894223,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894223,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894223,n(dest-ext),Goto(from-did-direct,101,1)

exten => 4252894224,1,Set(__FROM_DID=${EXTEN})
exten => 4252894224,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894224,n,Gosub(app-blacklist-check,s,1())
exten => 4252894224,n,Set(CDR(did)=${FROM_DID})
exten => 4252894224,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894224,n,Set(CHANNEL(musicclass)=default)
exten => 4252894224,n,Set(__MOHCLASS=default)
exten => 4252894224,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894224,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894224,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894224,n(dest-ext),Goto(from-did-direct,103,1)

exten => 4252894225,1,Set(__FROM_DID=${EXTEN})
exten => 4252894225,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894225,n,Gosub(app-blacklist-check,s,1())
exten => 4252894225,n,Set(CDR(did)=${FROM_DID})
exten => 4252894225,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894225,n,Set(CHANNEL(musicclass)=default)
exten => 4252894225,n,Set(__MOHCLASS=default)
exten => 4252894225,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894225,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894225,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894225,n(dest-ext),Goto(from-did-direct,104,1)

exten => 4252894226,1,Set(__FROM_DID=${EXTEN})
exten => 4252894226,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 4252894226,n,Gosub(app-blacklist-check,s,1())
exten => 4252894226,n,Set(CDR(did)=${FROM_DID})
exten => 4252894226,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4252894226,n,Set(CHANNEL(musicclass)=default)
exten => 4252894226,n,Set(__MOHCLASS=default)
exten => 4252894226,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 4252894226,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4252894226,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4252894226,n(dest-ext),Goto(from-did-direct,100,1)

exten => 8773586199,1,Set(__FROM_DID=${EXTEN})
exten => 8773586199,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 8773586199,n,Gosub(app-blacklist-check,s,1())
exten => 8773586199,n,Set(CDR(did)=${FROM_DID})
exten => 8773586199,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 8773586199,n,Set(CHANNEL(musicclass)=default)
exten => 8773586199,n,Set(__MOHCLASS=default)
exten => 8773586199,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 8773586199,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 8773586199,n,Set(CALLERPRES()=allowed_not_screened)
exten => 8773586199,n(dest-ext),Goto(ext-group,1400,1)

exten => 9492025824,1,Set(__FROM_DID=${EXTEN})
exten => 9492025824,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 9492025824,n,Gosub(app-blacklist-check,s,1())
exten => 9492025824,n,Set(CDR(did)=${FROM_DID})
exten => 9492025824,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 9492025824,n,Set(CHANNEL(musicclass)=default)
exten => 9492025824,n,Set(__MOHCLASS=default)
exten => 9492025824,n,GotoIf($["${__REVERSAL_REJECT}"="TRUE" & "${CHANNEL(reversecharge)}"="1" ]?macro-hangupcall)
exten => 9492025824,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 9492025824,n,Set(CALLERPRES()=allowed_not_screened)
exten => 9492025824,n(dest-ext),Goto(ivr-8,s,1)

exten => 4252894227,1,Gosub(app-blacklist-check,s,1())

exten => 4252894228,1,Gosub(app-blacklist-check,s,1())

exten => 4252894229,1,Gosub(app-blacklist-check,s,1())

exten => 4252894230,1,Gosub(app-blacklist-check,s,1())

exten => 4252894231,1,Gosub(app-blacklist-check,s,1())

exten => 4252894232,1,Gosub(app-blacklist-check,s,1())

exten => 4252894233,1,Gosub(app-blacklist-check,s,1())

exten => 4252894234,1,Gosub(app-blacklist-check,s,1())

exten => 4252894235,1,Gosub(app-blacklist-check,s,1())

exten => 4252894236,1,Gosub(app-blacklist-check,s,1())

exten => 4252894237,1,Gosub(app-blacklist-check,s,1())

exten => 4252894238,1,Gosub(app-blacklist-check,s,1())

exten => 4252894239,1,Gosub(app-blacklist-check,s,1())

exten => 4252894240,1,Gosub(app-blacklist-check,s,1())

exten => 4252894241,1,Gosub(app-blacklist-check,s,1())

exten => 4252894242,1,Gosub(app-blacklist-check,s,1())

exten => 4252894243,1,Gosub(app-blacklist-check,s,1())

exten => 4252894244,1,Gosub(app-blacklist-check,s,1())

exten => 4252894245,1,Gosub(app-blacklist-check,s,1())

exten => 4252894246,1,Gosub(app-blacklist-check,s,1())

exten => 4252894247,1,Gosub(app-blacklist-check,s,1())

exten => 4252894248,1,Gosub(app-blacklist-check,s,1())

exten => 4252894249,1,Gosub(app-blacklist-check,s,1())

exten => 4252894250,1,Gosub(app-blacklist-check,s,1())

;--== end of [ext-did-0002] ==--;


[ext-did-catchall]
include => ext-did-catchall-custom
exten => s,1,Noop(No DID or CID Match)
exten => s,n(a2),Answer
exten => s,n,Log(WARNING,Friendly Scanner from ${CUT(CUT(SIP_HEADER(Via), ,2),:,1)})
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,SayAlpha(${FROM_DID})
exten => s,n,Hangup

exten => _.,1,Set(__FROM_DID=${EXTEN})
exten => _.,n,Noop(Received an unknown call with DID set to ${EXTEN})
exten => _.,n,Goto(s,a2)

exten => h,1,Hangup

;--== end of [ext-did-catchall] ==--;


[from-trunk-sip-persephone]
include => from-trunk-sip-persephone-custom
exten => _.,1,Set(GROUP()=OUT_1)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-persephone] ==--;


[ext-trunk]
include => ext-trunk-custom
exten => 1,1,Set(TDIAL_STRING=SIP/persephone)
exten => 1,n,Set(DIAL_TRUNK=1)
exten => 1,n,Goto(ext-trunk,tdial,1)

exten => 2,1,Set(TDIAL_STRING=SIP/fpbx-1-n1rQBMZCJKdL)
exten => 2,n,Set(DIAL_TRUNK=2)
exten => 2,n,Goto(ext-trunk,tdial,1)

exten => 3,1,Set(TDIAL_STRING=SIP/fpbx-2-n1rQBMZCJKdL)
exten => 3,n,Set(DIAL_TRUNK=3)
exten => 3,n,Goto(ext-trunk,tdial,1)

exten => tdial,1,Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK})
exten => tdial,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}" = ""]?nomax)
exten => tdial,n,GotoIf($[${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}}]?hangit)
exten => tdial,n(nomax),ExecIf($["${CALLINGPRES_SV}" != ""]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => tdial,n,Set(DIAL_NUMBER=${FROM_DID})
exten => tdial,n,GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]?sub-flp-${DIAL_TRUNK},s,1())
exten => tdial,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => tdial,n,Set(DIAL_TRUNK_OPTIONS=${IF($["${DB_EXISTS(TRUNK/${DIAL_TRUNK}/dialopts)}" = "1"]?${DB_RESULT}:${TRUNK_OPTIONS})})
exten => tdial,n,Dial(${TDIAL_STRING}/${OUTNUM}${TDIAL_SUFFIX},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})
exten => tdial,n,Set(CALLERID(number)=${CALLERID(number):0:40})
exten => tdial,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => tdial,n(hangit),Hangup

;--== end of [ext-trunk] ==--;


[from-trunk-sip-fpbx-1-n1rQBMZCJKdL]
include => from-trunk-sip-fpbx-1-n1rQBMZCJKdL-custom
exten => _.,1,Set(GROUP()=OUT_2)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-fpbx-1-n1rQBMZCJKdL] ==--;


[from-trunk-sip-fpbx-2-n1rQBMZCJKdL]
include => from-trunk-sip-fpbx-2-n1rQBMZCJKdL-custom
exten => _.,1,Set(GROUP()=OUT_3)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-fpbx-2-n1rQBMZCJKdL] ==--;


[macro-prepend-cid]
include => macro-prepend-cid-custom
exten => s,1,GotoIf($["${RGPREFIX}" = ""]?REPCID)
exten => s,n,GotoIf($["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]?REPCID)
exten => s,n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
exten => s,n,Set(_RGPREFIX=)
exten => s,n(REPCID),Set(_RGPREFIX=${ARG1})
exten => s,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})

;--== end of [macro-prepend-cid] ==--;


[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-2 ; EMERGENCY
include => outrt-3 ; E911-Leave-First
include => outrt-7 ; NATHANSON_NOHOLD_OUT
include => outrt-1 ; DEFAULT_OUT
include => outrt-5 ; SIPStation-Out
include => outrt-4 ; SIPStation-INT
include => outrt-6 ; WSC_206
exten => foo,1,Noop(bar)

;--== end of [outbound-allroutes] ==--;


[outrt-2] ; EMERGENCY
include => outrt-2-custom
exten => 811,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 811,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 811,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 811,n,Set(EMERGENCYROUTE=YES)
exten => 811,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 811,n,Set(_NODEST=)
exten => 811,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => 811,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => 811,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => 811,n,Macro(outisbusy,)

exten => 911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 911,n,Set(EMERGENCYROUTE=YES)
exten => 911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 911,n,Set(_NODEST=)
exten => 911,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => 911,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => 911,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => 911,n,Macro(outisbusy,)

exten => 1911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 1911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 1911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 1911,n,Set(EMERGENCYROUTE=YES)
exten => 1911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 1911,n,Set(_NODEST=)
exten => 1911,n,Macro(dialout-trunk,1,${EXTEN:1},,off)
exten => 1911,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => 1911,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => 1911,n,Macro(outisbusy,)

exten => 9911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 9911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9911,n,Set(EMERGENCYROUTE=YES)
exten => 9911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9911,n,Set(_NODEST=)
exten => 9911,n,Macro(dialout-trunk,1,${EXTEN:1},,off)
exten => 9911,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => 9911,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => 9911,n,Macro(outisbusy,)

exten => 91911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 91911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 91911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 91911,n,Set(EMERGENCYROUTE=YES)
exten => 91911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 91911,n,Set(_NODEST=)
exten => 91911,n,Macro(dialout-trunk,1,${EXTEN:2},,off)
exten => 91911,n,Macro(dialout-trunk,2,${EXTEN:2},,off)
exten => 91911,n,Macro(dialout-trunk,3,${EXTEN:2},,off)
exten => 91911,n,Macro(outisbusy,)

;--== end of [outrt-2] ==--;


[outrt-3] ; E911-Leave-First
include => outrt-3-custom
exten => 911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 911,n,Set(EMERGENCYROUTE=YES)
exten => 911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 911,n,Set(_NODEST=)
exten => 911,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => 911,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => 911,n,Macro(outisbusy,)

exten => 933,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 933,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 933,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 933,n,Set(EMERGENCYROUTE=YES)
exten => 933,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 933,n,Set(_NODEST=)
exten => 933,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => 933,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => 933,n,Macro(outisbusy,)

exten => 1911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 1911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 1911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 1911,n,Set(EMERGENCYROUTE=YES)
exten => 1911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 1911,n,Set(_NODEST=)
exten => 1911,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => 1911,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => 1911,n,Macro(outisbusy,)

exten => 9911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 9911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9911,n,Set(EMERGENCYROUTE=YES)
exten => 9911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9911,n,Set(_NODEST=)
exten => 9911,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => 9911,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => 9911,n,Macro(outisbusy,)

exten => 91911,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 91911,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => 91911,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 91911,n,Set(EMERGENCYROUTE=YES)
exten => 91911,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 91911,n,Set(_NODEST=)
exten => 91911,n,Macro(dialout-trunk,2,${EXTEN:2},,off)
exten => 91911,n,Macro(dialout-trunk,3,${EXTEN:2},,off)
exten => 91911,n,Macro(outisbusy,)

;--== end of [outrt-3] ==--;


[outrt-7] ; NATHANSON_NOHOLD_OUT
include => outrt-7-custom
exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)

exten => _NXXNXXXXXX/_3XX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX/_3XX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX/_3XX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX/_3XX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?none:${MOHCLASS})})
exten => _NXXNXXXXXX/_3XX,n,Set(_NODEST=)
exten => _NXXNXXXXXX/_3XX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXNXXXXXX/_3XX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXNXXXXXX/_3XX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXNXXXXXX/_3XX,n,Macro(outisbusy,)

exten => _NXXNXXXXXX/_6XX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX/_6XX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX/_6XX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX/_6XX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?none:${MOHCLASS})})
exten => _NXXNXXXXXX/_6XX,n,Set(_NODEST=)
exten => _NXXNXXXXXX/_6XX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXNXXXXXX/_6XX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXNXXXXXX/_6XX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXNXXXXXX/_6XX,n,Macro(outisbusy,)

exten => _NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)

exten => _NXXXXXX/_3XX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXXXXX/_3XX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXXXXX/_3XX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXXXXX/_3XX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?none:${MOHCLASS})})
exten => _NXXXXXX/_3XX,n,Set(_NODEST=)
exten => _NXXXXXX/_3XX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXXXXX/_3XX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXXXXX/_3XX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXXXXX/_3XX,n,Macro(outisbusy,)

exten => _NXXXXXX/_6XX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXXXXX/_6XX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXXXXX/_6XX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXXXXX/_6XX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?none:${MOHCLASS})})
exten => _NXXXXXX/_6XX,n,Set(_NODEST=)
exten => _NXXXXXX/_6XX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXXXXX/_6XX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXXXXX/_6XX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXXXXX/_6XX,n,Macro(outisbusy,)

;--== end of [outrt-7] ==--;


[outrt-1] ; DEFAULT_OUT
include => outrt-1-custom
exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXNXXXXXX,n,Set(_NODEST=)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(outisbusy,)

exten => _1NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1NXXNXXXXXX,n,Set(_NODEST=)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(outisbusy,)

;--== end of [outrt-1] ==--;


[outrt-5] ; SIPStation-Out
include => outrt-5-custom
exten => _1800NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1800NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1800NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1800NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1800NXXXXXX,n,Set(_NODEST=)
exten => _1800NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1800NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1800NXXXXXX,n,Macro(outisbusy,)

exten => _1844NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1844NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1844NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1844NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1844NXXXXXX,n,Set(_NODEST=)
exten => _1844NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1844NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1844NXXXXXX,n,Macro(outisbusy,)

exten => _1855NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1855NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1855NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1855NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1855NXXXXXX,n,Set(_NODEST=)
exten => _1855NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1855NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1855NXXXXXX,n,Macro(outisbusy,)

exten => _1866NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1866NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1866NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1866NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1866NXXXXXX,n,Set(_NODEST=)
exten => _1866NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1866NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1866NXXXXXX,n,Macro(outisbusy,)

exten => _1877NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1877NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1877NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1877NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1877NXXXXXX,n,Set(_NODEST=)
exten => _1877NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1877NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1877NXXXXXX,n,Macro(outisbusy,)

exten => _1888NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1888NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1888NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1888NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1888NXXXXXX,n,Set(_NODEST=)
exten => _1888NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1888NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1888NXXXXXX,n,Macro(outisbusy,)

exten => _1NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1NXXNXXXXXX,n,Set(_NODEST=)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _1NXXNXXXXXX,n,Macro(outisbusy,)

exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXNXXXXXX,n,Set(_NODEST=)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(outisbusy,)

exten => _NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXXXXX,n,Set(_NODEST=)
exten => _NXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXXXXX,n,Macro(outisbusy,)

;--== end of [outrt-5] ==--;


[outrt-4] ; SIPStation-INT
include => outrt-4-custom
exten => _+NXX.,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _+NXX.,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _+NXX.,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _+NXX.,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _+NXX.,n,Set(_NODEST=)
exten => _+NXX.,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _+NXX.,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _+NXX.,n,Macro(outisbusy,)

exten => _011NXX.,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _011NXX.,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _011NXX.,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _011NXX.,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _011NXX.,n,Set(_NODEST=)
exten => _011NXX.,n,Macro(dialout-trunk,2,+${EXTEN:3},,off)
exten => _011NXX.,n,Macro(dialout-trunk,3,+${EXTEN:3},,off)
exten => _011NXX.,n,Macro(outisbusy,)

;--== end of [outrt-4] ==--;


[outrt-6] ; WSC_206
include => outrt-6-custom
exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXNXXXXXX,n,Set(_NODEST=)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,off)
exten => _NXXNXXXXXX,n,Macro(outisbusy,)

exten => _NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXXXXX,n,Set(_NODEST=)
exten => _NXXXXXX,n,Macro(dialout-trunk,1,206${EXTEN},,off)
exten => _NXXXXXX,n,Macro(dialout-trunk,2,206${EXTEN},,off)
exten => _NXXXXXX,n,Macro(dialout-trunk,3,206${EXTEN},,off)
exten => _NXXXXXX,n,Macro(outisbusy,)

exten => _1NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _1NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _1NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1NXXNXXXXXX,n,Set(_NODEST=)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,2,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN:1},,off)
exten => _1NXXNXXXXXX,n,Macro(outisbusy,)

;--== end of [outrt-6] ==--;


[app-blackhole]
include => app-blackhole-custom
exten => hangup,1,Noop(Blackhole Dest: Hangup)
exten => hangup,n,Hangup

exten => zapateller,1,Noop(Blackhole Dest: Play SIT Tone)
exten => zapateller,n,Answer
exten => zapateller,n,Zapateller()

exten => musiconhold,1,Noop(Blackhole Dest: Put caller on hold forever)
exten => musiconhold,n,Answer
exten => musiconhold,n,MusicOnHold()

exten => congestion,1,Noop(Blackhole Dest: Congestion)
exten => congestion,n,Playtones(congestion)
exten => congestion,n,Congestion(20)
exten => congestion,n,Hangup

exten => busy,1,Noop(Blackhole Dest: Busy)
exten => busy,n,Busy(20)
exten => busy,n,Hangup

exten => ring,1,Noop(Blackhole Dest: Ring)
exten => ring,n,Answer
exten => ring,n,Playtones(ring)
exten => ring,n,Wait(300)
exten => ring,n,Hangup

;--== end of [app-blackhole] ==--;


[bad-number]
include => bad-number-custom
exten => _X.,1,ResetCDR()
exten => _X.,n,NoCDR()
exten => _X.,n,Progress
exten => _X.,n,Wait(1)
exten => _X.,n,Progress
exten => _X.,n,Playback(silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _X.,n,Wait(1)
exten => _X.,n,Congestion(20)
exten => _X.,n,Hangup

;--== end of [bad-number] ==--;


[sub-presencestate-display]
include => sub-presencestate-display-custom
exten => s,1,Goto(state-${TOLOWER(${PRESENCE_STATE(CustomPresence:${ARG1},value)})},1)

exten => state-available,1,Set(PRESENCESTATE_DISPLAY=(Available))
exten => state-available,n,Return()

exten => state-chat,1,Set(PRESENCESTATE_DISPLAY=(Chatty))
exten => state-chat,n,Return()

exten => state-away,1,Set(PRESENCESTATE_DISPLAY=(Away))
exten => state-away,n,Return()

exten => state-dnd,1,Set(PRESENCESTATE_DISPLAY=(DND))
exten => state-dnd,n,Return()

exten => state-xa,1,Set(PRESENCESTATE_DISPLAY=(Extended Away))
exten => state-xa,n,Return()

exten => state-unavailable,1,Set(PRESENCESTATE_DISPLAY=(Unavailable))
exten => state-unavailable,n,Return()

exten => _state-.,1,Set(PRESENCESTATE_DISPLAY=)
exten => _state-.,n,Return()

exten => state-,1,Set(PRESENCESTATE_DISPLAY=)
exten => state-,n,Return()

;--== end of [sub-presencestate-display] ==--;


[macro-confirm]
include => macro-confirm-custom
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Set(__MACRO_RESULT=ABORT)
exten => s,n,Set(MSG1=${IF($["${ARG1}${ALT_CONFIRM_MSG}"=""]?incoming-call-1-accept-2-decline:${IF($[${LEN(${ALT_CONFIRM_MSG})}>0]?${ALT_CONFIRM_MSG}:${ARG1})})})
exten => s,n(start),Background(${MSG1},m,${CHANNEL(language)},macro-confirm)
exten => s,n,Read(INPUT,,1,,,4)
exten => s,n,GotoIf($[${LEN(${INPUT})} > 0]?${INPUT},1:t,1)

exten => 1,1,GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}"=""]?toolate,1)
exten => 1,n,Noop(Deleting: RG/${ARG3}/${UNIQCHAN} ${DB_DELETE(RG/${ARG3}/${UNIQCHAN})})
exten => 1,n,Macro(blkvm-clr,)
exten => 1,n,Set(SHARED(ANSWER_STATUS,${FORCE_CONFIRM})=)
exten => 1,n(skip),Set(__MACRO_RESULT=)
exten => 1,n,ExecIf($[("${MOHCLASS}"!="default") & ("${MOHCLASS}"!="")]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => 1,n(exitopt1),MacroExit()

exten => 2,1,Goto(noanswer,1)

exten => 3,1,SayDigits(${CALLCONFIRMCID})
exten => 3,n,GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}"=""]?toolate,1:s,start)

exten => t,1,GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}"=""]?toolate,1)
exten => t,n,Set(LOOPCOUNT=$[ ${LOOPCOUNT} + 1 ])
exten => t,n,GotoIf($[ ${LOOPCOUNT} < 5 ]?s,start:noanswer,1)

exten => _X,1,Background(invalid,m,${CHANNEL(language)},macro-confirm)
exten => _X,n,GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" | "${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}"=""]?toolate,1)
exten => _X,n,Set(LOOPCOUNT=$[ ${LOOPCOUNT} + 1 ])
exten => _X,n,GotoIf($[ ${LOOPCOUNT} < 5 ]?s,start:noanswer,1)

exten => noanswer,1,Set(__MACRO_RESULT=ABORT)
exten => noanswer,n(exitnoanswer),MacroExit()

exten => toolate,1,Set(MSG2=${IF($["foo${ARG2}" != "foo"]?${ARG2}:"incoming-call-no-longer-avail")})
exten => toolate,n,Playback(${MSG2})
exten => toolate,n,Set(__MACRO_RESULT=ABORT)
exten => toolate,n(exittoolate),MacroExit()

exten => h,1,Macro(hangupcall,)

;--== end of [macro-confirm] ==--;


[macro-auto-confirm]
include => macro-auto-confirm-custom
exten => s,1,Set(__MACRO_RESULT=)
exten => s,n,Set(CFIGNORE=)
exten => s,n,Set(MASTER_CHANNEL(CFIGNORE)=)
exten => s,n,Set(FORWARD_CONTEXT=from-internal)
exten => s,n,Set(MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal)
exten => s,n,Macro(blkvm-clr,)
exten => s,n,Noop(Deleting: RG/${ARG1}/${UNIQCHAN} ${DB_DELETE(RG/${ARG1}/${UNIQCHAN})})
exten => s,n,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER}))
exten => s,n,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)}))

;--== end of [macro-auto-confirm] ==--;


[macro-auto-blkvm]
include => macro-auto-blkvm-custom
exten => s,1,Set(__MACRO_RESULT=)
exten => s,n,Set(CFIGNORE=)
exten => s,n,Set(MASTER_CHANNEL(CFIGNORE)=)
exten => s,n,Set(FORWARD_CONTEXT=from-internal)
exten => s,n,Set(MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal)
exten => s,n,Macro(blkvm-clr,)
exten => s,n,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER}))
exten => s,n,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)}))

;--== end of [macro-auto-blkvm] ==--;


[sub-pincheck]
include => sub-pincheck-custom
exten => s,1,Authenticate(${ARG3},)
exten => s,n,ResetCDR()
exten => s,n,Return()

;--== end of [sub-pincheck] ==--;


[macro-dialout-trunk]
include => macro-dialout-trunk-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten => s,n,GosubIf($[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]?sub-pincheck,s,1())
exten => s,n,GotoIf($["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]?disabletrunk,1)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK})
exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?skipoutcid)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${IF($["${DB_EXISTS(TRUNK/${DIAL_TRUNK}/dialopts)}" = "1"]?${DB_RESULT}:${TRUNK_OPTIONS})})
exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
exten => s,n(skipoutcid),GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]?sub-flp-${DIAL_TRUNK},s,1())
exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)})
exten => s,n,ExecIf($["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}))
exten => s,n,ExecIf($["${FORCE_CONFIRM}"!="" ]?Set(DIAL_TRUNK_OPTIONS=${DIAL_TRUNK_OPTIONS}M(confirm)))
exten => s,n(gocall),Macro(dialout-trunk-predial-hook,)
exten => s,n,GotoIf($["${PREDIAL_HOOK_RET}" = "BYPASS"]?bypass,1)
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(CONNECTEDLINE(num,i)=${DIAL_NUMBER}))
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(CONNECTEDLINE(name,i)=CID:${CALLERID(number)}))
exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk)
exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM}${OUT_${DIAL_TRUNK}_SUFFIX},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})
exten => s,n,Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE})
exten => s,n,GotoIf($["${ARG4}" = "on"]?continue,1:s-${DIALSTATUS},1)
exten => s,n(customtrunk),Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)})
exten => s,n,Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)})
exten => s,n,Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)})
exten => s,n,GotoIf($["${the_num}" = "OUTNUM"]?outnum:skipoutnum)
exten => s,n(outnum),Set(the_num=${OUTNUM})
exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})
exten => s,n,Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE})
exten => s,n,GotoIf($["${ARG4}" = "on"]?continue,1:s-${DIALSTATUS},1)
exten => s,n(chanfull),Noop(max channels used up)

exten => s-BUSY,1,Noop(Dial failed due to trunk reporting BUSY - giving up)
exten => s-BUSY,n,Playtones(busy)
exten => s-BUSY,n,Busy(20)

exten => s-ANSWER,1,Noop(Call successfully answered - Hanging up now)
exten => s-ANSWER,n,Macro(hangupcall,)

exten => s-NOANSWER,1,Noop(Dial failed due to trunk reporting NOANSWER - giving up)
exten => s-NOANSWER,n,Progress
exten => s-NOANSWER,n,Playback(number-not-answering,noanswer)
exten => s-NOANSWER,n,Congestion(20)

exten => s-INVALIDNMBR,1,Noop(Dial failed due to trunk reporting Address Incomplete - giving up)
exten => s-INVALIDNMBR,n,Progress
exten => s-INVALIDNMBR,n,Playback(ss-noservice,noanswer)
exten => s-INVALIDNMBR,n,Busy(20)

exten => s-CHANGED,1,Noop(Dial failed due to trunk reporting Number Changed - giving up)
exten => s-CHANGED,n,Playtones(busy)
exten => s-CHANGED,n,Busy(20)

exten => _s-.,1,Set(RC=${IF($[${ISNULL(${HANGUPCAUSE})}]?0:${HANGUPCAUSE})})
exten => _s-.,n,Goto(${RC},1)

exten => 17,1,Goto(s-BUSY,1)

exten => 18,1,Goto(s-NOANSWER,1)

exten => 22,1,Goto(s-CHANGED,1)

exten => 23,1,Goto(s-CHANGED,1)

exten => 1,1,Goto(s-INVALIDNMBR,1)

exten => 28,1,Goto(s-INVALIDNMBR,1)

exten => _X,1,Goto(continue,1)

exten => _X.,1,Goto(continue,1)

exten => continue,1(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks)
exten => continue,n,Set(CALLERID(number)=${AMPUSER})

exten => disabletrunk,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk)

exten => bypass,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook)

exten => h,1,Macro(hangupcall,)

;--== end of [macro-dialout-trunk] ==--;


[macro-privacy-mgr]
include => macro-privacy-mgr-custom
exten => s,1,Set(KEEPCID=${CALLERID(num)})
exten => s,n,Set(TESTCID=${IF($["${CALLERID(num):0:1}"="+"]?${MATH(1+${CALLERID(num):1})}:${MATH(1+${CALLERID(num)})})})
exten => s,n,ExecIf($[${LEN(${TESTCID})}=0]?Set(CALLERID(num)=))
exten => s,n,PrivacyManager(${ARG1},${ARG2})
exten => s,n,GotoIf($["${PRIVACYMGRSTATUS}"="FAILED"]?fail)
exten => s,n,GosubIf($["${CALLED_BLACKLIST}"="1"]?app-blacklist-check,s,1())
exten => s,n,Set(CALLERID(num-pres)=allowed_passed_screen)
exten => s,n,MacroExit()
exten => s,n(fail),Noop(STATUS: ${PRIVACYMGRSTATUS} CID: ${CALLERID(num)} ${CALLERID(name)} CALLPRES: ${CALLLINGPRES})
exten => s,n,Playback(sorry-youre-having-problems&goodbye)
exten => s,n,Playtones(congestion)
exten => s,n,Congestion(20)

exten => h,1,Hangup

;--== end of [macro-privacy-mgr] ==--;


[macro-user-callerid]
include => macro-user-callerid-custom
exten => s,1,Set(TOUCH_MONITOR=${UNIQUEID})
exten => s,n,Set(AMPUSER=${IF($["${AMPUSER}" = ""]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CUT(CHANNEL,@,2):5:5}"="queue" | ${LEN(${AMPUSERCIDNAME})}]?report)
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = ""]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,GotoIf($["${AMPUSER}" = "none"]?limit)
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($["${AMPUSERCIDNAME:1:2}" = ""]?report)
exten => s,n,Set(AMPUSERCID=${IF($["${ARG2}" != "EXTERNAL" & "${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = "1"]?${DB_RESULT}:${AMPUSER})})
exten => s,n,Set(__DIAL_OPTIONS=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/dialopts)}" = "1"]?${DB_RESULT}:${DIAL_OPTIONS})})
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
exten => s,n,GotoIf($["${ARG1}"="LIMIT" & ${LEN(${AMPUSER})} & ${DB_EXISTS(AMPUSER/${AMPUSER}/concurrency_limit)} & ${DB(AMPUSER/${AMPUSER}/concurrency_limit)}>0 & ${GROUP_COUNT(${AMPUSER}@concurrency_limit)}>=${DB(AMPUSER/${AMPUSER}/concurrency_limit)}]?limit)
exten => s,n,ExecIf($["${ARG1}"="LIMIT" & ${LEN(${AMPUSER})}]?Set(GROUP(concurrency_limit)=${AMPUSER}))
exten => s,n,GosubIf($[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})} & "${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" != "never"]?sub-ccss,s,1(${MACRO_CONTEXT},${CALLERID(dnid)}))
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/language)}" != ""]?Set(CHANNEL(language)=${DB(AMPUSER/${AMPUSER}/language)}))
exten => s,n(report),GotoIf($[ "${ARG1}" = "SKIPTTL" | "${ARG1}" = "LIMIT" ]?continue)
exten => s,n,ExecIf($["${CALLEE_ACCOUNCODE}" = ""]?Set(__CALLEE_ACCOUNCODE=${DB(AMPUSER/${IF($["${MACRO_CONTEXT}"="macro-exten-vm"]?${ARG2}:${MACRO_EXTEN})}/accountcode)}))
exten => s,n(report2),Set(__TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
exten => s,n,Macro(hangupcall,)
exten => s,n(limit),Answer
exten => s,n,Wait(1)
exten => s,n,Playback(beep&im-sorry&your&simul-call-limit-reached&goodbye)
exten => s,n,Macro(hangupcall,)
exten => s,n,Congestion(20)
exten => s,n(continue),Set(CALLERID(number)=${CALLERID(number):0:40})
exten => s,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => s,n,Set(CDR(cnum)=${CALLERID(num)})
exten => s,n,Set(CDR(cnam)=${CALLERID(name)})
exten => s,n,Set(CHANNEL(language)=${MASTER_CHANNEL(CHANNEL(language))})

exten => h,1,Macro(hangupcall,)

;--== end of [macro-user-callerid] ==--;


[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,ExecIf($["${CALLINGPRES_SV}" != ""]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = ""]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n(start),GotoIf($[ $["${REALCALLERIDNUM}" = ""] | $["${KEEPCID}" != "TRUE"] | $["${OUTKEEPCID_${ARG1}}" = "on"] ]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = "" | "${EMERGENCYCID:1:2}" = ""]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n,Set(CDR(outbound_cnum)=${CALLERID(num)})
exten => s,n,Set(CDR(outbound_cnam)=${CALLERID(name)})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($[${LEN(${TRUNKOUTCID})} != 0]?Set(CALLERID(all)=${TRUNKOUTCID}))
exten => s,n(usercid),ExecIf($[${LEN(${USEROUTCID})} != 0]?Set(CALLERID(all)=${USEROUTCID}))
exten => s,n,ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN(${FORCEDOUTCID_${ARG1}})}=0]?${TRUNKCIDOVERRIDE}:${FORCEDOUTCID_${ARG1}})}))
exten => s,n(hidecid),ExecIf($["${CALLERID(name)}"="hidden"]?Set(CALLERPRES()=prohib_passed_screen))
exten => s,n,Set(CDR(outbound_cnum)=${CALLERID(num)})
exten => s,n,Set(CDR(outbound_cnam)=${CALLERID(name)})

;--== end of [macro-outbound-callerid] ==--;


[from-zaptel]
include => from-zaptel-custom
include => from-dahdi
exten => foo,1,Noop(bar)

;--== end of [from-zaptel] ==--;


[from-dahdi]
include => from-dahdi-custom
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)

exten => s,1,Noop(Entering from-dahdi with DID == ${DID})
exten => s,n,Ringing()
exten => s,n,Set(DID=${IF($["${DID}"= ""]?s:${DID})})
exten => s,n,Noop(DID is now ${DID})
exten => s,n,GotoIf($["${CHANNEL:0:5}"="DAHDI"]?dahdiok:checkzap)
exten => s,n(checkzap),GotoIf($["${CHANNEL:0:3}"="Zap"]?zapok:neither)
exten => s,n(neither),Goto(from-pstn,${DID},1)
exten => s,n,Macro(Hangupcall,dummy)
exten => s,n(dahdiok),Noop(Is a DAHDi Channel)
exten => s,n,Set(CHAN=${CHANNEL:6})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Macro(from-dahdi-${CHAN},${DID},1)
exten => s,n,Noop(Returned from Macro from-dahdi-${CHAN})
exten => s,n,Goto(from-pstn,${DID},1)
exten => s,n(zapok),Noop(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Macro(from-dahdi-${CHAN},${DID},1)
exten => s,n,Noop(Returned from Macro from-dahdi-${CHAN})
exten => s,n,Goto(from-pstn,${DID},1)

;--== end of [from-dahdi] ==--;


[macro-dial-confirm]
include => macro-dial-confirm-custom
exten => s,1,Set(DB(RG/${ARG4}/${CHANNEL})=RINGING)
exten => s,n,Set(__UNIQCHAN=${CHANNEL})
exten => s,n,Set(USE_CONFIRMATION=TRUE)
exten => s,n,Set(RINGGROUP_INDEX=${ARG4})
exten => s,n,Set(FORCE_CONFIRM=)
exten => s,n,Set(ARG4=)
exten => s,n,Macro(dial,${ARG1},${ARG2},${ARG3})
exten => s,n,Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})})
exten => s,n,Set(USE_CONFIRMATION=)
exten => s,n,Set(RINGGROUP_INDEX=)

;--== end of [macro-dial-confirm] ==--;


[macro-setmusic]
include => macro-setmusic-custom
exten => s,1,Set(CHANNEL(musicclass)=${ARG1})

;--== end of [macro-setmusic] ==--;


[macro-block-cf]
include => macro-block-cf-custom
exten => _X.,1,Hangup

exten => s-ANSWER,1,Noop(Call successfully answered - Hanging up now)
exten => s-ANSWER,n,Macro(hangupcall,)

;--== end of [macro-block-cf] ==--;


[macro-vm]
include => macro-vm-custom
exten => s,1,Macro(user-callerid,SKIPTTL)
exten => s,n,Set(VMGAIN=${IF($["foo${VM_GAIN}"!="foo"]?"g(${VM_GAIN})": )})
exten => s,n,Macro(blkvm-check,)
exten => s,n,GotoIf($["${GOSUB_RETVAL}" != "TRUE"]?vmx,1)
exten => s,n,Hangup

exten => vmx,1,Set(MEXTEN=${ARG1})
exten => vmx,n,Set(MMODE=${ARG2})
exten => vmx,n,Set(RETVM=${ARG3})
exten => vmx,n,Set(MODE=${IF($["${MMODE}"="BUSY"]?busy:unavail)})
exten => vmx,n,Macro(get-vmcontext,${MEXTEN})
exten => vmx,n,Set(MODE=${IF($[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.wav)} = 1) || (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.WAV)} = 1)]?temp:${MODE})})
exten => vmx,n,Noop(MODE IS: ${MODE})
exten => vmx,n,GotoIf($["${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)}" != "enabled"]?chknomsg)
exten => vmx,n,Set(VM_OPTS=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/timeout)}" = "1"]?${DB_RESULT}:${VM_OPTS})})
exten => vmx,n(chknomsg),GotoIf($["${MMODE}"="NOMESSAGE"]?s-${MMODE},1)
exten => vmx,n,GotoIf($["${MMODE}" != "DIRECTDIAL"]?notdirect)
exten => vmx,n,Set(MODE=${IF($["${REGEX("[b]" ${VM_DDTYPE})}" = "1"]?busy:${MODE})})
exten => vmx,n(notdirect),Noop(Checking if ext ${MEXTEN} is enabled: ${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)})
exten => vmx,n,GotoIf($["${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)}" != "enabled"]?s-${MMODE},1)
exten => vmx,n,GotoIf($[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE}.wav)} = 0) && (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE}.WAV)} = 0)]?nofile)
exten => vmx,n,Set(VMX_TIMEOUT=2)
exten => vmx,n,Set(VMX_REPEAT=1)
exten => vmx,n,Set(VMX_LOOPS=1)
exten => vmx,n,Set(LOOPCOUNT=0)
exten => vmx,n,Set(VMX_REPEAT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/repeat)}" = "1"]?${DB_RESULT}:${VMX_REPEAT})})
exten => vmx,n(vmxtime),Set(VMX_TIMEOUT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timeout)}" = "1"]?${DB_RESULT}:${VMX_TIMEOUT})})
exten => vmx,n(vmxloops),Set(VMX_LOOPS=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loops)}" = "1"]?${DB_RESULT}:${VMX_LOOPS})})
exten => vmx,n(vmxanswer),Answer
exten => vmx,n(loopstart),Read(ACTION,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE},1,skip,${VMX_REPEAT},${VMX_TIMEOUT})
exten => vmx,n,GotoIf($["${EXISTS(${ACTION})}" = "1"]?checkopt)
exten => vmx,n(noopt),Noop(Timeout: going to timeout dest)
exten => vmx,n,Set(VMX_OPTS=${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/timeout)})
exten => vmx,n(chktime),GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/ext)}" = "0"]?dotime)
exten => vmx,n,Set(VMX_TIMEDEST_EXT=${DB_RESULT})
exten => vmx,n,Set(VMX_TIMEDEST_CONTEXT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/context)}" = "1"]?${DB_RESULT}:${VMX_TIMEDEST_CONTEXT})})
exten => vmx,n(timepri),Set(VMX_TIMEDEST_PRI=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/pri)}" = "1"]?${DB_RESULT}:${VMX_TIMEDEST_PRI})})
exten => vmx,n(dotime),Goto(${VMX_TIMEDEST_CONTEXT},${VMX_TIMEDEST_EXT},${VMX_TIMEDEST_PRI})
exten => vmx,n(checkopt),GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/ext)}" = "1"]?doopt)
exten => vmx,n,GotoIf($["${ACTION}" = "0"]?o,1)
exten => vmx,n,GotoIf($["${ACTION}" = "*"]?adef,1)
exten => vmx,n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => vmx,n,GotoIf($["${LOOPCOUNT}" > "${VMX_LOOPS}"]?toomany)
exten => vmx,n,Playback(pm-invalid-option&please-try-again)
exten => vmx,n,Goto(loopstart)
exten => vmx,n(toomany),Noop(Too Many invalid entries, got to invalid dest)
exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_LOOP})
exten => vmx,n,Set(VMX_OPTS=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/loops)}" = "1"]?${DB_RESULT}:${VMX_OPTS})})
exten => vmx,n(chkloop),GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/ext)}" = "0"]?doloop)
exten => vmx,n,Set(VMX_LOOPDEST_EXT=${DB_RESULT})
exten => vmx,n,Set(VMX_LOOPDEST_CONTEXT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/context)}" = "1"]?${DB_RESULT}:${VMX_LOOPDEST_CONTEXT})})
exten => vmx,n(looppri),Set(VMX_LOOPDEST_PRI=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/pri)}" = "1"]?${DB_RESULT}:${VMX_LOOPDEST_PRI})})
exten => vmx,n(doloop),Goto(${VMX_LOOPDEST_CONTEXT},${VMX_LOOPDEST_EXT},${VMX_LOOPDEST_PRI})
exten => vmx,n(doopt),Noop(Got a valid option: ${DB_RESULT})
exten => vmx,n,Set(VMX_EXT=${DB_RESULT})
exten => vmx,n,GotoIf($["${VMX_EXT}" != "dovm"]?getdest)
exten => vmx,n(vmxopts),Set(VMX_OPTS=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/dovm)}" = "1"]?${DB_RESULT}:${VMX_OPTS_DOVM})})
exten => vmx,n(vmxdovm),Goto(dovm,1)
exten => vmx,n(getdest),Set(VMX_CONTEXT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/context)}" = "1"]?${DB_RESULT}:${VMX_CONTEXT})})
exten => vmx,n(vmxpri),Set(VMX_PRI=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/pri)}" = "1"]?${DB_RESULT}:${VMX_PRI})})
exten => vmx,n(vmxgoto),Goto(${VMX_CONTEXT},${VMX_EXT},${VMX_PRI})
exten => vmx,n(nofile),Noop(File for mode: ${MODE} does not exist, SYSTEMSTATUS: ${SYSTEMSTATUS}, going to normal voicemail)
exten => vmx,n,Goto(s-${MMODE},1)
exten => vmx,n(tmpgreet),Noop(Temporary Greeting Detected, going to normal voicemail)
exten => vmx,n,Goto(s-${MMODE},1)

exten => dovm,1,Noop(VMX Timeout - go to voicemail)
exten => dovm,n,VoiceMail(${MEXTEN}@${VMCONTEXT},${VMX_OPTS}${VMGAIN})
exten => dovm,n,Goto(exit-${VMSTATUS},1)

exten => s-BUSY,1,Noop(BUSY voicemail)
exten => s-BUSY,n,Macro(get-vmcontext,${MEXTEN})
exten => s-BUSY,n,VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}b${VMGAIN})
exten => s-BUSY,n,Goto(exit-${VMSTATUS},1)

exten => s-NOMESSAGE,1,Noop(NOMESSAGE (beep only) voicemail)
exten => s-NOMESSAGE,n,Macro(get-vmcontext,${MEXTEN})
exten => s-NOMESSAGE,n,VoiceMail(${MEXTEN}@${VMCONTEXT},s${VM_OPTS}${VMGAIN})
exten => s-NOMESSAGE,n,Goto(exit-${VMSTATUS},1)

exten => s-INSTRUCT,1,Noop(NOMESSAGE (beeb only) voicemail)
exten => s-INSTRUCT,n,Macro(get-vmcontext,${MEXTEN})
exten => s-INSTRUCT,n,VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}${VMGAIN})
exten => s-INSTRUCT,n,Goto(exit-${VMSTATUS},1)

exten => s-DIRECTDIAL,1,Noop(DIRECTDIAL voicemail)
exten => s-DIRECTDIAL,n,Macro(get-vmcontext,${MEXTEN})
exten => s-DIRECTDIAL,n,VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}${VM_DDTYPE}${VMGAIN})
exten => s-DIRECTDIAL,n,Goto(exit-${VMSTATUS},1)

exten => _s-.,1,Macro(get-vmcontext,${MEXTEN})
exten => _s-.,n,VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}u${VMGAIN})
exten => _s-.,n,Goto(exit-${VMSTATUS},1)

exten => o,1,Playback(one-moment-please)
exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/ext)}" = "0"]?doopdef)
exten => o,n,Set(VMX_OPDEST_EXT=${DB_RESULT})
exten => o,n(opcontext),Set(VMX_OPDEST_CONTEXT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/context)}" = "1"]?${DB_RESULT}:${VMX_CONTEXT})})
exten => o,n(oppri),Set(VMX_OPDEST_PRI=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/pri)}" = "1"]?${DB_RESULT}:${VMX_PRI})})
exten => o,n,Goto(${VMX_OPDEST_CONTEXT},${VMX_OPDEST_EXT},${VMX_OPDEST_PRI})
exten => o,n(doopdef),GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-internal,${OPERATOR_XTN},1)
exten => o,n(nooper),GotoIf($["x${FROM_DID}"="x"]?nodid)
exten => o,n,Dial(Local/${FROM_DID}@from-pstn,)
exten => o,n,Macro(hangup,)
exten => o,n(nodid),Dial(Local/s@from-pstn,)
exten => o,n,Macro(hangup,)

exten => a,1,Macro(get-vmcontext,${MEXTEN})
exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/*/ext)}" = "0"]?adef,1)
exten => a,n,Set(VMX_ADEST_EXT=${DB_RESULT})
exten => a,n(acontext),Set(VMX_ADEST_CONTEXT=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/*/context)}" = "1"]?${DB_RESULT}:${VMX_CONTEXT})})
exten => a,n(apri),Set(VMX_ADEST_PRI=${IF($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/*/pri)}" = "1"]?${DB_RESULT}:${VMX_PRI})})
exten => a,n,Goto(${VMX_ADEST_CONTEXT},${VMX_ADEST_EXT},${VMX_ADEST_PRI})

exten => adef,1,VoiceMailMain(${MEXTEN}@${VMCONTEXT})
exten => adef,n,GotoIf($["${RETVM}" = "RETURN"]?exit-RETURN,1)
exten => adef,n,Hangup

exten => exit-FAILED,1,Playback(im-sorry&an-error-has-occured)
exten => exit-FAILED,n,GotoIf($["${RETVM}" = "RETURN"]?exit-RETURN,1)
exten => exit-FAILED,n,Hangup

exten => exit-SUCCESS,1,GotoIf($["${RETVM}" = "RETURN"]?exit-RETURN,1)
exten => exit-SUCCESS,n,Playback(goodbye)
exten => exit-SUCCESS,n,Hangup

exten => exit-USEREXIT,1,GotoIf($["${RETVM}" = "RETURN"]?exit-RETURN,1)
exten => exit-USEREXIT,n,Playback(goodbye)
exten => exit-USEREXIT,n,Hangup

exten => exit-RETURN,1,Noop(Returning From Voicemail because macro)

exten => t,1,Hangup

;--== end of [macro-vm] ==--;


[macro-exten-vm]
include => macro-exten-vm-custom
exten => s,1,Macro(user-callerid,)
exten => s,n,Set(RingGroupMethod=none)
exten => s,n,Set(__EXTTOCALL=${ARG2})
exten => s,n,Set(__PICKUPMARK=${ARG2})
exten => s,n,Set(RT=${IF($[$["${NODEST}"="" & "${ARG1}"!="novm"] | "${DB(CFU/${EXTTOCALL})}"!="" | "${DB(CFB/${EXTTOCALL})}"!="" | "${ARG3}"="1" | "${ARG4}"="1" | "${ARG5}"="1"]?${RINGTIMER}:)})
exten => s,n,ExecIf($[$["${REDIRECTING(reason)}" = "send_to_vm" | "${SIP_HEADER(X-Digium-Call-Feature)}" = "feature_send_to_vm"] & "${ARG1}" != "novm"]?Macro(vm,${ARG1},DIRECTDIAL,${IVR_RETVM}))
exten => s,n,ExecIf($[$["${REDIRECTING(reason)}" = "send_to_vm" | "${SIP_HEADER(X-Digium-Call-Feature)}" = "feature_send_to_vm"] & "${ARG1}" != "novm"]?MacroExit())
exten => s,n(checkrecord),Gosub(sub-record-check,s,1(exten,${EXTTOCALL},dontcare))
exten => s,n,GotoIf($["${AMPUSER}"=""|${LEN(${FROM_DID})}|"${DB(AMPUSER/${EXTTOCALL}/answermode)}"!="intercom"|${LEN(${BLINDTRANSFER})}|"${EXTENSION_STATE(${EXTTOCALL})}"!="NOT_INUSE"|"${CC_RECALL}"!=""]?macrodial)
exten => s,n,Set(INTERCOM_EXT_DOPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(INTERCOM_RETURN=TRUE)
exten => s,n,Gosub(ext-intercom,*80${EXTTOCALL},1())
exten => s,n,Set(INTERCOM_RETURN=)
exten => s,n,Set(INTERCOM_EXT_DOPTIONS=)
exten => s,n(macrodial),GosubIf($["${INTERCOM_CALL}"="TRUE" & ${LEN(${BLINDTRANSFER})}]?clrheader,1())
exten => s,n,Macro(dial-one,${RT},${DIAL_OPTIONS},${EXTTOCALL})
exten => s,n,Set(SV_DIALSTATUS=${DIALSTATUS})
exten => s,n(calldocfu),GosubIf($[("${SV_DIALSTATUS}"="NOANSWER"|"${SV_DIALSTATUS}"="CHANUNAVAIL") & "${DB(CFU/${EXTTOCALL})}"!="" & "${SCREEN}"=""]?docfu,1())
exten => s,n(calldocfb),GosubIf($["${SV_DIALSTATUS}"="BUSY" & "${DB(CFB/${EXTTOCALL})}"!="" & "${SCREEN}"=""]?docfb,1())
exten => s,n,Set(DIALSTATUS=${SV_DIALSTATUS})
exten => s,n,ExecIf($[("${DIALSTATUS}"="NOANSWER"&"${ARG3}"="1")|("${DIALSTATUS}"="BUSY"&"${ARG4}"="1")|("${DIALSTATUS}"="CHANUNAVAIL"&"${ARG5}"="1")]?MacroExit())
exten => s,n,GotoIf($["${ARG1}"="novm"]?s-${DIALSTATUS},1)
exten => s,n,Macro(vm,${ARG1},${DIALSTATUS},${IVR_RETVM})

exten => docfu,1(docfu),ExecIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"="novm"&"${ARG3}"="1")]?StackPop())
exten => docfu,n,GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"="novm"&"${ARG3}"="1")]?from-internal,${DB(CFU/${EXTTOCALL})},1)
exten => docfu,n,Set(RTCF=${IF($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="0"]?${RT}:${DB(AMPUSER/${EXTTOCALL}/cfringtimer)})})
exten => docfu,n,Dial(Local/${DB(CFU/${EXTTOCALL})}@from-internal/n,${RTCF},${DIAL_OPTIONS})
exten => docfu,n,Return()

exten => docfb,1(docfu),ExecIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"="novm"&"${ARG4}"="1")]?StackPop())
exten => docfb,n,GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"="novm"&"${ARG4}"="1")]?from-internal,${DB(CFB/${EXTTOCALL})},1)
exten => docfb,n,Set(RTCF=${IF($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="0"]?${RT}:${DB(AMPUSER/${EXTTOCALL}/cfringtimer)})})
exten => docfb,n,Dial(Local/${DB(CFB/${EXTTOCALL})}@from-internal/n,${RTCF},${DIAL_OPTIONS})
exten => docfb,n,Return()

exten => clrheader,1,ExecIf($[${LEN(${SIPURI})}&"${SIPURI}"="${SIP_URI_OPTIONS}"]?Set(SIP_URI_OPTIONS=))
exten => clrheader,n,ExecIf($[${LEN(${ALERTINFO})}]?SIPRemoveHeader(${ALERTINFO}))
exten => clrheader,n,ExecIf($[${LEN(${CALLINFO})}]?SIPRemoveHeader(${CALLINFO}))
exten => clrheader,n,Return()

exten => s-BUSY,1,GotoIf($["${IVR_RETVM}"="RETURN" & "${IVR_CONTEXT}"!=""]?exit,1)
exten => s-BUSY,n,Playtones(busy)
exten => s-BUSY,n,Busy(20)

exten => _s-!,1,GotoIf($["${IVR_RETVM}"="RETURN" & "${IVR_CONTEXT}"!=""]?exit,1)
exten => _s-!,n,Playtones(congestion)
exten => _s-!,n,Congestion(10)

exten => exit,1,Playback(beep&line-busy-transfer-menu&silence/1)
exten => exit,n,MacroExit()

;--== end of [macro-exten-vm] ==--;


[macro-simple-dial]
include => macro-simple-dial-custom
exten => s,1,Set(__EXTTOCALL=${ARG1})
exten => s,n,Set(RT=${ARG2})
exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
exten => s,n,Set(CWI_TMP=${CWIGNORE})
exten => s,n(macrodial),Macro(dial-one,${RT},${DIAL_OPTIONS},${EXTTOCALL})
exten => s,n,Set(__CWIGNORE=${CWI_TMP})
exten => s,n,Set(PR_DIALSTATUS=${DIALSTATUS})
exten => s,n(calldocfu),GosubIf($["${PR_DIALSTATUS}"="NOANSWER" & "${CFUEXT}"!=""]?docfu,1())
exten => s,n(calldocfb),GosubIf($["${PR_DIALSTATUS}"="BUSY" & "${CFBEXT}"!=""]?docfb,1())
exten => s,n,Set(DIALSTATUS=${PR_DIALSTATUS})
exten => s,n,Goto(s-${DIALSTATUS},1)

exten => docfu,1,GotoIf($["${DB(AMPUSER/${CFUEXT}/device)}" = "" ]?chlocal)
exten => docfu,n,Dial(Local/${CFUEXT}@ext-local,${RT},${DIAL_OPTIONS})
exten => docfu,n,Return()
exten => docfu,n(chlocal),Dial(Local/${CFUEXT}@from-internal/n,${RT},${DIAL_OPTIONS})
exten => docfu,n,Return()

exten => docfb,1,GotoIf($["${DB(AMPUSER/${CFBEXT}/device)}" = "" ]?chlocal)
exten => docfb,n,Dial(Local/${CFBEXT}@ext-local,${RT},${DIAL_OPTIONS})
exten => docfb,n,Return()
exten => docfb,n(chlocal),Dial(Local/${CFBEXT}@from-internal/n,${RT},${DIAL_OPTIONS})
exten => docfb,n,Return()

exten => _s-.,1,Noop(Extension is reporting ${EXTEN})

;--== end of [macro-simple-dial] ==--;


[macro-blkvm-setifempty]
include => macro-blkvm-setifempty-custom
exten => s,1,GotoIf($[!${EXISTS(${BLKVM_CHANNEL})}]?init)
exten => s,n,Set(GOSUB_RETVAL=${SHARED(BLKVM,${BLKVM_CHANNEL})})
exten => s,n,MacroExit()
exten => s,n(init),Set(__BLKVM_CHANNEL=${CHANNEL})
exten => s,n,Set(SHARED(BLKVM,${BLKVM_CHANNEL})=TRUE)
exten => s,n,Set(GOSUB_RETVAL=TRUE)
exten => s,n,MacroExit()

;--== end of [macro-blkvm-setifempty] ==--;


[macro-blkvm-set]
include => macro-blkvm-set-custom
exten => s,1,ExecIf($[!${EXISTS(${BLKVM_CHANNEL})} | "{ARG1}" = "reset"]?Set(__BLKVM_CHANNEL=${CHANNEL}))
exten => s,n,Set(SHARED(BLKVM,${BLKVM_CHANNEL})=TRUE)
exten => s,n,Set(GOSUB_RETVAL=TRUE)
exten => s,n,MacroExit()

;--== end of [macro-blkvm-set] ==--;


[macro-blkvm-clr]
include => macro-blkvm-clr-custom
exten => s,1,Set(SHARED(BLKVM,${BLKVM_CHANNEL})=)
exten => s,n,Set(GOSUB_RETVAL=)
exten => s,n,MacroExit()

;--== end of [macro-blkvm-clr] ==--;


[macro-blkvm-check]
include => macro-blkvm-check-custom
exten => s,1,Set(GOSUB_RETVAL=${SHARED(BLKVM,${BLKVM_CHANNEL})})
exten => s,n,ExecIf($["${GOSUB_RETVAL}"="" & "${CC_RECALL}"="1"]?Set(GOSUB_RETVAL=TRUE))
exten => s,n,MacroExit()

;--== end of [macro-blkvm-check] ==--;


[macro-hangupcall]
include => macro-hangupcall-custom
exten => s,1(start),GotoIf($["${USE_CONFIRMATION}"="" | "${RINGGROUP_INDEX}"="" | "${CHANNEL}"!="${UNIQCHAN}"]?theend)
exten => s,n(delrgi),Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})})
exten => s,n(theend),Hangup
exten => s,n,MacroExit()

;--== end of [macro-hangupcall] ==--;


[macro-dial-one]
include => macro-dial-one-custom
exten => s,1,Set(DEXTEN=${ARG3})
exten => s,n,Set(DIALSTATUS_CW=)
exten => s,n,GosubIf($["${FROM_DID}"!="" & "${SCREEN}"="" & "${DB(AMPUSER/${DEXTEN}/screen)}"!=""]?screen,1())
exten => s,n,GosubIf($["${DB(CF/${DEXTEN})}"!=""]?cf,1())
exten => s,n,GotoIf($["${DEXTEN:-1}"="#" | "${DB(DND/${DEXTEN})}"=""]?skip1)
exten => s,n,Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=BUSY)
exten => s,n(skip1),GotoIf($["${DEXTEN}"=""]?nodial)
exten => s,n,GotoIf($["${DEXTEN:-1}"="#"]?continue)
exten => s,n,Set(EXTHASCW=${IF($["${CWIGNORE}"!=""]? :${DB(CW/${DEXTEN})})})
exten => s,n,GotoIf($["${EXTHASCW}"="" | "${DB(CFB/${DEXTEN})}"!="" | "${DB(CFU/${DEXTEN})}"!=""]?next1:cwinusebusy)
exten => s,n(next1),GotoIf($["${DB(CFU/${DEXTEN})}"!="" & ("${EXTENSION_STATE(${DEXTEN})}"="UNAVAILABLE" | "${EXTENSION_STATE(${DEXTEN})}"="UNKNOWN")]?docfu:skip3)
exten => s,n(docfu),Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=NOANSWER)
exten => s,n,Goto(nodial)
exten => s,n(skip3),GotoIf($["${EXTHASCW}"="" | "${DB(CFB/${DEXTEN})}"!=""]?next2:continue)
exten => s,n(next2),GotoIf($["${EXTENSION_STATE(${DEXTEN})}"="NOT_INUSE" | "${EXTENSION_STATE(${DEXTEN})}"="UNAVAILABLE" | "${EXTENSION_STATE(${DEXTEN})}"="UNKNOWN"]?continue)
exten => s,n,ExecIf($["${DB(CFB/${DEXTEN})}"!="" & "${CFIGNORE}"=""]?Set(DIALSTATUS=BUSY))
exten => s,n,GotoIf($["${EXTHASCW}"!="" | "${DEXTEN:-1}"="#"]?cwinusebusy)
exten => s,n,Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=BUSY)
exten => s,n,Goto(nodial)
exten => s,n(cwinusebusy),GotoIf($["${EXTHASCW}"!="" & "${CWINUSEBUSY}"="true"]?next3:continue)
exten => s,n(next3),ExecIf($["${EXTENSION_STATE(${DEXTEN})}"!="UNAVAILABLE" & "${EXTENSION_STATE(${DEXTEN})}"!="NOT_INUSE" & "${EXTENSION_STATE(${DEXTEN})}"!="UNKNOWN"]?Set(DIALSTATUS_CW=BUSY))
exten => s,n(continue),GotoIf($["${DEXTEN}"=""]?nodial)
exten => s,n,GosubIf($["${DEXTEN:-1}"!="#"]?dstring,1():dlocal,1())
exten => s,n,GotoIf($[${LEN(${DSTRING})}=0]?nodial)
exten => s,n,GotoIf($["${DEXTEN:-1}"="#"]?skiptrace)
exten => s,n,GosubIf($[${REGEX("^[\+]?[0-9]+$" ${CALLERID(number)})} = 1]?ctset,1():ctclear,1())
exten => s,n(skiptrace),Set(D_OPTIONS=${IF($["${NODEST}"!="" & ${REGEX("(M[(]auto-blkvm[)])" ${ARG2})} != 1]?${ARG2}M(auto-blkvm):${ARG2})})
exten => s,n,ExecIf($["${ALERT_INFO}"!=""]?SIPAddHeader(Alert-Info: ${ALERT_INFO}))
exten => s,n,ExecIf($["${SIPADDHEADER}"!=""]?SIPAddHeader(${SIPADDHEADER}))
exten => s,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => s,n,GosubIf($["${QUEUEWAIT}"!=""]?qwait,1())
exten => s,n,Set(__CWIGNORE=${CWIGNORE})
exten => s,n,Set(__KEEPCID=TRUE)
exten => s,n,GotoIf($["${USEGOTO}"="1"]?usegoto,1)
exten => s,n,GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cidname)}" = "" || "${DB(AMPUSER/${AMPUSER}/cidname)}" = ""]?godial)
exten => s,n,Gosub(sub-presencestate-display,s,1(${EXTTOCALL}))
exten => s,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/${EXTTOCALL}/cidname)}${PRESENCESTATE_DISPLAY})
exten => s,n,Set(CONNECTEDLINE(num)=${EXTTOCALL})
exten => s,n,Set(D_OPTIONS=${D_OPTIONS}I)
exten => s,n(godial),Macro(dialout-one-predial-hook,)
exten => s,n,Dial(${DSTRING},${ARG1},${D_OPTIONS})
exten => s,n,ExecIf($["${DIALSTATUS}"="ANSWER" & "${CALLER_DEST}"!=""]?MacroExit())
exten => s,n,ExecIf($["${DIALSTATUS_CW}"!=""]?Set(DIALSTATUS=${DIALSTATUS_CW}))
exten => s,n,GosubIf($[("${SCREEN}"!=""&("${DIALSTATUS}"="TORTURE"|"${DIALSTATUS}"="DONTCALL"))|"${DIALSTATUS}"="ANSWER"]?s-${DIALSTATUS},1())
exten => s,n,MacroExit()
exten => s,n(nodial),ExecIf($["${DIALSTATUS}" = ""]?Set(DIALSTATUS=NOANSWER))
exten => s,n,Noop(Returned from dial-one with nothing to call and DIALSTATUS: ${DIALSTATUS})
exten => s,n,MacroExit()

exten => h,1,Macro(hangupcall,)

exten => usegoto,1,Set(USEGOTO=)
exten => usegoto,n,Goto(from-internal,${DSTRING},1)

exten => screen,1,GotoIf($["${DB(AMPUSER/${DEXTEN}/screen)}"!="nomemory" | "${CALLERID(number)}"=""]?memory)
exten => screen,n,ExecIf($[${REGEX("^[0-9a-zA-Z ]+$" ${CALLERID(number)})} = 1]?System(rm -f ${ASTVARLIBDIR}/sounds/priv-callerintros/${CALLERID(number)}.*))
exten => screen,n(memory),Set(__SCREEN=${DB(AMPUSER/${DEXTEN}/screen)})
exten => screen,n,Set(__SCREEN_EXTEN=${DEXTEN})
exten => screen,n,Set(ARG2=${ARG2}p)
exten => screen,n,Return()

exten => cf,1,Set(CFAMPUSER=${IF($["${AMPUSER}"=""]?${CALLERID(number)}:${AMPUSER})})
exten => cf,n,ExecIf($["${DB(CF/${DEXTEN})}"="${CFAMPUSER}" | "${DB(CF/${DEXTEN})}"="${REALCALLERIDNUM}" | "${CUT(CUT(BLINDTRANSFER,-,1),/,1)}" = "${DB(CF/${DEXTEN})}" | "${DEXTEN}"="${DB(CF/${DEXTEN})}"]?Return())
exten => cf,n,ExecIf($["${DB(AMPUSER/${DEXTEN}/cfringtimer)}" != "0" & "${DB(AMPUSER/${DEXTEN}/cfringtimer)}" != ""]?Set(ARG1=${IF($["${DB(AMPUSER/${DEXTEN}/cfringtimer)}"="-1"]? : ${DB(AMPUSER/${DEXTEN}/cfringtimer)})}))
exten => cf,n,Set(DEXTEN=${IF($["${CFIGNORE}"=""]?"${DB(CF/${DEXTEN})}#": )})
exten => cf,n,ExecIf($["${DEXTEN}"!=""]?Return())
exten => cf,n,Set(DIALSTATUS=NOANSWER)
exten => cf,n,Return()

exten => qwait,1,ExecIf($["${SAVEDCIDNAME}" = ""]?Set(__SAVEDCIDNAME=${CALLERID(name)}))
exten => qwait,n,Set(ELAPSED=${MATH($[${EPOCH}+30-${QUEUEWAIT}]/60,int)})
exten => qwait,n,Set(CALLERID(name)=M${ELAPSED}:${SAVEDCIDNAME})
exten => qwait,n,Return()

exten => ctset,1,Set(DB(CALLTRACE/${DEXTEN})=${CALLERID(number)})
exten => ctset,n,Return()

exten => ctclear,1,Noop(Deleting: CALLTRACE/${DEXTEN} ${DB_DELETE(CALLTRACE/${DEXTEN})})
exten => ctclear,n,Return()

exten => dstring,1,Set(DSTRING=)
exten => dstring,n,Set(DEVICES=${DB(AMPUSER/${DEXTEN}/device)})
exten => dstring,n,ExecIf($["${DEVICES}"=""]?Return())
exten => dstring,n,ExecIf($["${DEVICES:0:1}"="&"]?Set(DEVICES=${DEVICES:1}))
exten => dstring,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => dstring,n,Set(ITER=1)
exten => dstring,n(begin),Set(THISDIAL=${DB(DEVICE/${CUT(DEVICES,&,${ITER})}/dial)})
exten => dstring,n,GosubIf($["${ASTCHANDAHDI}" = "1"]?zap2dahdi,1())
exten => dstring,n,GotoIf($["${THISDIAL:0:5}"!="PJSIP"]?doset)
exten => dstring,n,Noop(Debug: Found PJSIP Destination ${THISDIAL}, updaing with PJSIP_DIAL_CONTACTS)
exten => dstring,n,Set(THISDIAL=${PJSIP_DIAL_CONTACTS(${THISDIAL:6})})
exten => dstring,n(doset),Set(DSTRING=${DSTRING}${THISDIAL}&)
exten => dstring,n,Set(ITER=$[${ITER}+1])
exten => dstring,n,GotoIf($[${ITER}<=${LOOPCNT}]?begin)
exten => dstring,n,Set(DSTRING=${DSTRING:0:$[${LEN(${DSTRING})}-1]})
exten => dstring,n,Return()

exten => dlocal,1,Set(DSTRING=${IF($["${ARG1}"=""]?${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}:Local/${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}@from-internal/n)})
exten => dlocal,n,Set(USEGOTO=${IF($["${ARG1}"=""]?1:0)})
exten => dlocal,n,Return()

exten => zap2dahdi,1,ExecIf($["${THISDIAL}" = ""]?Return())
exten => zap2dahdi,n,Set(NEWDIAL=)
exten => zap2dahdi,n,Set(LOOPCNT2=${FIELDQTY(THISDIAL,&)})
exten => zap2dahdi,n,Set(ITER2=1)
exten => zap2dahdi,n(begin2),Set(THISPART2=${CUT(THISDIAL,&,${ITER2})})
exten => zap2dahdi,n,ExecIf($["${THISPART2:0:3}" = "ZAP"]?Set(THISPART2=DAHDI${THISPART2:3}))
exten => zap2dahdi,n,Set(NEWDIAL=${NEWDIAL}${THISPART2}&)
exten => zap2dahdi,n,Set(ITER2=$[${ITER2} + 1])
exten => zap2dahdi,n,GotoIf($[${ITER2} <= ${LOOPCNT2}]?begin2)
exten => zap2dahdi,n,Set(THISDIAL=${NEWDIAL:0:$[${LEN(${NEWDIAL})}-1]})
exten => zap2dahdi,n,Return()

exten => s-TORTURE,1,Goto(app-blackhole,musiconhold,1)
exten => s-TORTURE,n,Macro(hangupcall,)

exten => s-DONTCALL,1,Answer
exten => s-DONTCALL,n,Wait(1)
exten => s-DONTCALL,n,Zapateller()
exten => s-DONTCALL,n,Playback(ss-noservice)
exten => s-DONTCALL,n,Macro(hangupcall,)

exten => s-CHANUNAVAIL,1,Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM})
exten => s-CHANUNAVAIL,n,ExecIf($["${IVR_RETVM}"!="RETURN" | "${IVR_CONTEXT}"=""]?Hangup())
exten => s-CHANUNAVAIL,n,Return()

exten => s-NOANSWER,1,Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM})
exten => s-NOANSWER,n,ExecIf($["${IVR_RETVM}"!="RETURN" | "${IVR_CONTEXT}"=""]?Hangup())
exten => s-NOANSWER,n,Return()

exten => s-BUSY,1,Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM})
exten => s-BUSY,n,ExecIf($["${IVR_RETVM}"!="RETURN" | "${IVR_CONTEXT}"=""]?Hangup())
exten => s-BUSY,n,Return()

;--== end of [macro-dial-one] ==--;


[sipstation-welcome]
include => sipstation-welcome-custom
exten => _X.,1,Set(ISNUM=${REGEX("[0-9]" ${CALLERID(number)})})
exten => _X.,n,Set(DB(sipstation/${EXTEN}/lastcall/cnum)=${CALLERID(number)})
exten => _X.,n,Set(DB(sipstation/${EXTEN}/lastcall/cnam)=${CALLERID(name)})
exten => _X.,n,Set(DB(sipstation/${EXTEN}/lastcall/time)=${EPOCH})
exten => _X.,n,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,Playback(you-have-reached-a-test-number&silence/1)
exten => _X.,n,SayDigits(${EXTEN})
exten => _X.,n,Playback(your&calling&from&silence/1)
exten => _X.,n,GotoIf($["${ISNUM}" = "1"]?valid:notvalid)
exten => _X.,n(valid),SayDigits(${CALLERID(number)})
exten => _X.,n,Hangup
exten => _X.,n(notvalid),Playback(unavailable&number)
exten => _X.,n,Hangup

;--== end of [sipstation-welcome] ==--;


[from-internal-additional]
include => from-internal-additional-custom
include => app-blacklist
include => app-cf-toggle
include => app-cf-unavailable-prompt-on
include => app-cf-busy-prompting-on
include => app-cf-prompting-on
include => app-cf-busy-off-any
include => app-cf-busy-off
include => app-cf-busy-on
include => app-cf-off-any
include => app-cf-off
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-cf-hints
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-campon-toggle
include => app-campon-cancel
include => app-campon-request
include => ext-meetme
include => app-dictate-send
include => app-dictate-record
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => app-calltrace
include => app-speakextennum
include => app-speakingclock
include => app-echo-test
include => app-miscapps
include => ext-intercom-users
include => park-hints
include => app-pbdirectory
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-recordings
include => ext-group
include => grps
include => app-speeddial
include => timeconditions-toggles
include => vmblast-grp
include => app-dialvm
include => app-vmmain
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
exten => h,1,Hangup

;--== end of [from-internal-additional] ==--;


[from-internal-noxfer-additional]
include => from-internal-noxfer-additional-custom
include => ext-paging
exten => h,1,Hangup

;--== end of [from-internal-noxfer-additional] ==--;


