;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make    ;
; custom modifications, details at: http://freepbx.org/configuration_files       ;
;--------------------------------------------------------------------------------;
;

[globals]
CAMPONTOGGLE = *84
FMDEVSTATE = TRUE
DNDDEVSTATE = TRUE
QUEDEVSTATE = TRUE
QUEUETOGGLE = *45
QUEUEPAUSETOGGLE = *46
CFDEVSTATE = TRUE
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 = amp111
AMPDBENGINE = mysql
AMPDBHOST = localhost
AMPDBNAME = asterisk
AMPDBUSER = freepbxuser
AMPDBPASS = 647a7575f390
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 = gsm
REC_POLICY = caller
RINGTIMER_DEFAULT = 15
TRANSFER_CONTEXT = from-internal-xfer
ASTVERSION = 1.8.28.2
ASTCHANDAHDI = 1
NULL = ""
OUT_1 = DAHDI/g0
OUTCID_1 = 
OUTMAXCHANS_1 = 
OUTFAIL_1 = 
OUTPREFIX_1 = 
OUTDISABLE_1 = off
OUTKEEPCID_1 = 
FORCEDOUTCID_1 = 
PREFIX_TRUNK_1 = 
OUT_2 = SIP/PSTN-CISCO
OUTCID_2 = 
OUTMAXCHANS_2 = 
OUTFAIL_2 = 
OUTPREFIX_2 = 
OUTDISABLE_2 = on
OUTKEEPCID_2 = off
FORCEDOUTCID_2 = 
PREFIX_TRUNK_2 = 1
OUT_3 = SIP/GoFiber2
OUTCID_3 = 
OUTMAXCHANS_3 = 
OUTFAIL_3 = 
OUTPREFIX_3 = 
OUTDISABLE_3 = off
OUTKEEPCID_3 = off
FORCEDOUTCID_3 = 
PREFIX_TRUNK_3 = 
OUT_4 = SIP/Examone
OUTCID_4 = 
OUTMAXCHANS_4 = 
OUTFAIL_4 = 
OUTPREFIX_4 = 
OUTDISABLE_4 = off
OUTKEEPCID_4 = off
FORCEDOUTCID_4 = 
PREFIX_TRUNK_4 = 1
OUT_5 = SIP/GoFiber1
OUTCID_5 = 
OUTMAXCHANS_5 = 
OUTFAIL_5 = 
OUTPREFIX_5 = 
OUTDISABLE_5 = off
OUTKEEPCID_5 = off
FORCEDOUTCID_5 = 
PREFIX_TRUNK_5 = 
OUT_6 = SIP/LYNC
OUTCID_6 =  18006981690
OUTMAXCHANS_6 = 
OUTFAIL_6 = 
OUTPREFIX_6 = 
OUTDISABLE_6 = off
OUTKEEPCID_6 = all
FORCEDOUTCID_6 =  18006981690
PREFIX_TRUNK_6 = 1
OUT_7 = AMP:Barred
OUTCID_7 = 
OUTMAXCHANS_7 = 
OUTFAIL_7 = 
OUTPREFIX_7 = 
OUTDISABLE_7 = off
OUTKEEPCID_7 = off
FORCEDOUTCID_7 = 
PREFIX_TRUNK_7 = 1
OUT_8 = SIP/Trunk-PBX2-PBX1
OUTCID_8 = 
OUTMAXCHANS_8 = 
OUTFAIL_8 = 
OUTPREFIX_8 = 
OUTDISABLE_8 = off
OUTKEEPCID_8 = cnum
FORCEDOUTCID_8 = 
PREFIX_TRUNK_8 = 1
OUT_9 = SIP/Trunk-PBX1-DND
OUTCID_9 = 7500
OUTMAXCHANS_9 = 
OUTFAIL_9 = 
OUTPREFIX_9 = 
OUTDISABLE_9 = off
OUTKEEPCID_9 = all
FORCEDOUTCID_9 = 7500
PREFIX_TRUNK_9 = 1
SIPLANG = 
ALLOW_SIP_ANON = yes
#include globals_custom.conf

;end of [globals]

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

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


[c-x-3-operator-panel-voice-mail]
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]
exten => 432113,1,ConfBridge(${XMLNamespaceMeetMeRoomNumber},${XMLNamespaceMeetMeRoomOptions},,)
exten => 432113,n,Hangup

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


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

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


[c-x-3-operator-panel-park]
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]
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]
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]
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]
exten => 432117,1,ChanSpy(${XMLNamespaceChanSpyChannel},${XMLNamespaceChanSpyOptions})
exten => 432117,n,Hangup

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


[cidlookup]
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] ==--;


[macro-parked-call]
exten => s,1,AGI(parkfetch.agi,${ARG1})
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,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST})
exten => s,n(next),Set(CCSS_SETUP=TRUE)
exten => s,n,Macro(user-callerid,)
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,ParkedCall(${ARG1},${ARG2})

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

;--== end of [macro-parked-call] ==--;


[parkedcallstimeout]
exten => _[0-9a-zA-Z*#].,1,Set(PARK_TARGET=${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]
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]
exten => 70,1,Goto(app-blackhole,hangup,1)

;--== end of [park-orphan-routing] ==--;


[park-return-routing]
exten => 70,1,Set(PLOT=70)
exten => 70,n,Goto(park-dial,${PARK_TARGET},1)
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)

exten => 75,1,Goto(70,1)

exten => 76,1,Goto(70,1)

exten => 77,1,Goto(70,1)

exten => 78,1,Goto(70,1)

;--== end of [park-return-routing] ==--;


[park-hints]
include => parkedcalls ; Default Lot
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 => 75,1,Macro(parked-call,75,default)
exten => 75,hint,park:75@parkedcalls

exten => 76,1,Macro(parked-call,76,default)
exten => 76,hint,park:76@parkedcalls

exten => 77,1,Macro(parked-call,77,default)
exten => 77,hint,park:77@parkedcalls

exten => 78,1,Macro(parked-call,78,default)
exten => 78,hint,park:78@parkedcalls

exten => *85,1,Macro(parked-call,,default)
exten => *85,hint,park:71@parkedcalls&park:72@parkedcalls&park:73@parkedcalls&park:74@parkedcalls&park:75@parkedcalls&park:76@parkedcalls&park:77@parkedcalls&park:78@parkedcalls

exten => *8570,1,Macro(parked-call,,default)
exten => *8570,hint,park:71@parkedcalls&park:72@parkedcalls&park:73@parkedcalls&park:74@parkedcalls&park:75@parkedcalls&park:76@parkedcalls&park:77@parkedcalls&park:78@parkedcalls

exten => *851001,1,Macro(parked-call,,default)
exten => *851001,hint,Custom:PARK1001

exten => *851002,1,Macro(parked-call,,default)
exten => *851002,hint,Custom:PARK1002

exten => *851003,1,Macro(parked-call,,default)
exten => *851003,hint,Custom:PARK1003

exten => *851004,1,Macro(parked-call,,default)
exten => *851004,hint,Custom:PARK1004

exten => *852001,1,Macro(parked-call,,default)
exten => *852001,hint,Custom:PARK2001

exten => *852002,1,Macro(parked-call,,default)
exten => *852002,hint,Custom:PARK2002

exten => *852003,1,Macro(parked-call,,default)
exten => *852003,hint,Custom:PARK2003

exten => *852004,1,Macro(parked-call,,default)
exten => *852004,hint,Custom:PARK2004

exten => *852005,1,Macro(parked-call,,default)
exten => *852005,hint,Custom:PARK2005

exten => *852006,1,Macro(parked-call,,default)
exten => *852006,hint,Custom:PARK2006

exten => *852007,1,Macro(parked-call,,default)
exten => *852007,hint,Custom:PARK2007

exten => *852008,1,Macro(parked-call,,default)
exten => *852008,hint,Custom:PARK2008

exten => *852009,1,Macro(parked-call,,default)
exten => *852009,hint,Custom:PARK2009

exten => *852010,1,Macro(parked-call,,default)
exten => *852010,hint,Custom:PARK2010

exten => *852011,1,Macro(parked-call,,default)
exten => *852011,hint,Custom:PARK2011

exten => *852012,1,Macro(parked-call,,default)
exten => *852012,hint,Custom:PARK2012

exten => *852013,1,Macro(parked-call,,default)
exten => *852013,hint,Custom:PARK2013

exten => *852014,1,Macro(parked-call,,default)
exten => *852014,hint,Custom:PARK2014

exten => *852015,1,Macro(parked-call,,default)
exten => *852015,hint,Custom:PARK2015

exten => *852016,1,Macro(parked-call,,default)
exten => *852016,hint,Custom:PARK2016

exten => *852017,1,Macro(parked-call,,default)
exten => *852017,hint,Custom:PARK2017

exten => *852018,1,Macro(parked-call,,default)
exten => *852018,hint,Custom:PARK2018

exten => *852019,1,Macro(parked-call,,default)
exten => *852019,hint,Custom:PARK2019

exten => *852020,1,Macro(parked-call,,default)
exten => *852020,hint,Custom:PARK2020

exten => *852021,1,Macro(parked-call,,default)
exten => *852021,hint,Custom:PARK2021

exten => *852022,1,Macro(parked-call,,default)
exten => *852022,hint,Custom:PARK2022

exten => *852023,1,Macro(parked-call,,default)
exten => *852023,hint,Custom:PARK2023

exten => *852024,1,Macro(parked-call,,default)
exten => *852024,hint,Custom:PARK2024

exten => *852025,1,Macro(parked-call,,default)
exten => *852025,hint,Custom:PARK2025

exten => *852026,1,Macro(parked-call,,default)
exten => *852026,hint,Custom:PARK2026

exten => *852027,1,Macro(parked-call,,default)
exten => *852027,hint,Custom:PARK2027

exten => *852028,1,Macro(parked-call,,default)
exten => *852028,hint,Custom:PARK2028

exten => *852029,1,Macro(parked-call,,default)
exten => *852029,hint,Custom:PARK2029

exten => *852030,1,Macro(parked-call,,default)
exten => *852030,hint,Custom:PARK2030

exten => *852031,1,Macro(parked-call,,default)
exten => *852031,hint,Custom:PARK2031

exten => *852032,1,Macro(parked-call,,default)
exten => *852032,hint,Custom:PARK2032

exten => *852033,1,Macro(parked-call,,default)
exten => *852033,hint,Custom:PARK2033

exten => *852034,1,Macro(parked-call,,default)
exten => *852034,hint,Custom:PARK2034

exten => *852035,1,Macro(parked-call,,default)
exten => *852035,hint,Custom:PARK2035

exten => *852036,1,Macro(parked-call,,default)
exten => *852036,hint,Custom:PARK2036

exten => *852037,1,Macro(parked-call,,default)
exten => *852037,hint,Custom:PARK2037

exten => *852038,1,Macro(parked-call,,default)
exten => *852038,hint,Custom:PARK2038

exten => *852039,1,Macro(parked-call,,default)
exten => *852039,hint,Custom:PARK2039

exten => *852040,1,Macro(parked-call,,default)
exten => *852040,hint,Custom:PARK2040

exten => *852041,1,Macro(parked-call,,default)
exten => *852041,hint,Custom:PARK2041

exten => *852042,1,Macro(parked-call,,default)
exten => *852042,hint,Custom:PARK2042

exten => *852043,1,Macro(parked-call,,default)
exten => *852043,hint,Custom:PARK2043

exten => *852044,1,Macro(parked-call,,default)
exten => *852044,hint,Custom:PARK2044

exten => *852045,1,Macro(parked-call,,default)
exten => *852045,hint,Custom:PARK2045

exten => *852046,1,Macro(parked-call,,default)
exten => *852046,hint,Custom:PARK2046

exten => *852047,1,Macro(parked-call,,default)
exten => *852047,hint,Custom:PARK2047

exten => *852048,1,Macro(parked-call,,default)
exten => *852048,hint,Custom:PARK2048

exten => *852049,1,Macro(parked-call,,default)
exten => *852049,hint,Custom:PARK2049

exten => *853010,1,Macro(parked-call,,default)
exten => *853010,hint,Custom:PARK3010

exten => *853800,1,Macro(parked-call,,default)
exten => *853800,hint,Custom:PARK3800

exten => *854000,1,Macro(parked-call,,default)
exten => *854000,hint,Custom:PARK4000

exten => *855000,1,Macro(parked-call,,default)
exten => *855000,hint,Custom:PARK5000

exten => *856000,1,Macro(parked-call,,default)
exten => *856000,hint,Custom:PARK6000

exten => *857500,1,Macro(parked-call,,default)
exten => *857500,hint,Custom:PARK7500

;--== end of [park-hints] ==--;


[app-recordings]
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)

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


[macro-systemrecording]
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] ==--;


[vmblast-grp]
exten => 500,1,Macro(user-callerid,)
exten => 500,n,Answer
exten => 500,n,Wait(1)
exten => 500,n,Set(GRPLIST=)
exten => 500,n,Goto(app-vmblast,1,1)

;--== end of [vmblast-grp] ==--;


[app-vmblast]
exten => vmblast,1(digits),ExecIf($["${DIGITS}" != ""]?SayDigits(${DIGITS}))
exten => vmblast,n(msg),ExecIf($["${VMBMSG}" != ""]?Background(${VMBMSG}))
exten => vmblast,n,Background(if-correct-press&digits/1)
exten => vmblast,n,WaitExten(20,)
exten => vmblast,n,Playback(sorry-youre-having-problems&goodbye)
exten => vmblast,n,Hangup

exten => 1,1,VoiceMail(${GRPLIST:1},s)
exten => 1,n,Hangup

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


[ext-fax]
exten => s,1,Macro(user-callerid,)
exten => s,n,Noop(Receiving Fax for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => s,n(receivefax),StopPlaytones
exten => s,n,ReceiveFAX(${ASTSPOOLDIR}/fax/${UNIQUEID}.tif,f)
exten => s,n,ExecIf($["${FAXSTATUS:0:6}"="FAILED" && "${FAXERROR}"!="INIT_ERROR"]?Set(FAXSTATUS="FAILED: error: ${FAXERROR} statusstr: ${FAXOPT(statusstr)}"))
exten => s,n,Hangup

exten => h,1,GotoIf($[${STAT(e,${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)} = 0]?failed)
exten => h,n(process),GotoIf($[${LEN(${FAX_RX_EMAIL})} = 0]?noemail)
exten => h,n(delete_opt),Set(DELETE_AFTER_SEND=true)
exten => h,n,System(${ASTVARLIBDIR}/bin/fax2mail.php --to "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid '${REPLACE(CALLERID(all),', )}' --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --exten "${FAX_FOR}" --delete "${DELETE_AFTER_SEND}" --attachformat "${FAX_ATTACH_FORMAT}")
exten => h,n(end),Macro(hangupcall,)
exten => h,n(noemail),Noop(ERROR: No Email Address to send FAX: status: [${FAXSTATUS}],  From: [${CALLERID(all)}])
exten => h,n,Macro(hangupcall,)
exten => h,process+101(failed),Noop(FAX ${FAXSTATUS} for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => h,n,Macro(hangupcall,)

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


[app-fax]
exten => 666,1,Set(FAX_RX_EMAIL=)
exten => 666,n,Goto(ext-fax,s,1)

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

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


[ext-did-0001]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

;--== end of [ext-did-0001] ==--;


[ext-did-0002]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

exten => _9493475601,1,Set(__FROM_DID=${EXTEN})
exten => _9493475601,n,Gosub(app-blacklist-check,s,1())
exten => _9493475601,n,Set(CDR(did)=${FROM_DID})
exten => _9493475601,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => _9493475601,n,Set(CHANNEL(musicclass)=default)
exten => _9493475601,n,Set(__MOHCLASS=default)
exten => _9493475601,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => _9493475601,n,Set(CALLERPRES()=allowed_not_screened)
exten => _9493475601,n(dest-ext),Goto(from-did-direct,1001,1)

exten => _9493475602,1,Set(__FROM_DID=${EXTEN})
exten => _9493475602,n,Gosub(app-blacklist-check,s,1())
exten => _9493475602,n,Set(CDR(did)=${FROM_DID})
exten => _9493475602,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => _9493475602,n,Set(CHANNEL(musicclass)=default)
exten => _9493475602,n,Set(__MOHCLASS=default)
exten => _9493475602,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => _9493475602,n,Set(CALLERPRES()=allowed_not_screened)
exten => _9493475602,n(dest-ext),Goto(ext-queues,102,1)

exten => _X.,1,Set(__FROM_DID=${EXTEN})
exten => _X.,n,Gosub(app-blacklist-check,s,1())
exten => _X.,n,Set(CDR(did)=${FROM_DID})
exten => _X.,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => _X.,n,Set(CHANNEL(musicclass)=default)
exten => _X.,n,Set(__MOHCLASS=default)
exten => _X.,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => _X.,n,Set(CALLERPRES()=allowed_not_screened)
exten => _X.,n(dest-ext),Goto(ext-trunk,5,1)

;--== end of [ext-did-0002] ==--;


[app-announcement-4]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement Business)
exten => s,n,Playback(custom/4,noanswer)
exten => s,n,Goto(vmblast-grp,500,1)

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


[app-announcement-5]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement Business)
exten => s,n,Playback(custom/4,noanswer)
exten => s,n,Goto(vmblast-grp,500,1)

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


[app-announcement-6]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement Greeting)
exten => s,n,Playback(custom/1,noanswer)
exten => s,n,Goto(ext-queues,101,1)

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


[app-announcement-7]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

exten => s,1,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement VoiceMail)
exten => s,n,Playback(custom/3,noanswer)
exten => s,n,GotoIf($["x${IVR_CONTEXT}" = "x"]?vmblast-grp,500,1:${IVR_CONTEXT},return,1)

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


[ivr-4] ; Call Wait
exten => s,1,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/2)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(0,)

exten => 7,1,Macro(blkvm-clr,)
exten => 7,n,Set(__NODEST=)
exten => 7,n(ivrsel-7),Goto(ext-local,vmb1002,1)

exten => i,1,Playback(sorry-youre-having-problems)
exten => i,n,Goto(hang,1)

exten => t,1,Playback(sorry-youre-having-problems)
exten => t,n,Goto(hang,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/2)
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-2] ; Record FLow
exten => s,1,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/1)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(3,)

exten => i,1(final),Goto(ivr-4,s,1)

exten => t,1(final),Goto(ext-queues,101,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/1)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-2] ==--;


[ivr-3] ; Voicemail
exten => s,1,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/3)
exten => s,n(start),Set(TIMEOUT(digit)=3)
exten => s,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => s,n,WaitExten(0,)

exten => 7,1(ivrsel-7),Goto(ext-local,vmb1002,1)

exten => i,1,Playback(sorry-youre-having-problems)
exten => i,n,Goto(hang,1)

exten => t,1(final),Goto(ext-queues,101,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/3)
exten => return,n,Goto(s,start)

exten => h,1,Hangup

exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup

;--== end of [ivr-3] ==--;


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

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

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

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

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


[app-blacklist-check]
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-add]
exten => s,1,Answer
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]
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-blacklist-last]
exten => s,1,Answer
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]
exten => s,1,Answer
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-queueprio]
exten => 2,1,Noop(Changing Channel to queueprio: 2 (Queue priorities 2))
exten => 2,n,Set(_QUEUE_PRIO=2)
exten => 2,n,Goto(ext-queues,101,1)

exten => 1,1,Noop(Changing Channel to queueprio: 1 (Queue priorities1))
exten => 1,n,Set(_QUEUE_PRIO=1)
exten => 1,n,Goto(ext-queues,101,1)

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


[Test]
include => from-internal-custom
include => parkedcalls
include => from-internal-additional
include => park-hints
include => app-recordings
include => vmblast-grp
include => app-fax
include => app-blacklist
include => app-campon-cancel
include => app-campon-request
include => app-campon-toggle
include => ext-group
include => grps
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-busy-prompting-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-prompting-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-cf-unavailable-prompt-on
include => app-cf-toggle
include => ext-cf-hints
include => ext-intercom-users
include => app-dialvm
include => app-vmmain
include => app-calltrace
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-zapbarge
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
include => outrt-1
include => Test_bad-number
include => bad-number
exten => _NXXNXXXXXX,1,Goto(Test_rulematch,${EXTEN},1)

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

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

;--== end of [Test] ==--;


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

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

;--== end of [Test_rulematch] ==--;


[Test_bad-number]

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


[app-campon-cancel]
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]
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] ==--;


[app-campon-toggle]
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]
exten => *841001,1,Goto(app-campon-toggle,*84,1)
exten => *841001,hint,ccss:SIP/1001

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

exten => *841003,1,Goto(app-campon-toggle,*84,1)
exten => *841003,hint,ccss:IAX2/1003

exten => *841004,1,Goto(app-campon-toggle,*84,1)
exten => *841004,hint,ccss:IAX2/1004

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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] ==--;


[sub-ccss]
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]
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]
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]
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]
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] ==--;


[ext-group]
exten => h,1,Macro(hangupcall,)

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


[app-callwaiting-cwoff]
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]
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-fmf-toggle]
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]
exten => *211001,1,Goto(app-fmf-toggle,*21,1)
exten => *211001,hint,Custom:FOLLOWME1001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

exten => FM1001,1,Goto(1001,FM1001)

exten => 1001,1,GotoIf($[ "${DB(AMPUSER/1001/followme/ddial)}" = "EXTENSION" ]?ext-local,1001,1)
exten => 1001,n(FM1001),Macro(user-callerid,)
exten => 1001,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1001,n,Set(CONNECTEDLINE(num)=1001)
exten => 1001,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/1001/cidname)})
exten => 1001,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1001@ext-local)})
exten => 1001,n,Set(__EXTTOCALL=${EXTEN})
exten => 1001,n,Set(__PICKUPMARK=${EXTEN})
exten => 1001,n,Macro(blkvm-setifempty,)
exten => 1001,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1001,n,Macro(blkvm-set,reset)
exten => 1001,n,Set(__NODEST=)
exten => 1001,n(skipov),Set(RRNODEST=${NODEST})
exten => 1001,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1001,n,GosubIf($[${DB_EXISTS(AMPUSER/1001/followme/changecid)} = 1 & "${DB(AMPUSER/1001/followme/changecid)}" != "default" & "${DB(AMPUSER/1001/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1001,n,Set(RecordMethod=Group)
exten => 1001,n(checkrecord),Gosub(sub-record-check,s,1(exten,1001,))
exten => 1001,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 1001,n,Set(_FMGRP=1001)
exten => 1001,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1001/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1001,n,Macro(dial,$[ ${DB(AMPUSER/1001/followme/grptime)} + ${DB(AMPUSER/1001/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1001/followme/grplist)})
exten => 1001,n,Goto(nextstep)
exten => 1001,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1001/followme/grptime)} + ${DB(AMPUSER/1001/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1001/followme/grplist)},1001)
exten => 1001,n(nextstep),Set(RingGroupMethod=)
exten => 1001,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1001,n,Set(__NODEST=)
exten => 1001,n,Set(__PICKUPMARK=)
exten => 1001,n,Macro(blkvm-clr,)
exten => 1001,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 => 1001,n,Goto(ext-local,1001,dest)
exten => 1001,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM1002,1,Goto(1002,FM1002)

exten => 1002,1,GotoIf($[ "${DB(AMPUSER/1002/followme/ddial)}" = "EXTENSION" ]?ext-local,1002,1)
exten => 1002,n(FM1002),Macro(user-callerid,)
exten => 1002,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1002,n,Set(CONNECTEDLINE(num)=1002)
exten => 1002,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/1002/cidname)})
exten => 1002,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1002@ext-local)})
exten => 1002,n,Set(__EXTTOCALL=${EXTEN})
exten => 1002,n,Set(__PICKUPMARK=${EXTEN})
exten => 1002,n,Macro(blkvm-setifempty,)
exten => 1002,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1002,n,Macro(blkvm-set,reset)
exten => 1002,n,Set(__NODEST=)
exten => 1002,n(skipov),Set(RRNODEST=${NODEST})
exten => 1002,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1002,n,GosubIf($[${DB_EXISTS(AMPUSER/1002/followme/changecid)} = 1 & "${DB(AMPUSER/1002/followme/changecid)}" != "default" & "${DB(AMPUSER/1002/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1002,n,Set(RecordMethod=Group)
exten => 1002,n(checkrecord),Gosub(sub-record-check,s,1(exten,1002,))
exten => 1002,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 1002,n,Set(_FMGRP=1002)
exten => 1002,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1002/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1002,n,Macro(dial,$[ ${DB(AMPUSER/1002/followme/grptime)} + ${DB(AMPUSER/1002/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1002/followme/grplist)})
exten => 1002,n,Goto(nextstep)
exten => 1002,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1002/followme/grptime)} + ${DB(AMPUSER/1002/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1002/followme/grplist)},1002)
exten => 1002,n(nextstep),Set(RingGroupMethod=)
exten => 1002,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1002,n,Set(__NODEST=)
exten => 1002,n,Set(__PICKUPMARK=)
exten => 1002,n,Macro(blkvm-clr,)
exten => 1002,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 => 1002,n,Goto(ext-local,1002,dest)
exten => 1002,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM1003,1,Goto(1003,FM1003)

exten => 1003,1,GotoIf($[ "${DB(AMPUSER/1003/followme/ddial)}" = "EXTENSION" ]?ext-local,1003,1)
exten => 1003,n(FM1003),Macro(user-callerid,)
exten => 1003,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1003,n,Set(CONNECTEDLINE(num)=1003)
exten => 1003,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/1003/cidname)})
exten => 1003,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1003@ext-local)})
exten => 1003,n,Set(__EXTTOCALL=${EXTEN})
exten => 1003,n,Set(__PICKUPMARK=${EXTEN})
exten => 1003,n,Macro(blkvm-setifempty,)
exten => 1003,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1003,n,Macro(blkvm-set,reset)
exten => 1003,n,Set(__NODEST=)
exten => 1003,n(skipov),Set(RRNODEST=${NODEST})
exten => 1003,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1003,n,GosubIf($[${DB_EXISTS(AMPUSER/1003/followme/changecid)} = 1 & "${DB(AMPUSER/1003/followme/changecid)}" != "default" & "${DB(AMPUSER/1003/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1003,n,Set(RecordMethod=Group)
exten => 1003,n(checkrecord),Gosub(sub-record-check,s,1(exten,1003,))
exten => 1003,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 1003,n,Set(_FMGRP=1003)
exten => 1003,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1003/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1003,n,Macro(dial,$[ ${DB(AMPUSER/1003/followme/grptime)} + ${DB(AMPUSER/1003/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1003/followme/grplist)})
exten => 1003,n,Goto(nextstep)
exten => 1003,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1003/followme/grptime)} + ${DB(AMPUSER/1003/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1003/followme/grplist)},1003)
exten => 1003,n(nextstep),Set(RingGroupMethod=)
exten => 1003,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1003,n,Set(__NODEST=)
exten => 1003,n,Set(__PICKUPMARK=)
exten => 1003,n,Macro(blkvm-clr,)
exten => 1003,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 => 1003,n,Goto(ext-local,1003,dest)
exten => 1003,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM1004,1,Goto(1004,FM1004)

exten => 1004,1,GotoIf($[ "${DB(AMPUSER/1004/followme/ddial)}" = "EXTENSION" ]?ext-local,1004,1)
exten => 1004,n(FM1004),Macro(user-callerid,)
exten => 1004,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 1004,n,Set(CONNECTEDLINE(num)=1004)
exten => 1004,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/1004/cidname)})
exten => 1004,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(1004@ext-local)})
exten => 1004,n,Set(__EXTTOCALL=${EXTEN})
exten => 1004,n,Set(__PICKUPMARK=${EXTEN})
exten => 1004,n,Macro(blkvm-setifempty,)
exten => 1004,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 1004,n,Macro(blkvm-set,reset)
exten => 1004,n,Set(__NODEST=)
exten => 1004,n(skipov),Set(RRNODEST=${NODEST})
exten => 1004,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 1004,n,GosubIf($[${DB_EXISTS(AMPUSER/1004/followme/changecid)} = 1 & "${DB(AMPUSER/1004/followme/changecid)}" != "default" & "${DB(AMPUSER/1004/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 1004,n,Set(RecordMethod=Group)
exten => 1004,n(checkrecord),Gosub(sub-record-check,s,1(exten,1004,))
exten => 1004,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 1004,n,Set(_FMGRP=1004)
exten => 1004,n(DIALGRP),GotoIf($[("${DB(AMPUSER/1004/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 1004,n,Macro(dial,$[ ${DB(AMPUSER/1004/followme/grptime)} + ${DB(AMPUSER/1004/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1004/followme/grplist)})
exten => 1004,n,Goto(nextstep)
exten => 1004,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/1004/followme/grptime)} + ${DB(AMPUSER/1004/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/1004/followme/grplist)},1004)
exten => 1004,n(nextstep),Set(RingGroupMethod=)
exten => 1004,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 1004,n,Set(__NODEST=)
exten => 1004,n,Set(__PICKUPMARK=)
exten => 1004,n,Macro(blkvm-clr,)
exten => 1004,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 => 1004,n,Goto(ext-local,1004,dest)
exten => 1004,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2001,1,Goto(2001,FM2001)

exten => 2001,1,GotoIf($[ "${DB(AMPUSER/2001/followme/ddial)}" = "EXTENSION" ]?ext-local,2001,1)
exten => 2001,n(FM2001),Macro(user-callerid,)
exten => 2001,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2001,n,Set(CONNECTEDLINE(num)=2001)
exten => 2001,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2001/cidname)})
exten => 2001,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2001@ext-local)})
exten => 2001,n,Set(__EXTTOCALL=${EXTEN})
exten => 2001,n,Set(__PICKUPMARK=${EXTEN})
exten => 2001,n,Macro(blkvm-setifempty,)
exten => 2001,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2001,n,Macro(blkvm-set,reset)
exten => 2001,n,Set(__NODEST=)
exten => 2001,n(skipov),Set(RRNODEST=${NODEST})
exten => 2001,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2001,n,GosubIf($[${DB_EXISTS(AMPUSER/2001/followme/changecid)} = 1 & "${DB(AMPUSER/2001/followme/changecid)}" != "default" & "${DB(AMPUSER/2001/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2001,n,Set(RecordMethod=Group)
exten => 2001,n(checkrecord),Gosub(sub-record-check,s,1(exten,2001,))
exten => 2001,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2001,n,Set(_FMGRP=2001)
exten => 2001,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2001/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2001,n,Macro(dial,$[ ${DB(AMPUSER/2001/followme/grptime)} + ${DB(AMPUSER/2001/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2001/followme/grplist)})
exten => 2001,n,Goto(nextstep)
exten => 2001,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2001/followme/grptime)} + ${DB(AMPUSER/2001/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2001/followme/grplist)},2001)
exten => 2001,n(nextstep),Set(RingGroupMethod=)
exten => 2001,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2001,n,Set(__NODEST=)
exten => 2001,n,Set(__PICKUPMARK=)
exten => 2001,n,Macro(blkvm-clr,)
exten => 2001,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 => 2001,n,Goto(ext-local,2001,dest)
exten => 2001,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2002,1,Goto(2002,FM2002)

exten => 2002,1,GotoIf($[ "${DB(AMPUSER/2002/followme/ddial)}" = "EXTENSION" ]?ext-local,2002,1)
exten => 2002,n(FM2002),Macro(user-callerid,)
exten => 2002,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2002,n,Set(CONNECTEDLINE(num)=2002)
exten => 2002,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2002/cidname)})
exten => 2002,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2002@ext-local)})
exten => 2002,n,Set(__EXTTOCALL=${EXTEN})
exten => 2002,n,Set(__PICKUPMARK=${EXTEN})
exten => 2002,n,Macro(blkvm-setifempty,)
exten => 2002,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2002,n,Macro(blkvm-set,reset)
exten => 2002,n,Set(__NODEST=)
exten => 2002,n(skipov),Set(RRNODEST=${NODEST})
exten => 2002,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2002,n,GosubIf($[${DB_EXISTS(AMPUSER/2002/followme/changecid)} = 1 & "${DB(AMPUSER/2002/followme/changecid)}" != "default" & "${DB(AMPUSER/2002/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2002,n,Set(RecordMethod=Group)
exten => 2002,n(checkrecord),Gosub(sub-record-check,s,1(exten,2002,))
exten => 2002,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2002,n,Set(_FMGRP=2002)
exten => 2002,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2002/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2002,n,Macro(dial,$[ ${DB(AMPUSER/2002/followme/grptime)} + ${DB(AMPUSER/2002/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2002/followme/grplist)})
exten => 2002,n,Goto(nextstep)
exten => 2002,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2002/followme/grptime)} + ${DB(AMPUSER/2002/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2002/followme/grplist)},2002)
exten => 2002,n(nextstep),Set(RingGroupMethod=)
exten => 2002,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2002,n,Set(__NODEST=)
exten => 2002,n,Set(__PICKUPMARK=)
exten => 2002,n,Macro(blkvm-clr,)
exten => 2002,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 => 2002,n,Goto(ext-local,2002,dest)
exten => 2002,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2003,1,Goto(2003,FM2003)

exten => 2003,1,GotoIf($[ "${DB(AMPUSER/2003/followme/ddial)}" = "EXTENSION" ]?ext-local,2003,1)
exten => 2003,n(FM2003),Macro(user-callerid,)
exten => 2003,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2003,n,Set(CONNECTEDLINE(num)=2003)
exten => 2003,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2003/cidname)})
exten => 2003,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2003@ext-local)})
exten => 2003,n,Set(__EXTTOCALL=${EXTEN})
exten => 2003,n,Set(__PICKUPMARK=${EXTEN})
exten => 2003,n,Macro(blkvm-setifempty,)
exten => 2003,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2003,n,Macro(blkvm-set,reset)
exten => 2003,n,Set(__NODEST=)
exten => 2003,n(skipov),Set(RRNODEST=${NODEST})
exten => 2003,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2003,n,GosubIf($[${DB_EXISTS(AMPUSER/2003/followme/changecid)} = 1 & "${DB(AMPUSER/2003/followme/changecid)}" != "default" & "${DB(AMPUSER/2003/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2003,n,Set(RecordMethod=Group)
exten => 2003,n(checkrecord),Gosub(sub-record-check,s,1(exten,2003,))
exten => 2003,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2003,n,Set(_FMGRP=2003)
exten => 2003,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2003/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2003,n,Macro(dial,$[ ${DB(AMPUSER/2003/followme/grptime)} + ${DB(AMPUSER/2003/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2003/followme/grplist)})
exten => 2003,n,Goto(nextstep)
exten => 2003,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2003/followme/grptime)} + ${DB(AMPUSER/2003/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2003/followme/grplist)},2003)
exten => 2003,n(nextstep),Set(RingGroupMethod=)
exten => 2003,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2003,n,Set(__NODEST=)
exten => 2003,n,Set(__PICKUPMARK=)
exten => 2003,n,Macro(blkvm-clr,)
exten => 2003,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 => 2003,n,Goto(ext-local,2003,dest)
exten => 2003,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2004,1,Goto(2004,FM2004)

exten => 2004,1,GotoIf($[ "${DB(AMPUSER/2004/followme/ddial)}" = "EXTENSION" ]?ext-local,2004,1)
exten => 2004,n(FM2004),Macro(user-callerid,)
exten => 2004,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2004,n,Set(CONNECTEDLINE(num)=2004)
exten => 2004,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2004/cidname)})
exten => 2004,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2004@ext-local)})
exten => 2004,n,Set(__EXTTOCALL=${EXTEN})
exten => 2004,n,Set(__PICKUPMARK=${EXTEN})
exten => 2004,n,Macro(blkvm-setifempty,)
exten => 2004,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2004,n,Macro(blkvm-set,reset)
exten => 2004,n,Set(__NODEST=)
exten => 2004,n(skipov),Set(RRNODEST=${NODEST})
exten => 2004,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2004,n,GosubIf($[${DB_EXISTS(AMPUSER/2004/followme/changecid)} = 1 & "${DB(AMPUSER/2004/followme/changecid)}" != "default" & "${DB(AMPUSER/2004/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2004,n,Set(RecordMethod=Group)
exten => 2004,n(checkrecord),Gosub(sub-record-check,s,1(exten,2004,))
exten => 2004,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2004,n,Set(_FMGRP=2004)
exten => 2004,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2004/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2004,n,Macro(dial,$[ ${DB(AMPUSER/2004/followme/grptime)} + ${DB(AMPUSER/2004/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2004/followme/grplist)})
exten => 2004,n,Goto(nextstep)
exten => 2004,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2004/followme/grptime)} + ${DB(AMPUSER/2004/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2004/followme/grplist)},2004)
exten => 2004,n(nextstep),Set(RingGroupMethod=)
exten => 2004,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2004,n,Set(__NODEST=)
exten => 2004,n,Set(__PICKUPMARK=)
exten => 2004,n,Macro(blkvm-clr,)
exten => 2004,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 => 2004,n,Goto(ext-local,2004,dest)
exten => 2004,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2005,1,Goto(2005,FM2005)

exten => 2005,1,GotoIf($[ "${DB(AMPUSER/2005/followme/ddial)}" = "EXTENSION" ]?ext-local,2005,1)
exten => 2005,n(FM2005),Macro(user-callerid,)
exten => 2005,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2005,n,Set(CONNECTEDLINE(num)=2005)
exten => 2005,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2005/cidname)})
exten => 2005,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2005@ext-local)})
exten => 2005,n,Set(__EXTTOCALL=${EXTEN})
exten => 2005,n,Set(__PICKUPMARK=${EXTEN})
exten => 2005,n,Macro(blkvm-setifempty,)
exten => 2005,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2005,n,Macro(blkvm-set,reset)
exten => 2005,n,Set(__NODEST=)
exten => 2005,n(skipov),Set(RRNODEST=${NODEST})
exten => 2005,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2005,n,GosubIf($[${DB_EXISTS(AMPUSER/2005/followme/changecid)} = 1 & "${DB(AMPUSER/2005/followme/changecid)}" != "default" & "${DB(AMPUSER/2005/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2005,n,Set(RecordMethod=Group)
exten => 2005,n(checkrecord),Gosub(sub-record-check,s,1(exten,2005,))
exten => 2005,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2005,n,Set(_FMGRP=2005)
exten => 2005,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2005/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2005,n,Macro(dial,$[ ${DB(AMPUSER/2005/followme/grptime)} + ${DB(AMPUSER/2005/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2005/followme/grplist)})
exten => 2005,n,Goto(nextstep)
exten => 2005,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2005/followme/grptime)} + ${DB(AMPUSER/2005/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2005/followme/grplist)},2005)
exten => 2005,n(nextstep),Set(RingGroupMethod=)
exten => 2005,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2005,n,Set(__NODEST=)
exten => 2005,n,Set(__PICKUPMARK=)
exten => 2005,n,Macro(blkvm-clr,)
exten => 2005,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 => 2005,n,Goto(ext-local,2005,dest)
exten => 2005,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2006,1,Goto(2006,FM2006)

exten => 2006,1,GotoIf($[ "${DB(AMPUSER/2006/followme/ddial)}" = "EXTENSION" ]?ext-local,2006,1)
exten => 2006,n(FM2006),Macro(user-callerid,)
exten => 2006,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2006,n,Set(CONNECTEDLINE(num)=2006)
exten => 2006,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2006/cidname)})
exten => 2006,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2006@ext-local)})
exten => 2006,n,Set(__EXTTOCALL=${EXTEN})
exten => 2006,n,Set(__PICKUPMARK=${EXTEN})
exten => 2006,n,Macro(blkvm-setifempty,)
exten => 2006,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2006,n,Macro(blkvm-set,reset)
exten => 2006,n,Set(__NODEST=)
exten => 2006,n(skipov),Set(RRNODEST=${NODEST})
exten => 2006,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2006,n,GosubIf($[${DB_EXISTS(AMPUSER/2006/followme/changecid)} = 1 & "${DB(AMPUSER/2006/followme/changecid)}" != "default" & "${DB(AMPUSER/2006/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2006,n,Set(RecordMethod=Group)
exten => 2006,n(checkrecord),Gosub(sub-record-check,s,1(exten,2006,))
exten => 2006,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2006,n,Set(_FMGRP=2006)
exten => 2006,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2006/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2006,n,Macro(dial,$[ ${DB(AMPUSER/2006/followme/grptime)} + ${DB(AMPUSER/2006/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2006/followme/grplist)})
exten => 2006,n,Goto(nextstep)
exten => 2006,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2006/followme/grptime)} + ${DB(AMPUSER/2006/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2006/followme/grplist)},2006)
exten => 2006,n(nextstep),Set(RingGroupMethod=)
exten => 2006,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2006,n,Set(__NODEST=)
exten => 2006,n,Set(__PICKUPMARK=)
exten => 2006,n,Macro(blkvm-clr,)
exten => 2006,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 => 2006,n,Goto(ext-local,2006,dest)
exten => 2006,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2007,1,Goto(2007,FM2007)

exten => 2007,1,GotoIf($[ "${DB(AMPUSER/2007/followme/ddial)}" = "EXTENSION" ]?ext-local,2007,1)
exten => 2007,n(FM2007),Macro(user-callerid,)
exten => 2007,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2007,n,Set(CONNECTEDLINE(num)=2007)
exten => 2007,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2007/cidname)})
exten => 2007,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2007@ext-local)})
exten => 2007,n,Set(__EXTTOCALL=${EXTEN})
exten => 2007,n,Set(__PICKUPMARK=${EXTEN})
exten => 2007,n,Macro(blkvm-setifempty,)
exten => 2007,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2007,n,Macro(blkvm-set,reset)
exten => 2007,n,Set(__NODEST=)
exten => 2007,n(skipov),Set(RRNODEST=${NODEST})
exten => 2007,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2007,n,GosubIf($[${DB_EXISTS(AMPUSER/2007/followme/changecid)} = 1 & "${DB(AMPUSER/2007/followme/changecid)}" != "default" & "${DB(AMPUSER/2007/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2007,n,Set(RecordMethod=Group)
exten => 2007,n(checkrecord),Gosub(sub-record-check,s,1(exten,2007,))
exten => 2007,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2007,n,Set(_FMGRP=2007)
exten => 2007,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2007/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2007,n,Macro(dial,$[ ${DB(AMPUSER/2007/followme/grptime)} + ${DB(AMPUSER/2007/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2007/followme/grplist)})
exten => 2007,n,Goto(nextstep)
exten => 2007,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2007/followme/grptime)} + ${DB(AMPUSER/2007/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2007/followme/grplist)},2007)
exten => 2007,n(nextstep),Set(RingGroupMethod=)
exten => 2007,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2007,n,Set(__NODEST=)
exten => 2007,n,Set(__PICKUPMARK=)
exten => 2007,n,Macro(blkvm-clr,)
exten => 2007,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 => 2007,n,Goto(ext-local,2007,dest)
exten => 2007,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2008,1,Goto(2008,FM2008)

exten => 2008,1,GotoIf($[ "${DB(AMPUSER/2008/followme/ddial)}" = "EXTENSION" ]?ext-local,2008,1)
exten => 2008,n(FM2008),Macro(user-callerid,)
exten => 2008,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2008,n,Set(CONNECTEDLINE(num)=2008)
exten => 2008,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2008/cidname)})
exten => 2008,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2008@ext-local)})
exten => 2008,n,Set(__EXTTOCALL=${EXTEN})
exten => 2008,n,Set(__PICKUPMARK=${EXTEN})
exten => 2008,n,Macro(blkvm-setifempty,)
exten => 2008,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2008,n,Macro(blkvm-set,reset)
exten => 2008,n,Set(__NODEST=)
exten => 2008,n(skipov),Set(RRNODEST=${NODEST})
exten => 2008,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2008,n,GosubIf($[${DB_EXISTS(AMPUSER/2008/followme/changecid)} = 1 & "${DB(AMPUSER/2008/followme/changecid)}" != "default" & "${DB(AMPUSER/2008/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2008,n,Set(RecordMethod=Group)
exten => 2008,n(checkrecord),Gosub(sub-record-check,s,1(exten,2008,))
exten => 2008,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2008,n,Set(_FMGRP=2008)
exten => 2008,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2008/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2008,n,Macro(dial,$[ ${DB(AMPUSER/2008/followme/grptime)} + ${DB(AMPUSER/2008/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2008/followme/grplist)})
exten => 2008,n,Goto(nextstep)
exten => 2008,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2008/followme/grptime)} + ${DB(AMPUSER/2008/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2008/followme/grplist)},2008)
exten => 2008,n(nextstep),Set(RingGroupMethod=)
exten => 2008,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2008,n,Set(__NODEST=)
exten => 2008,n,Set(__PICKUPMARK=)
exten => 2008,n,Macro(blkvm-clr,)
exten => 2008,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 => 2008,n,Goto(ext-local,2008,dest)
exten => 2008,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2009,1,Goto(2009,FM2009)

exten => 2009,1,GotoIf($[ "${DB(AMPUSER/2009/followme/ddial)}" = "EXTENSION" ]?ext-local,2009,1)
exten => 2009,n(FM2009),Macro(user-callerid,)
exten => 2009,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2009,n,Set(CONNECTEDLINE(num)=2009)
exten => 2009,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2009/cidname)})
exten => 2009,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2009@ext-local)})
exten => 2009,n,Set(__EXTTOCALL=${EXTEN})
exten => 2009,n,Set(__PICKUPMARK=${EXTEN})
exten => 2009,n,Macro(blkvm-setifempty,)
exten => 2009,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2009,n,Macro(blkvm-set,reset)
exten => 2009,n,Set(__NODEST=)
exten => 2009,n(skipov),Set(RRNODEST=${NODEST})
exten => 2009,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2009,n,GosubIf($[${DB_EXISTS(AMPUSER/2009/followme/changecid)} = 1 & "${DB(AMPUSER/2009/followme/changecid)}" != "default" & "${DB(AMPUSER/2009/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2009,n,Set(RecordMethod=Group)
exten => 2009,n(checkrecord),Gosub(sub-record-check,s,1(exten,2009,))
exten => 2009,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2009,n,Set(_FMGRP=2009)
exten => 2009,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2009/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2009,n,Macro(dial,$[ ${DB(AMPUSER/2009/followme/grptime)} + ${DB(AMPUSER/2009/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2009/followme/grplist)})
exten => 2009,n,Goto(nextstep)
exten => 2009,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2009/followme/grptime)} + ${DB(AMPUSER/2009/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2009/followme/grplist)},2009)
exten => 2009,n(nextstep),Set(RingGroupMethod=)
exten => 2009,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2009,n,Set(__NODEST=)
exten => 2009,n,Set(__PICKUPMARK=)
exten => 2009,n,Macro(blkvm-clr,)
exten => 2009,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 => 2009,n,Goto(ext-local,2009,dest)
exten => 2009,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2010,1,Goto(2010,FM2010)

exten => 2010,1,GotoIf($[ "${DB(AMPUSER/2010/followme/ddial)}" = "EXTENSION" ]?ext-local,2010,1)
exten => 2010,n(FM2010),Macro(user-callerid,)
exten => 2010,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2010,n,Set(CONNECTEDLINE(num)=2010)
exten => 2010,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2010/cidname)})
exten => 2010,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2010@ext-local)})
exten => 2010,n,Set(__EXTTOCALL=${EXTEN})
exten => 2010,n,Set(__PICKUPMARK=${EXTEN})
exten => 2010,n,Macro(blkvm-setifempty,)
exten => 2010,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2010,n,Macro(blkvm-set,reset)
exten => 2010,n,Set(__NODEST=)
exten => 2010,n(skipov),Set(RRNODEST=${NODEST})
exten => 2010,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2010,n,GosubIf($[${DB_EXISTS(AMPUSER/2010/followme/changecid)} = 1 & "${DB(AMPUSER/2010/followme/changecid)}" != "default" & "${DB(AMPUSER/2010/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2010,n,Set(RecordMethod=Group)
exten => 2010,n(checkrecord),Gosub(sub-record-check,s,1(exten,2010,))
exten => 2010,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2010,n,Set(_FMGRP=2010)
exten => 2010,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2010/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2010,n,Macro(dial,$[ ${DB(AMPUSER/2010/followme/grptime)} + ${DB(AMPUSER/2010/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2010/followme/grplist)})
exten => 2010,n,Goto(nextstep)
exten => 2010,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2010/followme/grptime)} + ${DB(AMPUSER/2010/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2010/followme/grplist)},2010)
exten => 2010,n(nextstep),Set(RingGroupMethod=)
exten => 2010,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2010,n,Set(__NODEST=)
exten => 2010,n,Set(__PICKUPMARK=)
exten => 2010,n,Macro(blkvm-clr,)
exten => 2010,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 => 2010,n,Goto(ext-local,2010,dest)
exten => 2010,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2011,1,Goto(2011,FM2011)

exten => 2011,1,GotoIf($[ "${DB(AMPUSER/2011/followme/ddial)}" = "EXTENSION" ]?ext-local,2011,1)
exten => 2011,n(FM2011),Macro(user-callerid,)
exten => 2011,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2011,n,Set(CONNECTEDLINE(num)=2011)
exten => 2011,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2011/cidname)})
exten => 2011,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2011@ext-local)})
exten => 2011,n,Set(__EXTTOCALL=${EXTEN})
exten => 2011,n,Set(__PICKUPMARK=${EXTEN})
exten => 2011,n,Macro(blkvm-setifempty,)
exten => 2011,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2011,n,Macro(blkvm-set,reset)
exten => 2011,n,Set(__NODEST=)
exten => 2011,n(skipov),Set(RRNODEST=${NODEST})
exten => 2011,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2011,n,GosubIf($[${DB_EXISTS(AMPUSER/2011/followme/changecid)} = 1 & "${DB(AMPUSER/2011/followme/changecid)}" != "default" & "${DB(AMPUSER/2011/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2011,n,Set(RecordMethod=Group)
exten => 2011,n(checkrecord),Gosub(sub-record-check,s,1(exten,2011,))
exten => 2011,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2011,n,Set(_FMGRP=2011)
exten => 2011,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2011/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2011,n,Macro(dial,$[ ${DB(AMPUSER/2011/followme/grptime)} + ${DB(AMPUSER/2011/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2011/followme/grplist)})
exten => 2011,n,Goto(nextstep)
exten => 2011,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2011/followme/grptime)} + ${DB(AMPUSER/2011/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2011/followme/grplist)},2011)
exten => 2011,n(nextstep),Set(RingGroupMethod=)
exten => 2011,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2011,n,Set(__NODEST=)
exten => 2011,n,Set(__PICKUPMARK=)
exten => 2011,n,Macro(blkvm-clr,)
exten => 2011,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 => 2011,n,Goto(ext-local,2011,dest)
exten => 2011,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2012,1,Goto(2012,FM2012)

exten => 2012,1,GotoIf($[ "${DB(AMPUSER/2012/followme/ddial)}" = "EXTENSION" ]?ext-local,2012,1)
exten => 2012,n(FM2012),Macro(user-callerid,)
exten => 2012,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2012,n,Set(CONNECTEDLINE(num)=2012)
exten => 2012,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2012/cidname)})
exten => 2012,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2012@ext-local)})
exten => 2012,n,Set(__EXTTOCALL=${EXTEN})
exten => 2012,n,Set(__PICKUPMARK=${EXTEN})
exten => 2012,n,Macro(blkvm-setifempty,)
exten => 2012,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2012,n,Macro(blkvm-set,reset)
exten => 2012,n,Set(__NODEST=)
exten => 2012,n(skipov),Set(RRNODEST=${NODEST})
exten => 2012,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2012,n,GosubIf($[${DB_EXISTS(AMPUSER/2012/followme/changecid)} = 1 & "${DB(AMPUSER/2012/followme/changecid)}" != "default" & "${DB(AMPUSER/2012/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2012,n,Set(RecordMethod=Group)
exten => 2012,n(checkrecord),Gosub(sub-record-check,s,1(exten,2012,))
exten => 2012,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2012,n,Set(_FMGRP=2012)
exten => 2012,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2012/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2012,n,Macro(dial,$[ ${DB(AMPUSER/2012/followme/grptime)} + ${DB(AMPUSER/2012/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2012/followme/grplist)})
exten => 2012,n,Goto(nextstep)
exten => 2012,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2012/followme/grptime)} + ${DB(AMPUSER/2012/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2012/followme/grplist)},2012)
exten => 2012,n(nextstep),Set(RingGroupMethod=)
exten => 2012,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2012,n,Set(__NODEST=)
exten => 2012,n,Set(__PICKUPMARK=)
exten => 2012,n,Macro(blkvm-clr,)
exten => 2012,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 => 2012,n,Goto(ext-local,2012,dest)
exten => 2012,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2013,1,Goto(2013,FM2013)

exten => 2013,1,GotoIf($[ "${DB(AMPUSER/2013/followme/ddial)}" = "EXTENSION" ]?ext-local,2013,1)
exten => 2013,n(FM2013),Macro(user-callerid,)
exten => 2013,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2013,n,Set(CONNECTEDLINE(num)=2013)
exten => 2013,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2013/cidname)})
exten => 2013,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2013@ext-local)})
exten => 2013,n,Set(__EXTTOCALL=${EXTEN})
exten => 2013,n,Set(__PICKUPMARK=${EXTEN})
exten => 2013,n,Macro(blkvm-setifempty,)
exten => 2013,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2013,n,Macro(blkvm-set,reset)
exten => 2013,n,Set(__NODEST=)
exten => 2013,n(skipov),Set(RRNODEST=${NODEST})
exten => 2013,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2013,n,GosubIf($[${DB_EXISTS(AMPUSER/2013/followme/changecid)} = 1 & "${DB(AMPUSER/2013/followme/changecid)}" != "default" & "${DB(AMPUSER/2013/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2013,n,Set(RecordMethod=Group)
exten => 2013,n(checkrecord),Gosub(sub-record-check,s,1(exten,2013,))
exten => 2013,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2013,n,Set(_FMGRP=2013)
exten => 2013,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2013/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2013,n,Macro(dial,$[ ${DB(AMPUSER/2013/followme/grptime)} + ${DB(AMPUSER/2013/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2013/followme/grplist)})
exten => 2013,n,Goto(nextstep)
exten => 2013,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2013/followme/grptime)} + ${DB(AMPUSER/2013/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2013/followme/grplist)},2013)
exten => 2013,n(nextstep),Set(RingGroupMethod=)
exten => 2013,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2013,n,Set(__NODEST=)
exten => 2013,n,Set(__PICKUPMARK=)
exten => 2013,n,Macro(blkvm-clr,)
exten => 2013,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 => 2013,n,Goto(ext-local,2013,dest)
exten => 2013,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2014,1,Goto(2014,FM2014)

exten => 2014,1,GotoIf($[ "${DB(AMPUSER/2014/followme/ddial)}" = "EXTENSION" ]?ext-local,2014,1)
exten => 2014,n(FM2014),Macro(user-callerid,)
exten => 2014,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2014,n,Set(CONNECTEDLINE(num)=2014)
exten => 2014,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2014/cidname)})
exten => 2014,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2014@ext-local)})
exten => 2014,n,Set(__EXTTOCALL=${EXTEN})
exten => 2014,n,Set(__PICKUPMARK=${EXTEN})
exten => 2014,n,Macro(blkvm-setifempty,)
exten => 2014,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2014,n,Macro(blkvm-set,reset)
exten => 2014,n,Set(__NODEST=)
exten => 2014,n(skipov),Set(RRNODEST=${NODEST})
exten => 2014,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2014,n,GosubIf($[${DB_EXISTS(AMPUSER/2014/followme/changecid)} = 1 & "${DB(AMPUSER/2014/followme/changecid)}" != "default" & "${DB(AMPUSER/2014/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2014,n,Set(RecordMethod=Group)
exten => 2014,n(checkrecord),Gosub(sub-record-check,s,1(exten,2014,))
exten => 2014,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2014,n,Set(_FMGRP=2014)
exten => 2014,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2014/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2014,n,Macro(dial,$[ ${DB(AMPUSER/2014/followme/grptime)} + ${DB(AMPUSER/2014/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2014/followme/grplist)})
exten => 2014,n,Goto(nextstep)
exten => 2014,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2014/followme/grptime)} + ${DB(AMPUSER/2014/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2014/followme/grplist)},2014)
exten => 2014,n(nextstep),Set(RingGroupMethod=)
exten => 2014,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2014,n,Set(__NODEST=)
exten => 2014,n,Set(__PICKUPMARK=)
exten => 2014,n,Macro(blkvm-clr,)
exten => 2014,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 => 2014,n,Goto(ext-local,2014,dest)
exten => 2014,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2015,1,Goto(2015,FM2015)

exten => 2015,1,GotoIf($[ "${DB(AMPUSER/2015/followme/ddial)}" = "EXTENSION" ]?ext-local,2015,1)
exten => 2015,n(FM2015),Macro(user-callerid,)
exten => 2015,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2015,n,Set(CONNECTEDLINE(num)=2015)
exten => 2015,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2015/cidname)})
exten => 2015,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2015@ext-local)})
exten => 2015,n,Set(__EXTTOCALL=${EXTEN})
exten => 2015,n,Set(__PICKUPMARK=${EXTEN})
exten => 2015,n,Macro(blkvm-setifempty,)
exten => 2015,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2015,n,Macro(blkvm-set,reset)
exten => 2015,n,Set(__NODEST=)
exten => 2015,n(skipov),Set(RRNODEST=${NODEST})
exten => 2015,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2015,n,GosubIf($[${DB_EXISTS(AMPUSER/2015/followme/changecid)} = 1 & "${DB(AMPUSER/2015/followme/changecid)}" != "default" & "${DB(AMPUSER/2015/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2015,n,Set(RecordMethod=Group)
exten => 2015,n(checkrecord),Gosub(sub-record-check,s,1(exten,2015,))
exten => 2015,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2015,n,Set(_FMGRP=2015)
exten => 2015,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2015/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2015,n,Macro(dial,$[ ${DB(AMPUSER/2015/followme/grptime)} + ${DB(AMPUSER/2015/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2015/followme/grplist)})
exten => 2015,n,Goto(nextstep)
exten => 2015,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2015/followme/grptime)} + ${DB(AMPUSER/2015/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2015/followme/grplist)},2015)
exten => 2015,n(nextstep),Set(RingGroupMethod=)
exten => 2015,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2015,n,Set(__NODEST=)
exten => 2015,n,Set(__PICKUPMARK=)
exten => 2015,n,Macro(blkvm-clr,)
exten => 2015,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 => 2015,n,Goto(ext-local,2015,dest)
exten => 2015,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2016,1,Goto(2016,FM2016)

exten => 2016,1,GotoIf($[ "${DB(AMPUSER/2016/followme/ddial)}" = "EXTENSION" ]?ext-local,2016,1)
exten => 2016,n(FM2016),Macro(user-callerid,)
exten => 2016,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2016,n,Set(CONNECTEDLINE(num)=2016)
exten => 2016,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2016/cidname)})
exten => 2016,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2016@ext-local)})
exten => 2016,n,Set(__EXTTOCALL=${EXTEN})
exten => 2016,n,Set(__PICKUPMARK=${EXTEN})
exten => 2016,n,Macro(blkvm-setifempty,)
exten => 2016,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2016,n,Macro(blkvm-set,reset)
exten => 2016,n,Set(__NODEST=)
exten => 2016,n(skipov),Set(RRNODEST=${NODEST})
exten => 2016,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2016,n,GosubIf($[${DB_EXISTS(AMPUSER/2016/followme/changecid)} = 1 & "${DB(AMPUSER/2016/followme/changecid)}" != "default" & "${DB(AMPUSER/2016/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2016,n,Set(RecordMethod=Group)
exten => 2016,n(checkrecord),Gosub(sub-record-check,s,1(exten,2016,))
exten => 2016,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2016,n,Set(_FMGRP=2016)
exten => 2016,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2016/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2016,n,Macro(dial,$[ ${DB(AMPUSER/2016/followme/grptime)} + ${DB(AMPUSER/2016/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2016/followme/grplist)})
exten => 2016,n,Goto(nextstep)
exten => 2016,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2016/followme/grptime)} + ${DB(AMPUSER/2016/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2016/followme/grplist)},2016)
exten => 2016,n(nextstep),Set(RingGroupMethod=)
exten => 2016,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2016,n,Set(__NODEST=)
exten => 2016,n,Set(__PICKUPMARK=)
exten => 2016,n,Macro(blkvm-clr,)
exten => 2016,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 => 2016,n,Goto(ext-local,2016,dest)
exten => 2016,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2017,1,Goto(2017,FM2017)

exten => 2017,1,GotoIf($[ "${DB(AMPUSER/2017/followme/ddial)}" = "EXTENSION" ]?ext-local,2017,1)
exten => 2017,n(FM2017),Macro(user-callerid,)
exten => 2017,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2017,n,Set(CONNECTEDLINE(num)=2017)
exten => 2017,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2017/cidname)})
exten => 2017,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2017@ext-local)})
exten => 2017,n,Set(__EXTTOCALL=${EXTEN})
exten => 2017,n,Set(__PICKUPMARK=${EXTEN})
exten => 2017,n,Macro(blkvm-setifempty,)
exten => 2017,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2017,n,Macro(blkvm-set,reset)
exten => 2017,n,Set(__NODEST=)
exten => 2017,n(skipov),Set(RRNODEST=${NODEST})
exten => 2017,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2017,n,GosubIf($[${DB_EXISTS(AMPUSER/2017/followme/changecid)} = 1 & "${DB(AMPUSER/2017/followme/changecid)}" != "default" & "${DB(AMPUSER/2017/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2017,n,Set(RecordMethod=Group)
exten => 2017,n(checkrecord),Gosub(sub-record-check,s,1(exten,2017,))
exten => 2017,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2017,n,Set(_FMGRP=2017)
exten => 2017,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2017/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2017,n,Macro(dial,$[ ${DB(AMPUSER/2017/followme/grptime)} + ${DB(AMPUSER/2017/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2017/followme/grplist)})
exten => 2017,n,Goto(nextstep)
exten => 2017,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2017/followme/grptime)} + ${DB(AMPUSER/2017/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2017/followme/grplist)},2017)
exten => 2017,n(nextstep),Set(RingGroupMethod=)
exten => 2017,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2017,n,Set(__NODEST=)
exten => 2017,n,Set(__PICKUPMARK=)
exten => 2017,n,Macro(blkvm-clr,)
exten => 2017,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 => 2017,n,Goto(ext-local,2017,dest)
exten => 2017,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2018,1,Goto(2018,FM2018)

exten => 2018,1,GotoIf($[ "${DB(AMPUSER/2018/followme/ddial)}" = "EXTENSION" ]?ext-local,2018,1)
exten => 2018,n(FM2018),Macro(user-callerid,)
exten => 2018,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2018,n,Set(CONNECTEDLINE(num)=2018)
exten => 2018,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2018/cidname)})
exten => 2018,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2018@ext-local)})
exten => 2018,n,Set(__EXTTOCALL=${EXTEN})
exten => 2018,n,Set(__PICKUPMARK=${EXTEN})
exten => 2018,n,Macro(blkvm-setifempty,)
exten => 2018,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2018,n,Macro(blkvm-set,reset)
exten => 2018,n,Set(__NODEST=)
exten => 2018,n(skipov),Set(RRNODEST=${NODEST})
exten => 2018,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2018,n,GosubIf($[${DB_EXISTS(AMPUSER/2018/followme/changecid)} = 1 & "${DB(AMPUSER/2018/followme/changecid)}" != "default" & "${DB(AMPUSER/2018/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2018,n,Set(RecordMethod=Group)
exten => 2018,n(checkrecord),Gosub(sub-record-check,s,1(exten,2018,))
exten => 2018,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2018,n,Set(_FMGRP=2018)
exten => 2018,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2018/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2018,n,Macro(dial,$[ ${DB(AMPUSER/2018/followme/grptime)} + ${DB(AMPUSER/2018/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2018/followme/grplist)})
exten => 2018,n,Goto(nextstep)
exten => 2018,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2018/followme/grptime)} + ${DB(AMPUSER/2018/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2018/followme/grplist)},2018)
exten => 2018,n(nextstep),Set(RingGroupMethod=)
exten => 2018,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2018,n,Set(__NODEST=)
exten => 2018,n,Set(__PICKUPMARK=)
exten => 2018,n,Macro(blkvm-clr,)
exten => 2018,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 => 2018,n,Goto(ext-local,2018,dest)
exten => 2018,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2019,1,Goto(2019,FM2019)

exten => 2019,1,GotoIf($[ "${DB(AMPUSER/2019/followme/ddial)}" = "EXTENSION" ]?ext-local,2019,1)
exten => 2019,n(FM2019),Macro(user-callerid,)
exten => 2019,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2019,n,Set(CONNECTEDLINE(num)=2019)
exten => 2019,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2019/cidname)})
exten => 2019,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2019@ext-local)})
exten => 2019,n,Set(__EXTTOCALL=${EXTEN})
exten => 2019,n,Set(__PICKUPMARK=${EXTEN})
exten => 2019,n,Macro(blkvm-setifempty,)
exten => 2019,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2019,n,Macro(blkvm-set,reset)
exten => 2019,n,Set(__NODEST=)
exten => 2019,n(skipov),Set(RRNODEST=${NODEST})
exten => 2019,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2019,n,GosubIf($[${DB_EXISTS(AMPUSER/2019/followme/changecid)} = 1 & "${DB(AMPUSER/2019/followme/changecid)}" != "default" & "${DB(AMPUSER/2019/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2019,n,Set(RecordMethod=Group)
exten => 2019,n(checkrecord),Gosub(sub-record-check,s,1(exten,2019,))
exten => 2019,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2019,n,Set(_FMGRP=2019)
exten => 2019,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2019/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2019,n,Macro(dial,$[ ${DB(AMPUSER/2019/followme/grptime)} + ${DB(AMPUSER/2019/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2019/followme/grplist)})
exten => 2019,n,Goto(nextstep)
exten => 2019,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2019/followme/grptime)} + ${DB(AMPUSER/2019/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2019/followme/grplist)},2019)
exten => 2019,n(nextstep),Set(RingGroupMethod=)
exten => 2019,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2019,n,Set(__NODEST=)
exten => 2019,n,Set(__PICKUPMARK=)
exten => 2019,n,Macro(blkvm-clr,)
exten => 2019,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 => 2019,n,Goto(ext-local,2019,dest)
exten => 2019,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2020,1,Goto(2020,FM2020)

exten => 2020,1,GotoIf($[ "${DB(AMPUSER/2020/followme/ddial)}" = "EXTENSION" ]?ext-local,2020,1)
exten => 2020,n(FM2020),Macro(user-callerid,)
exten => 2020,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2020,n,Set(CONNECTEDLINE(num)=2020)
exten => 2020,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2020/cidname)})
exten => 2020,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2020@ext-local)})
exten => 2020,n,Set(__EXTTOCALL=${EXTEN})
exten => 2020,n,Set(__PICKUPMARK=${EXTEN})
exten => 2020,n,Macro(blkvm-setifempty,)
exten => 2020,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2020,n,Macro(blkvm-set,reset)
exten => 2020,n,Set(__NODEST=)
exten => 2020,n(skipov),Set(RRNODEST=${NODEST})
exten => 2020,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2020,n,GosubIf($[${DB_EXISTS(AMPUSER/2020/followme/changecid)} = 1 & "${DB(AMPUSER/2020/followme/changecid)}" != "default" & "${DB(AMPUSER/2020/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2020,n,Set(RecordMethod=Group)
exten => 2020,n(checkrecord),Gosub(sub-record-check,s,1(exten,2020,))
exten => 2020,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2020,n,Set(_FMGRP=2020)
exten => 2020,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2020/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2020,n,Macro(dial,$[ ${DB(AMPUSER/2020/followme/grptime)} + ${DB(AMPUSER/2020/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2020/followme/grplist)})
exten => 2020,n,Goto(nextstep)
exten => 2020,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2020/followme/grptime)} + ${DB(AMPUSER/2020/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2020/followme/grplist)},2020)
exten => 2020,n(nextstep),Set(RingGroupMethod=)
exten => 2020,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2020,n,Set(__NODEST=)
exten => 2020,n,Set(__PICKUPMARK=)
exten => 2020,n,Macro(blkvm-clr,)
exten => 2020,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 => 2020,n,Goto(ext-local,2020,dest)
exten => 2020,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2021,1,Goto(2021,FM2021)

exten => 2021,1,GotoIf($[ "${DB(AMPUSER/2021/followme/ddial)}" = "EXTENSION" ]?ext-local,2021,1)
exten => 2021,n(FM2021),Macro(user-callerid,)
exten => 2021,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2021,n,Set(CONNECTEDLINE(num)=2021)
exten => 2021,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2021/cidname)})
exten => 2021,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2021@ext-local)})
exten => 2021,n,Set(__EXTTOCALL=${EXTEN})
exten => 2021,n,Set(__PICKUPMARK=${EXTEN})
exten => 2021,n,Macro(blkvm-setifempty,)
exten => 2021,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2021,n,Macro(blkvm-set,reset)
exten => 2021,n,Set(__NODEST=)
exten => 2021,n(skipov),Set(RRNODEST=${NODEST})
exten => 2021,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2021,n,GosubIf($[${DB_EXISTS(AMPUSER/2021/followme/changecid)} = 1 & "${DB(AMPUSER/2021/followme/changecid)}" != "default" & "${DB(AMPUSER/2021/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2021,n,Set(RecordMethod=Group)
exten => 2021,n(checkrecord),Gosub(sub-record-check,s,1(exten,2021,))
exten => 2021,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2021,n,Set(_FMGRP=2021)
exten => 2021,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2021/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2021,n,Macro(dial,$[ ${DB(AMPUSER/2021/followme/grptime)} + ${DB(AMPUSER/2021/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2021/followme/grplist)})
exten => 2021,n,Goto(nextstep)
exten => 2021,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2021/followme/grptime)} + ${DB(AMPUSER/2021/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2021/followme/grplist)},2021)
exten => 2021,n(nextstep),Set(RingGroupMethod=)
exten => 2021,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2021,n,Set(__NODEST=)
exten => 2021,n,Set(__PICKUPMARK=)
exten => 2021,n,Macro(blkvm-clr,)
exten => 2021,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 => 2021,n,Goto(ext-local,2021,dest)
exten => 2021,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2022,1,Goto(2022,FM2022)

exten => 2022,1,GotoIf($[ "${DB(AMPUSER/2022/followme/ddial)}" = "EXTENSION" ]?ext-local,2022,1)
exten => 2022,n(FM2022),Macro(user-callerid,)
exten => 2022,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2022,n,Set(CONNECTEDLINE(num)=2022)
exten => 2022,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2022/cidname)})
exten => 2022,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2022@ext-local)})
exten => 2022,n,Set(__EXTTOCALL=${EXTEN})
exten => 2022,n,Set(__PICKUPMARK=${EXTEN})
exten => 2022,n,Macro(blkvm-setifempty,)
exten => 2022,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2022,n,Macro(blkvm-set,reset)
exten => 2022,n,Set(__NODEST=)
exten => 2022,n(skipov),Set(RRNODEST=${NODEST})
exten => 2022,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2022,n,GosubIf($[${DB_EXISTS(AMPUSER/2022/followme/changecid)} = 1 & "${DB(AMPUSER/2022/followme/changecid)}" != "default" & "${DB(AMPUSER/2022/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2022,n,Set(RecordMethod=Group)
exten => 2022,n(checkrecord),Gosub(sub-record-check,s,1(exten,2022,))
exten => 2022,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2022,n,Set(_FMGRP=2022)
exten => 2022,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2022/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2022,n,Macro(dial,$[ ${DB(AMPUSER/2022/followme/grptime)} + ${DB(AMPUSER/2022/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2022/followme/grplist)})
exten => 2022,n,Goto(nextstep)
exten => 2022,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2022/followme/grptime)} + ${DB(AMPUSER/2022/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2022/followme/grplist)},2022)
exten => 2022,n(nextstep),Set(RingGroupMethod=)
exten => 2022,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2022,n,Set(__NODEST=)
exten => 2022,n,Set(__PICKUPMARK=)
exten => 2022,n,Macro(blkvm-clr,)
exten => 2022,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 => 2022,n,Goto(ext-local,2022,dest)
exten => 2022,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2023,1,Goto(2023,FM2023)

exten => 2023,1,GotoIf($[ "${DB(AMPUSER/2023/followme/ddial)}" = "EXTENSION" ]?ext-local,2023,1)
exten => 2023,n(FM2023),Macro(user-callerid,)
exten => 2023,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2023,n,Set(CONNECTEDLINE(num)=2023)
exten => 2023,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2023/cidname)})
exten => 2023,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2023@ext-local)})
exten => 2023,n,Set(__EXTTOCALL=${EXTEN})
exten => 2023,n,Set(__PICKUPMARK=${EXTEN})
exten => 2023,n,Macro(blkvm-setifempty,)
exten => 2023,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2023,n,Macro(blkvm-set,reset)
exten => 2023,n,Set(__NODEST=)
exten => 2023,n(skipov),Set(RRNODEST=${NODEST})
exten => 2023,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2023,n,GosubIf($[${DB_EXISTS(AMPUSER/2023/followme/changecid)} = 1 & "${DB(AMPUSER/2023/followme/changecid)}" != "default" & "${DB(AMPUSER/2023/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2023,n,Set(RecordMethod=Group)
exten => 2023,n(checkrecord),Gosub(sub-record-check,s,1(exten,2023,))
exten => 2023,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2023,n,Set(_FMGRP=2023)
exten => 2023,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2023/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2023,n,Macro(dial,$[ ${DB(AMPUSER/2023/followme/grptime)} + ${DB(AMPUSER/2023/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2023/followme/grplist)})
exten => 2023,n,Goto(nextstep)
exten => 2023,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2023/followme/grptime)} + ${DB(AMPUSER/2023/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2023/followme/grplist)},2023)
exten => 2023,n(nextstep),Set(RingGroupMethod=)
exten => 2023,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2023,n,Set(__NODEST=)
exten => 2023,n,Set(__PICKUPMARK=)
exten => 2023,n,Macro(blkvm-clr,)
exten => 2023,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 => 2023,n,Goto(ext-local,2023,dest)
exten => 2023,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2024,1,Goto(2024,FM2024)

exten => 2024,1,GotoIf($[ "${DB(AMPUSER/2024/followme/ddial)}" = "EXTENSION" ]?ext-local,2024,1)
exten => 2024,n(FM2024),Macro(user-callerid,)
exten => 2024,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2024,n,Set(CONNECTEDLINE(num)=2024)
exten => 2024,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2024/cidname)})
exten => 2024,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2024@ext-local)})
exten => 2024,n,Set(__EXTTOCALL=${EXTEN})
exten => 2024,n,Set(__PICKUPMARK=${EXTEN})
exten => 2024,n,Macro(blkvm-setifempty,)
exten => 2024,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2024,n,Macro(blkvm-set,reset)
exten => 2024,n,Set(__NODEST=)
exten => 2024,n(skipov),Set(RRNODEST=${NODEST})
exten => 2024,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2024,n,GosubIf($[${DB_EXISTS(AMPUSER/2024/followme/changecid)} = 1 & "${DB(AMPUSER/2024/followme/changecid)}" != "default" & "${DB(AMPUSER/2024/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2024,n,Set(RecordMethod=Group)
exten => 2024,n(checkrecord),Gosub(sub-record-check,s,1(exten,2024,))
exten => 2024,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2024,n,Set(_FMGRP=2024)
exten => 2024,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2024/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2024,n,Macro(dial,$[ ${DB(AMPUSER/2024/followme/grptime)} + ${DB(AMPUSER/2024/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2024/followme/grplist)})
exten => 2024,n,Goto(nextstep)
exten => 2024,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2024/followme/grptime)} + ${DB(AMPUSER/2024/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2024/followme/grplist)},2024)
exten => 2024,n(nextstep),Set(RingGroupMethod=)
exten => 2024,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2024,n,Set(__NODEST=)
exten => 2024,n,Set(__PICKUPMARK=)
exten => 2024,n,Macro(blkvm-clr,)
exten => 2024,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 => 2024,n,Goto(ext-local,2024,dest)
exten => 2024,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2025,1,Goto(2025,FM2025)

exten => 2025,1,GotoIf($[ "${DB(AMPUSER/2025/followme/ddial)}" = "EXTENSION" ]?ext-local,2025,1)
exten => 2025,n(FM2025),Macro(user-callerid,)
exten => 2025,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2025,n,Set(CONNECTEDLINE(num)=2025)
exten => 2025,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2025/cidname)})
exten => 2025,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2025@ext-local)})
exten => 2025,n,Set(__EXTTOCALL=${EXTEN})
exten => 2025,n,Set(__PICKUPMARK=${EXTEN})
exten => 2025,n,Macro(blkvm-setifempty,)
exten => 2025,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2025,n,Macro(blkvm-set,reset)
exten => 2025,n,Set(__NODEST=)
exten => 2025,n(skipov),Set(RRNODEST=${NODEST})
exten => 2025,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2025,n,GosubIf($[${DB_EXISTS(AMPUSER/2025/followme/changecid)} = 1 & "${DB(AMPUSER/2025/followme/changecid)}" != "default" & "${DB(AMPUSER/2025/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2025,n,Set(RecordMethod=Group)
exten => 2025,n(checkrecord),Gosub(sub-record-check,s,1(exten,2025,))
exten => 2025,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2025,n,Set(_FMGRP=2025)
exten => 2025,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2025/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2025,n,Macro(dial,$[ ${DB(AMPUSER/2025/followme/grptime)} + ${DB(AMPUSER/2025/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2025/followme/grplist)})
exten => 2025,n,Goto(nextstep)
exten => 2025,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2025/followme/grptime)} + ${DB(AMPUSER/2025/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2025/followme/grplist)},2025)
exten => 2025,n(nextstep),Set(RingGroupMethod=)
exten => 2025,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2025,n,Set(__NODEST=)
exten => 2025,n,Set(__PICKUPMARK=)
exten => 2025,n,Macro(blkvm-clr,)
exten => 2025,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 => 2025,n,Goto(ext-local,2025,dest)
exten => 2025,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2026,1,Goto(2026,FM2026)

exten => 2026,1,GotoIf($[ "${DB(AMPUSER/2026/followme/ddial)}" = "EXTENSION" ]?ext-local,2026,1)
exten => 2026,n(FM2026),Macro(user-callerid,)
exten => 2026,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2026,n,Set(CONNECTEDLINE(num)=2026)
exten => 2026,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2026/cidname)})
exten => 2026,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2026@ext-local)})
exten => 2026,n,Set(__EXTTOCALL=${EXTEN})
exten => 2026,n,Set(__PICKUPMARK=${EXTEN})
exten => 2026,n,Macro(blkvm-setifempty,)
exten => 2026,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2026,n,Macro(blkvm-set,reset)
exten => 2026,n,Set(__NODEST=)
exten => 2026,n(skipov),Set(RRNODEST=${NODEST})
exten => 2026,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2026,n,GosubIf($[${DB_EXISTS(AMPUSER/2026/followme/changecid)} = 1 & "${DB(AMPUSER/2026/followme/changecid)}" != "default" & "${DB(AMPUSER/2026/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2026,n,Set(RecordMethod=Group)
exten => 2026,n(checkrecord),Gosub(sub-record-check,s,1(exten,2026,))
exten => 2026,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2026,n,Set(_FMGRP=2026)
exten => 2026,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2026/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2026,n,Macro(dial,$[ ${DB(AMPUSER/2026/followme/grptime)} + ${DB(AMPUSER/2026/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2026/followme/grplist)})
exten => 2026,n,Goto(nextstep)
exten => 2026,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2026/followme/grptime)} + ${DB(AMPUSER/2026/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2026/followme/grplist)},2026)
exten => 2026,n(nextstep),Set(RingGroupMethod=)
exten => 2026,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2026,n,Set(__NODEST=)
exten => 2026,n,Set(__PICKUPMARK=)
exten => 2026,n,Macro(blkvm-clr,)
exten => 2026,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 => 2026,n,Goto(ext-local,2026,dest)
exten => 2026,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2027,1,Goto(2027,FM2027)

exten => 2027,1,GotoIf($[ "${DB(AMPUSER/2027/followme/ddial)}" = "EXTENSION" ]?ext-local,2027,1)
exten => 2027,n(FM2027),Macro(user-callerid,)
exten => 2027,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2027,n,Set(CONNECTEDLINE(num)=2027)
exten => 2027,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2027/cidname)})
exten => 2027,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2027@ext-local)})
exten => 2027,n,Set(__EXTTOCALL=${EXTEN})
exten => 2027,n,Set(__PICKUPMARK=${EXTEN})
exten => 2027,n,Macro(blkvm-setifempty,)
exten => 2027,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2027,n,Macro(blkvm-set,reset)
exten => 2027,n,Set(__NODEST=)
exten => 2027,n(skipov),Set(RRNODEST=${NODEST})
exten => 2027,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2027,n,GosubIf($[${DB_EXISTS(AMPUSER/2027/followme/changecid)} = 1 & "${DB(AMPUSER/2027/followme/changecid)}" != "default" & "${DB(AMPUSER/2027/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2027,n,Set(RecordMethod=Group)
exten => 2027,n(checkrecord),Gosub(sub-record-check,s,1(exten,2027,))
exten => 2027,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2027,n,Set(_FMGRP=2027)
exten => 2027,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2027/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2027,n,Macro(dial,$[ ${DB(AMPUSER/2027/followme/grptime)} + ${DB(AMPUSER/2027/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2027/followme/grplist)})
exten => 2027,n,Goto(nextstep)
exten => 2027,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2027/followme/grptime)} + ${DB(AMPUSER/2027/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2027/followme/grplist)},2027)
exten => 2027,n(nextstep),Set(RingGroupMethod=)
exten => 2027,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2027,n,Set(__NODEST=)
exten => 2027,n,Set(__PICKUPMARK=)
exten => 2027,n,Macro(blkvm-clr,)
exten => 2027,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 => 2027,n,Goto(ext-local,2027,dest)
exten => 2027,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2028,1,Goto(2028,FM2028)

exten => 2028,1,GotoIf($[ "${DB(AMPUSER/2028/followme/ddial)}" = "EXTENSION" ]?ext-local,2028,1)
exten => 2028,n(FM2028),Macro(user-callerid,)
exten => 2028,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2028,n,Set(CONNECTEDLINE(num)=2028)
exten => 2028,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2028/cidname)})
exten => 2028,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2028@ext-local)})
exten => 2028,n,Set(__EXTTOCALL=${EXTEN})
exten => 2028,n,Set(__PICKUPMARK=${EXTEN})
exten => 2028,n,Macro(blkvm-setifempty,)
exten => 2028,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2028,n,Macro(blkvm-set,reset)
exten => 2028,n,Set(__NODEST=)
exten => 2028,n(skipov),Set(RRNODEST=${NODEST})
exten => 2028,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2028,n,GosubIf($[${DB_EXISTS(AMPUSER/2028/followme/changecid)} = 1 & "${DB(AMPUSER/2028/followme/changecid)}" != "default" & "${DB(AMPUSER/2028/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2028,n,Set(RecordMethod=Group)
exten => 2028,n(checkrecord),Gosub(sub-record-check,s,1(exten,2028,))
exten => 2028,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2028,n,Set(_FMGRP=2028)
exten => 2028,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2028/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2028,n,Macro(dial,$[ ${DB(AMPUSER/2028/followme/grptime)} + ${DB(AMPUSER/2028/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2028/followme/grplist)})
exten => 2028,n,Goto(nextstep)
exten => 2028,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2028/followme/grptime)} + ${DB(AMPUSER/2028/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2028/followme/grplist)},2028)
exten => 2028,n(nextstep),Set(RingGroupMethod=)
exten => 2028,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2028,n,Set(__NODEST=)
exten => 2028,n,Set(__PICKUPMARK=)
exten => 2028,n,Macro(blkvm-clr,)
exten => 2028,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 => 2028,n,Goto(ext-local,2028,dest)
exten => 2028,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2029,1,Goto(2029,FM2029)

exten => 2029,1,GotoIf($[ "${DB(AMPUSER/2029/followme/ddial)}" = "EXTENSION" ]?ext-local,2029,1)
exten => 2029,n(FM2029),Macro(user-callerid,)
exten => 2029,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2029,n,Set(CONNECTEDLINE(num)=2029)
exten => 2029,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2029/cidname)})
exten => 2029,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2029@ext-local)})
exten => 2029,n,Set(__EXTTOCALL=${EXTEN})
exten => 2029,n,Set(__PICKUPMARK=${EXTEN})
exten => 2029,n,Macro(blkvm-setifempty,)
exten => 2029,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2029,n,Macro(blkvm-set,reset)
exten => 2029,n,Set(__NODEST=)
exten => 2029,n(skipov),Set(RRNODEST=${NODEST})
exten => 2029,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2029,n,GosubIf($[${DB_EXISTS(AMPUSER/2029/followme/changecid)} = 1 & "${DB(AMPUSER/2029/followme/changecid)}" != "default" & "${DB(AMPUSER/2029/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2029,n,Set(RecordMethod=Group)
exten => 2029,n(checkrecord),Gosub(sub-record-check,s,1(exten,2029,))
exten => 2029,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2029,n,Set(_FMGRP=2029)
exten => 2029,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2029/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2029,n,Macro(dial,$[ ${DB(AMPUSER/2029/followme/grptime)} + ${DB(AMPUSER/2029/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2029/followme/grplist)})
exten => 2029,n,Goto(nextstep)
exten => 2029,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2029/followme/grptime)} + ${DB(AMPUSER/2029/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2029/followme/grplist)},2029)
exten => 2029,n(nextstep),Set(RingGroupMethod=)
exten => 2029,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2029,n,Set(__NODEST=)
exten => 2029,n,Set(__PICKUPMARK=)
exten => 2029,n,Macro(blkvm-clr,)
exten => 2029,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 => 2029,n,Goto(ext-local,2029,dest)
exten => 2029,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2030,1,Goto(2030,FM2030)

exten => 2030,1,GotoIf($[ "${DB(AMPUSER/2030/followme/ddial)}" = "EXTENSION" ]?ext-local,2030,1)
exten => 2030,n(FM2030),Macro(user-callerid,)
exten => 2030,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2030,n,Set(CONNECTEDLINE(num)=2030)
exten => 2030,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2030/cidname)})
exten => 2030,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2030@ext-local)})
exten => 2030,n,Set(__EXTTOCALL=${EXTEN})
exten => 2030,n,Set(__PICKUPMARK=${EXTEN})
exten => 2030,n,Macro(blkvm-setifempty,)
exten => 2030,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2030,n,Macro(blkvm-set,reset)
exten => 2030,n,Set(__NODEST=)
exten => 2030,n(skipov),Set(RRNODEST=${NODEST})
exten => 2030,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2030,n,GosubIf($[${DB_EXISTS(AMPUSER/2030/followme/changecid)} = 1 & "${DB(AMPUSER/2030/followme/changecid)}" != "default" & "${DB(AMPUSER/2030/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2030,n,Set(RecordMethod=Group)
exten => 2030,n(checkrecord),Gosub(sub-record-check,s,1(exten,2030,))
exten => 2030,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2030,n,Set(_FMGRP=2030)
exten => 2030,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2030/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2030,n,Macro(dial,$[ ${DB(AMPUSER/2030/followme/grptime)} + ${DB(AMPUSER/2030/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2030/followme/grplist)})
exten => 2030,n,Goto(nextstep)
exten => 2030,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2030/followme/grptime)} + ${DB(AMPUSER/2030/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2030/followme/grplist)},2030)
exten => 2030,n(nextstep),Set(RingGroupMethod=)
exten => 2030,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2030,n,Set(__NODEST=)
exten => 2030,n,Set(__PICKUPMARK=)
exten => 2030,n,Macro(blkvm-clr,)
exten => 2030,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 => 2030,n,Goto(ext-local,2030,dest)
exten => 2030,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2031,1,Goto(2031,FM2031)

exten => 2031,1,GotoIf($[ "${DB(AMPUSER/2031/followme/ddial)}" = "EXTENSION" ]?ext-local,2031,1)
exten => 2031,n(FM2031),Macro(user-callerid,)
exten => 2031,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2031,n,Set(CONNECTEDLINE(num)=2031)
exten => 2031,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2031/cidname)})
exten => 2031,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2031@ext-local)})
exten => 2031,n,Set(__EXTTOCALL=${EXTEN})
exten => 2031,n,Set(__PICKUPMARK=${EXTEN})
exten => 2031,n,Macro(blkvm-setifempty,)
exten => 2031,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2031,n,Macro(blkvm-set,reset)
exten => 2031,n,Set(__NODEST=)
exten => 2031,n(skipov),Set(RRNODEST=${NODEST})
exten => 2031,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2031,n,GosubIf($[${DB_EXISTS(AMPUSER/2031/followme/changecid)} = 1 & "${DB(AMPUSER/2031/followme/changecid)}" != "default" & "${DB(AMPUSER/2031/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2031,n,Set(RecordMethod=Group)
exten => 2031,n(checkrecord),Gosub(sub-record-check,s,1(exten,2031,))
exten => 2031,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2031,n,Set(_FMGRP=2031)
exten => 2031,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2031/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2031,n,Macro(dial,$[ ${DB(AMPUSER/2031/followme/grptime)} + ${DB(AMPUSER/2031/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2031/followme/grplist)})
exten => 2031,n,Goto(nextstep)
exten => 2031,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2031/followme/grptime)} + ${DB(AMPUSER/2031/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2031/followme/grplist)},2031)
exten => 2031,n(nextstep),Set(RingGroupMethod=)
exten => 2031,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2031,n,Set(__NODEST=)
exten => 2031,n,Set(__PICKUPMARK=)
exten => 2031,n,Macro(blkvm-clr,)
exten => 2031,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 => 2031,n,Goto(ext-local,2031,dest)
exten => 2031,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2032,1,Goto(2032,FM2032)

exten => 2032,1,GotoIf($[ "${DB(AMPUSER/2032/followme/ddial)}" = "EXTENSION" ]?ext-local,2032,1)
exten => 2032,n(FM2032),Macro(user-callerid,)
exten => 2032,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2032,n,Set(CONNECTEDLINE(num)=2032)
exten => 2032,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2032/cidname)})
exten => 2032,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2032@ext-local)})
exten => 2032,n,Set(__EXTTOCALL=${EXTEN})
exten => 2032,n,Set(__PICKUPMARK=${EXTEN})
exten => 2032,n,Macro(blkvm-setifempty,)
exten => 2032,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2032,n,Macro(blkvm-set,reset)
exten => 2032,n,Set(__NODEST=)
exten => 2032,n(skipov),Set(RRNODEST=${NODEST})
exten => 2032,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2032,n,GosubIf($[${DB_EXISTS(AMPUSER/2032/followme/changecid)} = 1 & "${DB(AMPUSER/2032/followme/changecid)}" != "default" & "${DB(AMPUSER/2032/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2032,n,Set(RecordMethod=Group)
exten => 2032,n(checkrecord),Gosub(sub-record-check,s,1(exten,2032,))
exten => 2032,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2032,n,Set(_FMGRP=2032)
exten => 2032,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2032/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2032,n,Macro(dial,$[ ${DB(AMPUSER/2032/followme/grptime)} + ${DB(AMPUSER/2032/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2032/followme/grplist)})
exten => 2032,n,Goto(nextstep)
exten => 2032,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2032/followme/grptime)} + ${DB(AMPUSER/2032/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2032/followme/grplist)},2032)
exten => 2032,n(nextstep),Set(RingGroupMethod=)
exten => 2032,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2032,n,Set(__NODEST=)
exten => 2032,n,Set(__PICKUPMARK=)
exten => 2032,n,Macro(blkvm-clr,)
exten => 2032,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 => 2032,n,Goto(ext-local,2032,dest)
exten => 2032,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2033,1,Goto(2033,FM2033)

exten => 2033,1,GotoIf($[ "${DB(AMPUSER/2033/followme/ddial)}" = "EXTENSION" ]?ext-local,2033,1)
exten => 2033,n(FM2033),Macro(user-callerid,)
exten => 2033,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2033,n,Set(CONNECTEDLINE(num)=2033)
exten => 2033,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2033/cidname)})
exten => 2033,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2033@ext-local)})
exten => 2033,n,Set(__EXTTOCALL=${EXTEN})
exten => 2033,n,Set(__PICKUPMARK=${EXTEN})
exten => 2033,n,Macro(blkvm-setifempty,)
exten => 2033,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2033,n,Macro(blkvm-set,reset)
exten => 2033,n,Set(__NODEST=)
exten => 2033,n(skipov),Set(RRNODEST=${NODEST})
exten => 2033,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2033,n,GosubIf($[${DB_EXISTS(AMPUSER/2033/followme/changecid)} = 1 & "${DB(AMPUSER/2033/followme/changecid)}" != "default" & "${DB(AMPUSER/2033/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2033,n,Set(RecordMethod=Group)
exten => 2033,n(checkrecord),Gosub(sub-record-check,s,1(exten,2033,))
exten => 2033,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2033,n,Set(_FMGRP=2033)
exten => 2033,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2033/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2033,n,Macro(dial,$[ ${DB(AMPUSER/2033/followme/grptime)} + ${DB(AMPUSER/2033/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2033/followme/grplist)})
exten => 2033,n,Goto(nextstep)
exten => 2033,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2033/followme/grptime)} + ${DB(AMPUSER/2033/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2033/followme/grplist)},2033)
exten => 2033,n(nextstep),Set(RingGroupMethod=)
exten => 2033,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2033,n,Set(__NODEST=)
exten => 2033,n,Set(__PICKUPMARK=)
exten => 2033,n,Macro(blkvm-clr,)
exten => 2033,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 => 2033,n,Goto(ext-local,2033,dest)
exten => 2033,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2034,1,Goto(2034,FM2034)

exten => 2034,1,GotoIf($[ "${DB(AMPUSER/2034/followme/ddial)}" = "EXTENSION" ]?ext-local,2034,1)
exten => 2034,n(FM2034),Macro(user-callerid,)
exten => 2034,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2034,n,Set(CONNECTEDLINE(num)=2034)
exten => 2034,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2034/cidname)})
exten => 2034,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2034@ext-local)})
exten => 2034,n,Set(__EXTTOCALL=${EXTEN})
exten => 2034,n,Set(__PICKUPMARK=${EXTEN})
exten => 2034,n,Macro(blkvm-setifempty,)
exten => 2034,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2034,n,Macro(blkvm-set,reset)
exten => 2034,n,Set(__NODEST=)
exten => 2034,n(skipov),Set(RRNODEST=${NODEST})
exten => 2034,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2034,n,GosubIf($[${DB_EXISTS(AMPUSER/2034/followme/changecid)} = 1 & "${DB(AMPUSER/2034/followme/changecid)}" != "default" & "${DB(AMPUSER/2034/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2034,n,Set(RecordMethod=Group)
exten => 2034,n(checkrecord),Gosub(sub-record-check,s,1(exten,2034,))
exten => 2034,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2034,n,Set(_FMGRP=2034)
exten => 2034,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2034/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2034,n,Macro(dial,$[ ${DB(AMPUSER/2034/followme/grptime)} + ${DB(AMPUSER/2034/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2034/followme/grplist)})
exten => 2034,n,Goto(nextstep)
exten => 2034,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2034/followme/grptime)} + ${DB(AMPUSER/2034/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2034/followme/grplist)},2034)
exten => 2034,n(nextstep),Set(RingGroupMethod=)
exten => 2034,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2034,n,Set(__NODEST=)
exten => 2034,n,Set(__PICKUPMARK=)
exten => 2034,n,Macro(blkvm-clr,)
exten => 2034,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 => 2034,n,Goto(ext-local,2034,dest)
exten => 2034,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2035,1,Goto(2035,FM2035)

exten => 2035,1,GotoIf($[ "${DB(AMPUSER/2035/followme/ddial)}" = "EXTENSION" ]?ext-local,2035,1)
exten => 2035,n(FM2035),Macro(user-callerid,)
exten => 2035,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2035,n,Set(CONNECTEDLINE(num)=2035)
exten => 2035,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2035/cidname)})
exten => 2035,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2035@ext-local)})
exten => 2035,n,Set(__EXTTOCALL=${EXTEN})
exten => 2035,n,Set(__PICKUPMARK=${EXTEN})
exten => 2035,n,Macro(blkvm-setifempty,)
exten => 2035,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2035,n,Macro(blkvm-set,reset)
exten => 2035,n,Set(__NODEST=)
exten => 2035,n(skipov),Set(RRNODEST=${NODEST})
exten => 2035,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2035,n,GosubIf($[${DB_EXISTS(AMPUSER/2035/followme/changecid)} = 1 & "${DB(AMPUSER/2035/followme/changecid)}" != "default" & "${DB(AMPUSER/2035/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2035,n,Set(RecordMethod=Group)
exten => 2035,n(checkrecord),Gosub(sub-record-check,s,1(exten,2035,))
exten => 2035,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2035,n,Set(_FMGRP=2035)
exten => 2035,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2035/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2035,n,Macro(dial,$[ ${DB(AMPUSER/2035/followme/grptime)} + ${DB(AMPUSER/2035/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2035/followme/grplist)})
exten => 2035,n,Goto(nextstep)
exten => 2035,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2035/followme/grptime)} + ${DB(AMPUSER/2035/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2035/followme/grplist)},2035)
exten => 2035,n(nextstep),Set(RingGroupMethod=)
exten => 2035,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2035,n,Set(__NODEST=)
exten => 2035,n,Set(__PICKUPMARK=)
exten => 2035,n,Macro(blkvm-clr,)
exten => 2035,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 => 2035,n,Goto(ext-local,2035,dest)
exten => 2035,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2036,1,Goto(2036,FM2036)

exten => 2036,1,GotoIf($[ "${DB(AMPUSER/2036/followme/ddial)}" = "EXTENSION" ]?ext-local,2036,1)
exten => 2036,n(FM2036),Macro(user-callerid,)
exten => 2036,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2036,n,Set(CONNECTEDLINE(num)=2036)
exten => 2036,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2036/cidname)})
exten => 2036,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2036@ext-local)})
exten => 2036,n,Set(__EXTTOCALL=${EXTEN})
exten => 2036,n,Set(__PICKUPMARK=${EXTEN})
exten => 2036,n,Macro(blkvm-setifempty,)
exten => 2036,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2036,n,Macro(blkvm-set,reset)
exten => 2036,n,Set(__NODEST=)
exten => 2036,n(skipov),Set(RRNODEST=${NODEST})
exten => 2036,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2036,n,GosubIf($[${DB_EXISTS(AMPUSER/2036/followme/changecid)} = 1 & "${DB(AMPUSER/2036/followme/changecid)}" != "default" & "${DB(AMPUSER/2036/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2036,n,Set(RecordMethod=Group)
exten => 2036,n(checkrecord),Gosub(sub-record-check,s,1(exten,2036,))
exten => 2036,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2036,n,Set(_FMGRP=2036)
exten => 2036,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2036/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2036,n,Macro(dial,$[ ${DB(AMPUSER/2036/followme/grptime)} + ${DB(AMPUSER/2036/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2036/followme/grplist)})
exten => 2036,n,Goto(nextstep)
exten => 2036,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2036/followme/grptime)} + ${DB(AMPUSER/2036/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2036/followme/grplist)},2036)
exten => 2036,n(nextstep),Set(RingGroupMethod=)
exten => 2036,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2036,n,Set(__NODEST=)
exten => 2036,n,Set(__PICKUPMARK=)
exten => 2036,n,Macro(blkvm-clr,)
exten => 2036,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 => 2036,n,Goto(ext-local,2036,dest)
exten => 2036,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2037,1,Goto(2037,FM2037)

exten => 2037,1,GotoIf($[ "${DB(AMPUSER/2037/followme/ddial)}" = "EXTENSION" ]?ext-local,2037,1)
exten => 2037,n(FM2037),Macro(user-callerid,)
exten => 2037,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2037,n,Set(CONNECTEDLINE(num)=2037)
exten => 2037,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2037/cidname)})
exten => 2037,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2037@ext-local)})
exten => 2037,n,Set(__EXTTOCALL=${EXTEN})
exten => 2037,n,Set(__PICKUPMARK=${EXTEN})
exten => 2037,n,Macro(blkvm-setifempty,)
exten => 2037,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2037,n,Macro(blkvm-set,reset)
exten => 2037,n,Set(__NODEST=)
exten => 2037,n(skipov),Set(RRNODEST=${NODEST})
exten => 2037,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2037,n,GosubIf($[${DB_EXISTS(AMPUSER/2037/followme/changecid)} = 1 & "${DB(AMPUSER/2037/followme/changecid)}" != "default" & "${DB(AMPUSER/2037/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2037,n,Set(RecordMethod=Group)
exten => 2037,n(checkrecord),Gosub(sub-record-check,s,1(exten,2037,))
exten => 2037,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2037,n,Set(_FMGRP=2037)
exten => 2037,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2037/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2037,n,Macro(dial,$[ ${DB(AMPUSER/2037/followme/grptime)} + ${DB(AMPUSER/2037/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2037/followme/grplist)})
exten => 2037,n,Goto(nextstep)
exten => 2037,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2037/followme/grptime)} + ${DB(AMPUSER/2037/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2037/followme/grplist)},2037)
exten => 2037,n(nextstep),Set(RingGroupMethod=)
exten => 2037,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2037,n,Set(__NODEST=)
exten => 2037,n,Set(__PICKUPMARK=)
exten => 2037,n,Macro(blkvm-clr,)
exten => 2037,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 => 2037,n,Goto(ext-local,2037,dest)
exten => 2037,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2038,1,Goto(2038,FM2038)

exten => 2038,1,GotoIf($[ "${DB(AMPUSER/2038/followme/ddial)}" = "EXTENSION" ]?ext-local,2038,1)
exten => 2038,n(FM2038),Macro(user-callerid,)
exten => 2038,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2038,n,Set(CONNECTEDLINE(num)=2038)
exten => 2038,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2038/cidname)})
exten => 2038,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2038@ext-local)})
exten => 2038,n,Set(__EXTTOCALL=${EXTEN})
exten => 2038,n,Set(__PICKUPMARK=${EXTEN})
exten => 2038,n,Macro(blkvm-setifempty,)
exten => 2038,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2038,n,Macro(blkvm-set,reset)
exten => 2038,n,Set(__NODEST=)
exten => 2038,n(skipov),Set(RRNODEST=${NODEST})
exten => 2038,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2038,n,GosubIf($[${DB_EXISTS(AMPUSER/2038/followme/changecid)} = 1 & "${DB(AMPUSER/2038/followme/changecid)}" != "default" & "${DB(AMPUSER/2038/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2038,n,Set(RecordMethod=Group)
exten => 2038,n(checkrecord),Gosub(sub-record-check,s,1(exten,2038,))
exten => 2038,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2038,n,Set(_FMGRP=2038)
exten => 2038,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2038/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2038,n,Macro(dial,$[ ${DB(AMPUSER/2038/followme/grptime)} + ${DB(AMPUSER/2038/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2038/followme/grplist)})
exten => 2038,n,Goto(nextstep)
exten => 2038,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2038/followme/grptime)} + ${DB(AMPUSER/2038/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2038/followme/grplist)},2038)
exten => 2038,n(nextstep),Set(RingGroupMethod=)
exten => 2038,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2038,n,Set(__NODEST=)
exten => 2038,n,Set(__PICKUPMARK=)
exten => 2038,n,Macro(blkvm-clr,)
exten => 2038,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 => 2038,n,Goto(ext-local,2038,dest)
exten => 2038,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2039,1,Goto(2039,FM2039)

exten => 2039,1,GotoIf($[ "${DB(AMPUSER/2039/followme/ddial)}" = "EXTENSION" ]?ext-local,2039,1)
exten => 2039,n(FM2039),Macro(user-callerid,)
exten => 2039,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2039,n,Set(CONNECTEDLINE(num)=2039)
exten => 2039,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2039/cidname)})
exten => 2039,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2039@ext-local)})
exten => 2039,n,Set(__EXTTOCALL=${EXTEN})
exten => 2039,n,Set(__PICKUPMARK=${EXTEN})
exten => 2039,n,Macro(blkvm-setifempty,)
exten => 2039,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2039,n,Macro(blkvm-set,reset)
exten => 2039,n,Set(__NODEST=)
exten => 2039,n(skipov),Set(RRNODEST=${NODEST})
exten => 2039,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2039,n,GosubIf($[${DB_EXISTS(AMPUSER/2039/followme/changecid)} = 1 & "${DB(AMPUSER/2039/followme/changecid)}" != "default" & "${DB(AMPUSER/2039/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2039,n,Set(RecordMethod=Group)
exten => 2039,n(checkrecord),Gosub(sub-record-check,s,1(exten,2039,))
exten => 2039,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2039,n,Set(_FMGRP=2039)
exten => 2039,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2039/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2039,n,Macro(dial,$[ ${DB(AMPUSER/2039/followme/grptime)} + ${DB(AMPUSER/2039/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2039/followme/grplist)})
exten => 2039,n,Goto(nextstep)
exten => 2039,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2039/followme/grptime)} + ${DB(AMPUSER/2039/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2039/followme/grplist)},2039)
exten => 2039,n(nextstep),Set(RingGroupMethod=)
exten => 2039,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2039,n,Set(__NODEST=)
exten => 2039,n,Set(__PICKUPMARK=)
exten => 2039,n,Macro(blkvm-clr,)
exten => 2039,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 => 2039,n,Goto(ext-local,2039,dest)
exten => 2039,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2040,1,Goto(2040,FM2040)

exten => 2040,1,GotoIf($[ "${DB(AMPUSER/2040/followme/ddial)}" = "EXTENSION" ]?ext-local,2040,1)
exten => 2040,n(FM2040),Macro(user-callerid,)
exten => 2040,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2040,n,Set(CONNECTEDLINE(num)=2040)
exten => 2040,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2040/cidname)})
exten => 2040,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2040@ext-local)})
exten => 2040,n,Set(__EXTTOCALL=${EXTEN})
exten => 2040,n,Set(__PICKUPMARK=${EXTEN})
exten => 2040,n,Macro(blkvm-setifempty,)
exten => 2040,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2040,n,Macro(blkvm-set,reset)
exten => 2040,n,Set(__NODEST=)
exten => 2040,n(skipov),Set(RRNODEST=${NODEST})
exten => 2040,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2040,n,GosubIf($[${DB_EXISTS(AMPUSER/2040/followme/changecid)} = 1 & "${DB(AMPUSER/2040/followme/changecid)}" != "default" & "${DB(AMPUSER/2040/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2040,n,Set(RecordMethod=Group)
exten => 2040,n(checkrecord),Gosub(sub-record-check,s,1(exten,2040,))
exten => 2040,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2040,n,Set(_FMGRP=2040)
exten => 2040,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2040/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2040,n,Macro(dial,$[ ${DB(AMPUSER/2040/followme/grptime)} + ${DB(AMPUSER/2040/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2040/followme/grplist)})
exten => 2040,n,Goto(nextstep)
exten => 2040,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2040/followme/grptime)} + ${DB(AMPUSER/2040/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2040/followme/grplist)},2040)
exten => 2040,n(nextstep),Set(RingGroupMethod=)
exten => 2040,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2040,n,Set(__NODEST=)
exten => 2040,n,Set(__PICKUPMARK=)
exten => 2040,n,Macro(blkvm-clr,)
exten => 2040,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 => 2040,n,Goto(ext-local,2040,dest)
exten => 2040,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2041,1,Goto(2041,FM2041)

exten => 2041,1,GotoIf($[ "${DB(AMPUSER/2041/followme/ddial)}" = "EXTENSION" ]?ext-local,2041,1)
exten => 2041,n(FM2041),Macro(user-callerid,)
exten => 2041,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2041,n,Set(CONNECTEDLINE(num)=2041)
exten => 2041,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2041/cidname)})
exten => 2041,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2041@ext-local)})
exten => 2041,n,Set(__EXTTOCALL=${EXTEN})
exten => 2041,n,Set(__PICKUPMARK=${EXTEN})
exten => 2041,n,Macro(blkvm-setifempty,)
exten => 2041,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2041,n,Macro(blkvm-set,reset)
exten => 2041,n,Set(__NODEST=)
exten => 2041,n(skipov),Set(RRNODEST=${NODEST})
exten => 2041,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2041,n,GosubIf($[${DB_EXISTS(AMPUSER/2041/followme/changecid)} = 1 & "${DB(AMPUSER/2041/followme/changecid)}" != "default" & "${DB(AMPUSER/2041/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2041,n,Set(RecordMethod=Group)
exten => 2041,n(checkrecord),Gosub(sub-record-check,s,1(exten,2041,))
exten => 2041,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2041,n,Set(_FMGRP=2041)
exten => 2041,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2041/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2041,n,Macro(dial,$[ ${DB(AMPUSER/2041/followme/grptime)} + ${DB(AMPUSER/2041/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2041/followme/grplist)})
exten => 2041,n,Goto(nextstep)
exten => 2041,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2041/followme/grptime)} + ${DB(AMPUSER/2041/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2041/followme/grplist)},2041)
exten => 2041,n(nextstep),Set(RingGroupMethod=)
exten => 2041,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2041,n,Set(__NODEST=)
exten => 2041,n,Set(__PICKUPMARK=)
exten => 2041,n,Macro(blkvm-clr,)
exten => 2041,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 => 2041,n,Goto(ext-local,2041,dest)
exten => 2041,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2042,1,Goto(2042,FM2042)

exten => 2042,1,GotoIf($[ "${DB(AMPUSER/2042/followme/ddial)}" = "EXTENSION" ]?ext-local,2042,1)
exten => 2042,n(FM2042),Macro(user-callerid,)
exten => 2042,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2042,n,Set(CONNECTEDLINE(num)=2042)
exten => 2042,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2042/cidname)})
exten => 2042,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2042@ext-local)})
exten => 2042,n,Set(__EXTTOCALL=${EXTEN})
exten => 2042,n,Set(__PICKUPMARK=${EXTEN})
exten => 2042,n,Macro(blkvm-setifempty,)
exten => 2042,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2042,n,Macro(blkvm-set,reset)
exten => 2042,n,Set(__NODEST=)
exten => 2042,n(skipov),Set(RRNODEST=${NODEST})
exten => 2042,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2042,n,GosubIf($[${DB_EXISTS(AMPUSER/2042/followme/changecid)} = 1 & "${DB(AMPUSER/2042/followme/changecid)}" != "default" & "${DB(AMPUSER/2042/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2042,n,Set(RecordMethod=Group)
exten => 2042,n(checkrecord),Gosub(sub-record-check,s,1(exten,2042,))
exten => 2042,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2042,n,Set(_FMGRP=2042)
exten => 2042,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2042/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2042,n,Macro(dial,$[ ${DB(AMPUSER/2042/followme/grptime)} + ${DB(AMPUSER/2042/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2042/followme/grplist)})
exten => 2042,n,Goto(nextstep)
exten => 2042,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2042/followme/grptime)} + ${DB(AMPUSER/2042/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2042/followme/grplist)},2042)
exten => 2042,n(nextstep),Set(RingGroupMethod=)
exten => 2042,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2042,n,Set(__NODEST=)
exten => 2042,n,Set(__PICKUPMARK=)
exten => 2042,n,Macro(blkvm-clr,)
exten => 2042,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 => 2042,n,Goto(ext-local,2042,dest)
exten => 2042,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2043,1,Goto(2043,FM2043)

exten => 2043,1,GotoIf($[ "${DB(AMPUSER/2043/followme/ddial)}" = "EXTENSION" ]?ext-local,2043,1)
exten => 2043,n(FM2043),Macro(user-callerid,)
exten => 2043,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2043,n,Set(CONNECTEDLINE(num)=2043)
exten => 2043,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2043/cidname)})
exten => 2043,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2043@ext-local)})
exten => 2043,n,Set(__EXTTOCALL=${EXTEN})
exten => 2043,n,Set(__PICKUPMARK=${EXTEN})
exten => 2043,n,Macro(blkvm-setifempty,)
exten => 2043,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2043,n,Macro(blkvm-set,reset)
exten => 2043,n,Set(__NODEST=)
exten => 2043,n(skipov),Set(RRNODEST=${NODEST})
exten => 2043,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2043,n,GosubIf($[${DB_EXISTS(AMPUSER/2043/followme/changecid)} = 1 & "${DB(AMPUSER/2043/followme/changecid)}" != "default" & "${DB(AMPUSER/2043/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2043,n,Set(RecordMethod=Group)
exten => 2043,n(checkrecord),Gosub(sub-record-check,s,1(exten,2043,))
exten => 2043,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2043,n,Set(_FMGRP=2043)
exten => 2043,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2043/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2043,n,Macro(dial,$[ ${DB(AMPUSER/2043/followme/grptime)} + ${DB(AMPUSER/2043/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2043/followme/grplist)})
exten => 2043,n,Goto(nextstep)
exten => 2043,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2043/followme/grptime)} + ${DB(AMPUSER/2043/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2043/followme/grplist)},2043)
exten => 2043,n(nextstep),Set(RingGroupMethod=)
exten => 2043,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2043,n,Set(__NODEST=)
exten => 2043,n,Set(__PICKUPMARK=)
exten => 2043,n,Macro(blkvm-clr,)
exten => 2043,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 => 2043,n,Goto(ext-local,2043,dest)
exten => 2043,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2044,1,Goto(2044,FM2044)

exten => 2044,1,GotoIf($[ "${DB(AMPUSER/2044/followme/ddial)}" = "EXTENSION" ]?ext-local,2044,1)
exten => 2044,n(FM2044),Macro(user-callerid,)
exten => 2044,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2044,n,Set(CONNECTEDLINE(num)=2044)
exten => 2044,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2044/cidname)})
exten => 2044,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2044@ext-local)})
exten => 2044,n,Set(__EXTTOCALL=${EXTEN})
exten => 2044,n,Set(__PICKUPMARK=${EXTEN})
exten => 2044,n,Macro(blkvm-setifempty,)
exten => 2044,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2044,n,Macro(blkvm-set,reset)
exten => 2044,n,Set(__NODEST=)
exten => 2044,n(skipov),Set(RRNODEST=${NODEST})
exten => 2044,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2044,n,GosubIf($[${DB_EXISTS(AMPUSER/2044/followme/changecid)} = 1 & "${DB(AMPUSER/2044/followme/changecid)}" != "default" & "${DB(AMPUSER/2044/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2044,n,Set(RecordMethod=Group)
exten => 2044,n(checkrecord),Gosub(sub-record-check,s,1(exten,2044,))
exten => 2044,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2044,n,Set(_FMGRP=2044)
exten => 2044,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2044/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2044,n,Macro(dial,$[ ${DB(AMPUSER/2044/followme/grptime)} + ${DB(AMPUSER/2044/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2044/followme/grplist)})
exten => 2044,n,Goto(nextstep)
exten => 2044,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2044/followme/grptime)} + ${DB(AMPUSER/2044/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2044/followme/grplist)},2044)
exten => 2044,n(nextstep),Set(RingGroupMethod=)
exten => 2044,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2044,n,Set(__NODEST=)
exten => 2044,n,Set(__PICKUPMARK=)
exten => 2044,n,Macro(blkvm-clr,)
exten => 2044,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 => 2044,n,Goto(ext-local,2044,dest)
exten => 2044,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2045,1,Goto(2045,FM2045)

exten => 2045,1,GotoIf($[ "${DB(AMPUSER/2045/followme/ddial)}" = "EXTENSION" ]?ext-local,2045,1)
exten => 2045,n(FM2045),Macro(user-callerid,)
exten => 2045,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2045,n,Set(CONNECTEDLINE(num)=2045)
exten => 2045,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2045/cidname)})
exten => 2045,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2045@ext-local)})
exten => 2045,n,Set(__EXTTOCALL=${EXTEN})
exten => 2045,n,Set(__PICKUPMARK=${EXTEN})
exten => 2045,n,Macro(blkvm-setifempty,)
exten => 2045,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2045,n,Macro(blkvm-set,reset)
exten => 2045,n,Set(__NODEST=)
exten => 2045,n(skipov),Set(RRNODEST=${NODEST})
exten => 2045,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2045,n,GosubIf($[${DB_EXISTS(AMPUSER/2045/followme/changecid)} = 1 & "${DB(AMPUSER/2045/followme/changecid)}" != "default" & "${DB(AMPUSER/2045/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2045,n,Set(RecordMethod=Group)
exten => 2045,n(checkrecord),Gosub(sub-record-check,s,1(exten,2045,))
exten => 2045,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2045,n,Set(_FMGRP=2045)
exten => 2045,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2045/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2045,n,Macro(dial,$[ ${DB(AMPUSER/2045/followme/grptime)} + ${DB(AMPUSER/2045/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2045/followme/grplist)})
exten => 2045,n,Goto(nextstep)
exten => 2045,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2045/followme/grptime)} + ${DB(AMPUSER/2045/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2045/followme/grplist)},2045)
exten => 2045,n(nextstep),Set(RingGroupMethod=)
exten => 2045,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2045,n,Set(__NODEST=)
exten => 2045,n,Set(__PICKUPMARK=)
exten => 2045,n,Macro(blkvm-clr,)
exten => 2045,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 => 2045,n,Goto(ext-local,2045,dest)
exten => 2045,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2046,1,Goto(2046,FM2046)

exten => 2046,1,GotoIf($[ "${DB(AMPUSER/2046/followme/ddial)}" = "EXTENSION" ]?ext-local,2046,1)
exten => 2046,n(FM2046),Macro(user-callerid,)
exten => 2046,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2046,n,Set(CONNECTEDLINE(num)=2046)
exten => 2046,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2046/cidname)})
exten => 2046,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2046@ext-local)})
exten => 2046,n,Set(__EXTTOCALL=${EXTEN})
exten => 2046,n,Set(__PICKUPMARK=${EXTEN})
exten => 2046,n,Macro(blkvm-setifempty,)
exten => 2046,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2046,n,Macro(blkvm-set,reset)
exten => 2046,n,Set(__NODEST=)
exten => 2046,n(skipov),Set(RRNODEST=${NODEST})
exten => 2046,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2046,n,GosubIf($[${DB_EXISTS(AMPUSER/2046/followme/changecid)} = 1 & "${DB(AMPUSER/2046/followme/changecid)}" != "default" & "${DB(AMPUSER/2046/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2046,n,Set(RecordMethod=Group)
exten => 2046,n(checkrecord),Gosub(sub-record-check,s,1(exten,2046,))
exten => 2046,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2046,n,Set(_FMGRP=2046)
exten => 2046,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2046/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2046,n,Macro(dial,$[ ${DB(AMPUSER/2046/followme/grptime)} + ${DB(AMPUSER/2046/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2046/followme/grplist)})
exten => 2046,n,Goto(nextstep)
exten => 2046,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2046/followme/grptime)} + ${DB(AMPUSER/2046/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2046/followme/grplist)},2046)
exten => 2046,n(nextstep),Set(RingGroupMethod=)
exten => 2046,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2046,n,Set(__NODEST=)
exten => 2046,n,Set(__PICKUPMARK=)
exten => 2046,n,Macro(blkvm-clr,)
exten => 2046,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 => 2046,n,Goto(ext-local,2046,dest)
exten => 2046,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2047,1,Goto(2047,FM2047)

exten => 2047,1,GotoIf($[ "${DB(AMPUSER/2047/followme/ddial)}" = "EXTENSION" ]?ext-local,2047,1)
exten => 2047,n(FM2047),Macro(user-callerid,)
exten => 2047,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2047,n,Set(CONNECTEDLINE(num)=2047)
exten => 2047,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2047/cidname)})
exten => 2047,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2047@ext-local)})
exten => 2047,n,Set(__EXTTOCALL=${EXTEN})
exten => 2047,n,Set(__PICKUPMARK=${EXTEN})
exten => 2047,n,Macro(blkvm-setifempty,)
exten => 2047,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2047,n,Macro(blkvm-set,reset)
exten => 2047,n,Set(__NODEST=)
exten => 2047,n(skipov),Set(RRNODEST=${NODEST})
exten => 2047,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2047,n,GosubIf($[${DB_EXISTS(AMPUSER/2047/followme/changecid)} = 1 & "${DB(AMPUSER/2047/followme/changecid)}" != "default" & "${DB(AMPUSER/2047/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2047,n,Set(RecordMethod=Group)
exten => 2047,n(checkrecord),Gosub(sub-record-check,s,1(exten,2047,))
exten => 2047,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2047,n,Set(_FMGRP=2047)
exten => 2047,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2047/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2047,n,Macro(dial,$[ ${DB(AMPUSER/2047/followme/grptime)} + ${DB(AMPUSER/2047/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2047/followme/grplist)})
exten => 2047,n,Goto(nextstep)
exten => 2047,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2047/followme/grptime)} + ${DB(AMPUSER/2047/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2047/followme/grplist)},2047)
exten => 2047,n(nextstep),Set(RingGroupMethod=)
exten => 2047,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2047,n,Set(__NODEST=)
exten => 2047,n,Set(__PICKUPMARK=)
exten => 2047,n,Macro(blkvm-clr,)
exten => 2047,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 => 2047,n,Goto(ext-local,2047,dest)
exten => 2047,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2048,1,Goto(2048,FM2048)

exten => 2048,1,GotoIf($[ "${DB(AMPUSER/2048/followme/ddial)}" = "EXTENSION" ]?ext-local,2048,1)
exten => 2048,n(FM2048),Macro(user-callerid,)
exten => 2048,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2048,n,Set(CONNECTEDLINE(num)=2048)
exten => 2048,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2048/cidname)})
exten => 2048,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2048@ext-local)})
exten => 2048,n,Set(__EXTTOCALL=${EXTEN})
exten => 2048,n,Set(__PICKUPMARK=${EXTEN})
exten => 2048,n,Macro(blkvm-setifempty,)
exten => 2048,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2048,n,Macro(blkvm-set,reset)
exten => 2048,n,Set(__NODEST=)
exten => 2048,n(skipov),Set(RRNODEST=${NODEST})
exten => 2048,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2048,n,GosubIf($[${DB_EXISTS(AMPUSER/2048/followme/changecid)} = 1 & "${DB(AMPUSER/2048/followme/changecid)}" != "default" & "${DB(AMPUSER/2048/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2048,n,Set(RecordMethod=Group)
exten => 2048,n(checkrecord),Gosub(sub-record-check,s,1(exten,2048,))
exten => 2048,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2048,n,Set(_FMGRP=2048)
exten => 2048,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2048/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2048,n,Macro(dial,$[ ${DB(AMPUSER/2048/followme/grptime)} + ${DB(AMPUSER/2048/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2048/followme/grplist)})
exten => 2048,n,Goto(nextstep)
exten => 2048,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2048/followme/grptime)} + ${DB(AMPUSER/2048/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2048/followme/grplist)},2048)
exten => 2048,n(nextstep),Set(RingGroupMethod=)
exten => 2048,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2048,n,Set(__NODEST=)
exten => 2048,n,Set(__PICKUPMARK=)
exten => 2048,n,Macro(blkvm-clr,)
exten => 2048,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 => 2048,n,Goto(ext-local,2048,dest)
exten => 2048,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM2049,1,Goto(2049,FM2049)

exten => 2049,1,GotoIf($[ "${DB(AMPUSER/2049/followme/ddial)}" = "EXTENSION" ]?ext-local,2049,1)
exten => 2049,n(FM2049),Macro(user-callerid,)
exten => 2049,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 2049,n,Set(CONNECTEDLINE(num)=2049)
exten => 2049,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/2049/cidname)})
exten => 2049,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(2049@ext-local)})
exten => 2049,n,Set(__EXTTOCALL=${EXTEN})
exten => 2049,n,Set(__PICKUPMARK=${EXTEN})
exten => 2049,n,Macro(blkvm-setifempty,)
exten => 2049,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 2049,n,Macro(blkvm-set,reset)
exten => 2049,n,Set(__NODEST=)
exten => 2049,n(skipov),Set(RRNODEST=${NODEST})
exten => 2049,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 2049,n,GosubIf($[${DB_EXISTS(AMPUSER/2049/followme/changecid)} = 1 & "${DB(AMPUSER/2049/followme/changecid)}" != "default" & "${DB(AMPUSER/2049/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 2049,n,Set(RecordMethod=Group)
exten => 2049,n(checkrecord),Gosub(sub-record-check,s,1(exten,2049,))
exten => 2049,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 2049,n,Set(_FMGRP=2049)
exten => 2049,n(DIALGRP),GotoIf($[("${DB(AMPUSER/2049/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 2049,n,Macro(dial,$[ ${DB(AMPUSER/2049/followme/grptime)} + ${DB(AMPUSER/2049/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2049/followme/grplist)})
exten => 2049,n,Goto(nextstep)
exten => 2049,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/2049/followme/grptime)} + ${DB(AMPUSER/2049/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/2049/followme/grplist)},2049)
exten => 2049,n(nextstep),Set(RingGroupMethod=)
exten => 2049,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 2049,n,Set(__NODEST=)
exten => 2049,n,Set(__PICKUPMARK=)
exten => 2049,n,Macro(blkvm-clr,)
exten => 2049,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 => 2049,n,Goto(ext-local,2049,dest)
exten => 2049,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM3010,1,Goto(3010,FM3010)

exten => 3010,1,GotoIf($[ "${DB(AMPUSER/3010/followme/ddial)}" = "EXTENSION" ]?ext-local,3010,1)
exten => 3010,n(FM3010),Macro(user-callerid,)
exten => 3010,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 3010,n,Set(CONNECTEDLINE(num)=3010)
exten => 3010,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/3010/cidname)})
exten => 3010,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(3010@ext-local)})
exten => 3010,n,Set(__EXTTOCALL=${EXTEN})
exten => 3010,n,Set(__PICKUPMARK=${EXTEN})
exten => 3010,n,Macro(blkvm-setifempty,)
exten => 3010,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 3010,n,Macro(blkvm-set,reset)
exten => 3010,n,Set(__NODEST=)
exten => 3010,n(skipov),Set(RRNODEST=${NODEST})
exten => 3010,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 3010,n,GosubIf($[${DB_EXISTS(AMPUSER/3010/followme/changecid)} = 1 & "${DB(AMPUSER/3010/followme/changecid)}" != "default" & "${DB(AMPUSER/3010/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 3010,n,Set(RecordMethod=Group)
exten => 3010,n(checkrecord),Gosub(sub-record-check,s,1(exten,3010,))
exten => 3010,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 3010,n,Set(_FMGRP=3010)
exten => 3010,n(DIALGRP),GotoIf($[("${DB(AMPUSER/3010/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 3010,n,Macro(dial,$[ ${DB(AMPUSER/3010/followme/grptime)} + ${DB(AMPUSER/3010/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/3010/followme/grplist)})
exten => 3010,n,Goto(nextstep)
exten => 3010,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/3010/followme/grptime)} + ${DB(AMPUSER/3010/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/3010/followme/grplist)},3010)
exten => 3010,n(nextstep),Set(RingGroupMethod=)
exten => 3010,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 3010,n,Set(__NODEST=)
exten => 3010,n,Set(__PICKUPMARK=)
exten => 3010,n,Macro(blkvm-clr,)
exten => 3010,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 => 3010,n,Goto(ext-local,3010,dest)
exten => 3010,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM3800,1,Goto(3800,FM3800)

exten => 3800,1,GotoIf($[ "${DB(AMPUSER/3800/followme/ddial)}" = "EXTENSION" ]?ext-local,3800,1)
exten => 3800,n(FM3800),Macro(user-callerid,)
exten => 3800,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 3800,n,Set(CONNECTEDLINE(num)=3800)
exten => 3800,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/3800/cidname)})
exten => 3800,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(3800@ext-local)})
exten => 3800,n,Set(__EXTTOCALL=${EXTEN})
exten => 3800,n,Set(__PICKUPMARK=${EXTEN})
exten => 3800,n,Macro(blkvm-setifempty,)
exten => 3800,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 3800,n,Macro(blkvm-set,reset)
exten => 3800,n,Set(__NODEST=)
exten => 3800,n(skipov),Set(RRNODEST=${NODEST})
exten => 3800,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 3800,n,GosubIf($[${DB_EXISTS(AMPUSER/3800/followme/changecid)} = 1 & "${DB(AMPUSER/3800/followme/changecid)}" != "default" & "${DB(AMPUSER/3800/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 3800,n,Set(RecordMethod=Group)
exten => 3800,n(checkrecord),Gosub(sub-record-check,s,1(exten,3800,))
exten => 3800,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 3800,n,Set(_FMGRP=3800)
exten => 3800,n(DIALGRP),GotoIf($[("${DB(AMPUSER/3800/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 3800,n,Macro(dial,$[ ${DB(AMPUSER/3800/followme/grptime)} + ${DB(AMPUSER/3800/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/3800/followme/grplist)})
exten => 3800,n,Goto(nextstep)
exten => 3800,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/3800/followme/grptime)} + ${DB(AMPUSER/3800/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/3800/followme/grplist)},3800)
exten => 3800,n(nextstep),Set(RingGroupMethod=)
exten => 3800,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 3800,n,Set(__NODEST=)
exten => 3800,n,Set(__PICKUPMARK=)
exten => 3800,n,Macro(blkvm-clr,)
exten => 3800,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 => 3800,n,Goto(ext-local,3800,dest)
exten => 3800,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM4000,1,Goto(4000,FM4000)

exten => 4000,1,GotoIf($[ "${DB(AMPUSER/4000/followme/ddial)}" = "EXTENSION" ]?ext-local,4000,1)
exten => 4000,n(FM4000),Macro(user-callerid,)
exten => 4000,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 4000,n,Set(CONNECTEDLINE(num)=4000)
exten => 4000,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/4000/cidname)})
exten => 4000,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(4000@ext-local)})
exten => 4000,n,Set(__EXTTOCALL=${EXTEN})
exten => 4000,n,Set(__PICKUPMARK=${EXTEN})
exten => 4000,n,Macro(blkvm-setifempty,)
exten => 4000,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 4000,n,Macro(blkvm-set,reset)
exten => 4000,n,Set(__NODEST=)
exten => 4000,n(skipov),Set(RRNODEST=${NODEST})
exten => 4000,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 4000,n,GosubIf($[${DB_EXISTS(AMPUSER/4000/followme/changecid)} = 1 & "${DB(AMPUSER/4000/followme/changecid)}" != "default" & "${DB(AMPUSER/4000/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 4000,n,Set(RecordMethod=Group)
exten => 4000,n(checkrecord),Gosub(sub-record-check,s,1(exten,4000,))
exten => 4000,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 4000,n,Set(_FMGRP=4000)
exten => 4000,n(DIALGRP),GotoIf($[("${DB(AMPUSER/4000/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 4000,n,Macro(dial,$[ ${DB(AMPUSER/4000/followme/grptime)} + ${DB(AMPUSER/4000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/4000/followme/grplist)})
exten => 4000,n,Goto(nextstep)
exten => 4000,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/4000/followme/grptime)} + ${DB(AMPUSER/4000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/4000/followme/grplist)},4000)
exten => 4000,n(nextstep),Set(RingGroupMethod=)
exten => 4000,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 4000,n,Set(__NODEST=)
exten => 4000,n,Set(__PICKUPMARK=)
exten => 4000,n,Macro(blkvm-clr,)
exten => 4000,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 => 4000,n,Goto(ext-local,4000,dest)
exten => 4000,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM5000,1,Goto(5000,FM5000)

exten => 5000,1,GotoIf($[ "${DB(AMPUSER/5000/followme/ddial)}" = "EXTENSION" ]?ext-local,5000,1)
exten => 5000,n(FM5000),Macro(user-callerid,)
exten => 5000,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 5000,n,Set(CONNECTEDLINE(num)=5000)
exten => 5000,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/5000/cidname)})
exten => 5000,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(5000@ext-local)})
exten => 5000,n,Set(__EXTTOCALL=${EXTEN})
exten => 5000,n,Set(__PICKUPMARK=${EXTEN})
exten => 5000,n,Macro(blkvm-setifempty,)
exten => 5000,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 5000,n,Macro(blkvm-set,reset)
exten => 5000,n,Set(__NODEST=)
exten => 5000,n(skipov),Set(RRNODEST=${NODEST})
exten => 5000,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 5000,n,GosubIf($[${DB_EXISTS(AMPUSER/5000/followme/changecid)} = 1 & "${DB(AMPUSER/5000/followme/changecid)}" != "default" & "${DB(AMPUSER/5000/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 5000,n,Set(RecordMethod=Group)
exten => 5000,n(checkrecord),Gosub(sub-record-check,s,1(exten,5000,))
exten => 5000,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 5000,n,Set(_FMGRP=5000)
exten => 5000,n(DIALGRP),GotoIf($[("${DB(AMPUSER/5000/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 5000,n,Macro(dial,$[ ${DB(AMPUSER/5000/followme/grptime)} + ${DB(AMPUSER/5000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/5000/followme/grplist)})
exten => 5000,n,Goto(nextstep)
exten => 5000,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/5000/followme/grptime)} + ${DB(AMPUSER/5000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/5000/followme/grplist)},5000)
exten => 5000,n(nextstep),Set(RingGroupMethod=)
exten => 5000,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 5000,n,Set(__NODEST=)
exten => 5000,n,Set(__PICKUPMARK=)
exten => 5000,n,Macro(blkvm-clr,)
exten => 5000,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 => 5000,n,Goto(ext-local,5000,dest)
exten => 5000,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM6000,1,Goto(6000,FM6000)

exten => 6000,1,GotoIf($[ "${DB(AMPUSER/6000/followme/ddial)}" = "EXTENSION" ]?ext-local,6000,1)
exten => 6000,n(FM6000),Macro(user-callerid,)
exten => 6000,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 6000,n,Set(CONNECTEDLINE(num)=6000)
exten => 6000,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/6000/cidname)})
exten => 6000,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(6000@ext-local)})
exten => 6000,n,Set(__EXTTOCALL=${EXTEN})
exten => 6000,n,Set(__PICKUPMARK=${EXTEN})
exten => 6000,n,Macro(blkvm-setifempty,)
exten => 6000,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 6000,n,Macro(blkvm-set,reset)
exten => 6000,n,Set(__NODEST=)
exten => 6000,n(skipov),Set(RRNODEST=${NODEST})
exten => 6000,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 6000,n,GosubIf($[${DB_EXISTS(AMPUSER/6000/followme/changecid)} = 1 & "${DB(AMPUSER/6000/followme/changecid)}" != "default" & "${DB(AMPUSER/6000/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 6000,n,Set(RecordMethod=Group)
exten => 6000,n(checkrecord),Gosub(sub-record-check,s,1(exten,6000,))
exten => 6000,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 6000,n,Set(_FMGRP=6000)
exten => 6000,n(DIALGRP),GotoIf($[("${DB(AMPUSER/6000/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 6000,n,Macro(dial,$[ ${DB(AMPUSER/6000/followme/grptime)} + ${DB(AMPUSER/6000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/6000/followme/grplist)})
exten => 6000,n,Goto(nextstep)
exten => 6000,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/6000/followme/grptime)} + ${DB(AMPUSER/6000/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/6000/followme/grplist)},6000)
exten => 6000,n(nextstep),Set(RingGroupMethod=)
exten => 6000,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 6000,n,Set(__NODEST=)
exten => 6000,n,Set(__PICKUPMARK=)
exten => 6000,n,Macro(blkvm-clr,)
exten => 6000,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 => 6000,n,Goto(ext-local,6000,dest)
exten => 6000,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

exten => FM7500,1,Goto(7500,FM7500)

exten => 7500,1,GotoIf($[ "${DB(AMPUSER/7500/followme/ddial)}" = "EXTENSION" ]?ext-local,7500,1)
exten => 7500,n(FM7500),Macro(user-callerid,)
exten => 7500,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}I)
exten => 7500,n,Set(CONNECTEDLINE(num)=7500)
exten => 7500,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/7500/cidname)})
exten => 7500,n,Set(FM_DIALSTATUS=${EXTENSION_STATE(7500@ext-local)})
exten => 7500,n,Set(__EXTTOCALL=${EXTEN})
exten => 7500,n,Set(__PICKUPMARK=${EXTEN})
exten => 7500,n,Macro(blkvm-setifempty,)
exten => 7500,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
exten => 7500,n,Macro(blkvm-set,reset)
exten => 7500,n,Set(__NODEST=)
exten => 7500,n(skipov),Set(RRNODEST=${NODEST})
exten => 7500,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 7500,n,GosubIf($[${DB_EXISTS(AMPUSER/7500/followme/changecid)} = 1 & "${DB(AMPUSER/7500/followme/changecid)}" != "default" & "${DB(AMPUSER/7500/followme/changecid)}" != ""]?sub-fmsetcid,s,1())
exten => 7500,n,Set(RecordMethod=Group)
exten => 7500,n(checkrecord),Gosub(sub-record-check,s,1(exten,7500,))
exten => 7500,n(skipsimple),Set(RingGroupMethod=ringallv2-prim)
exten => 7500,n,Set(_FMGRP=7500)
exten => 7500,n(DIALGRP),GotoIf($[("${DB(AMPUSER/7500/followme/grpconf)}"="ENABLED") | ("${FORCE_CONFIRM}"!="") ]?doconfirm)
exten => 7500,n,Macro(dial,$[ ${DB(AMPUSER/7500/followme/grptime)} + ${DB(AMPUSER/7500/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/7500/followme/grplist)})
exten => 7500,n,Goto(nextstep)
exten => 7500,n(doconfirm),Macro(dial-confirm,$[ ${DB(AMPUSER/7500/followme/grptime)} + ${DB(AMPUSER/7500/followme/prering)} ],${DIAL_OPTIONS},${DB(AMPUSER/7500/followme/grplist)},7500)
exten => 7500,n(nextstep),Set(RingGroupMethod=)
exten => 7500,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 7500,n,Set(__NODEST=)
exten => 7500,n,Set(__PICKUPMARK=)
exten => 7500,n,Macro(blkvm-clr,)
exten => 7500,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 => 7500,n,Goto(ext-local,7500,dest)
exten => 7500,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

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


[fmgrps]
exten => _RG-1001.,1,NoCDR()
exten => _RG-1001.,n,Macro(dial,${DB(AMPUSER/1001/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1001),${EXTEN:8})

exten => _RG-1002.,1,NoCDR()
exten => _RG-1002.,n,Macro(dial,${DB(AMPUSER/1002/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1002),${EXTEN:8})

exten => _RG-1003.,1,NoCDR()
exten => _RG-1003.,n,Macro(dial,${DB(AMPUSER/1003/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1003),${EXTEN:8})

exten => _RG-1004.,1,NoCDR()
exten => _RG-1004.,n,Macro(dial,${DB(AMPUSER/1004/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^1004),${EXTEN:8})

exten => _RG-2001.,1,NoCDR()
exten => _RG-2001.,n,Macro(dial,${DB(AMPUSER/2001/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2001),${EXTEN:8})

exten => _RG-2002.,1,NoCDR()
exten => _RG-2002.,n,Macro(dial,${DB(AMPUSER/2002/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2002),${EXTEN:8})

exten => _RG-2003.,1,NoCDR()
exten => _RG-2003.,n,Macro(dial,${DB(AMPUSER/2003/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2003),${EXTEN:8})

exten => _RG-2004.,1,NoCDR()
exten => _RG-2004.,n,Macro(dial,${DB(AMPUSER/2004/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2004),${EXTEN:8})

exten => _RG-2005.,1,NoCDR()
exten => _RG-2005.,n,Macro(dial,${DB(AMPUSER/2005/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2005),${EXTEN:8})

exten => _RG-2006.,1,NoCDR()
exten => _RG-2006.,n,Macro(dial,${DB(AMPUSER/2006/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2006),${EXTEN:8})

exten => _RG-2007.,1,NoCDR()
exten => _RG-2007.,n,Macro(dial,${DB(AMPUSER/2007/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2007),${EXTEN:8})

exten => _RG-2008.,1,NoCDR()
exten => _RG-2008.,n,Macro(dial,${DB(AMPUSER/2008/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2008),${EXTEN:8})

exten => _RG-2009.,1,NoCDR()
exten => _RG-2009.,n,Macro(dial,${DB(AMPUSER/2009/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2009),${EXTEN:8})

exten => _RG-2010.,1,NoCDR()
exten => _RG-2010.,n,Macro(dial,${DB(AMPUSER/2010/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2010),${EXTEN:8})

exten => _RG-2011.,1,NoCDR()
exten => _RG-2011.,n,Macro(dial,${DB(AMPUSER/2011/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2011),${EXTEN:8})

exten => _RG-2012.,1,NoCDR()
exten => _RG-2012.,n,Macro(dial,${DB(AMPUSER/2012/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2012),${EXTEN:8})

exten => _RG-2013.,1,NoCDR()
exten => _RG-2013.,n,Macro(dial,${DB(AMPUSER/2013/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2013),${EXTEN:8})

exten => _RG-2014.,1,NoCDR()
exten => _RG-2014.,n,Macro(dial,${DB(AMPUSER/2014/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2014),${EXTEN:8})

exten => _RG-2015.,1,NoCDR()
exten => _RG-2015.,n,Macro(dial,${DB(AMPUSER/2015/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2015),${EXTEN:8})

exten => _RG-2016.,1,NoCDR()
exten => _RG-2016.,n,Macro(dial,${DB(AMPUSER/2016/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2016),${EXTEN:8})

exten => _RG-2017.,1,NoCDR()
exten => _RG-2017.,n,Macro(dial,${DB(AMPUSER/2017/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2017),${EXTEN:8})

exten => _RG-2018.,1,NoCDR()
exten => _RG-2018.,n,Macro(dial,${DB(AMPUSER/2018/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2018),${EXTEN:8})

exten => _RG-2019.,1,NoCDR()
exten => _RG-2019.,n,Macro(dial,${DB(AMPUSER/2019/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2019),${EXTEN:8})

exten => _RG-2020.,1,NoCDR()
exten => _RG-2020.,n,Macro(dial,${DB(AMPUSER/2020/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2020),${EXTEN:8})

exten => _RG-2021.,1,NoCDR()
exten => _RG-2021.,n,Macro(dial,${DB(AMPUSER/2021/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2021),${EXTEN:8})

exten => _RG-2022.,1,NoCDR()
exten => _RG-2022.,n,Macro(dial,${DB(AMPUSER/2022/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2022),${EXTEN:8})

exten => _RG-2023.,1,NoCDR()
exten => _RG-2023.,n,Macro(dial,${DB(AMPUSER/2023/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2023),${EXTEN:8})

exten => _RG-2024.,1,NoCDR()
exten => _RG-2024.,n,Macro(dial,${DB(AMPUSER/2024/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2024),${EXTEN:8})

exten => _RG-2025.,1,NoCDR()
exten => _RG-2025.,n,Macro(dial,${DB(AMPUSER/2025/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2025),${EXTEN:8})

exten => _RG-2026.,1,NoCDR()
exten => _RG-2026.,n,Macro(dial,${DB(AMPUSER/2026/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2026),${EXTEN:8})

exten => _RG-2027.,1,NoCDR()
exten => _RG-2027.,n,Macro(dial,${DB(AMPUSER/2027/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2027),${EXTEN:8})

exten => _RG-2028.,1,NoCDR()
exten => _RG-2028.,n,Macro(dial,${DB(AMPUSER/2028/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2028),${EXTEN:8})

exten => _RG-2029.,1,NoCDR()
exten => _RG-2029.,n,Macro(dial,${DB(AMPUSER/2029/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2029),${EXTEN:8})

exten => _RG-2030.,1,NoCDR()
exten => _RG-2030.,n,Macro(dial,${DB(AMPUSER/2030/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2030),${EXTEN:8})

exten => _RG-2031.,1,NoCDR()
exten => _RG-2031.,n,Macro(dial,${DB(AMPUSER/2031/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2031),${EXTEN:8})

exten => _RG-2032.,1,NoCDR()
exten => _RG-2032.,n,Macro(dial,${DB(AMPUSER/2032/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2032),${EXTEN:8})

exten => _RG-2033.,1,NoCDR()
exten => _RG-2033.,n,Macro(dial,${DB(AMPUSER/2033/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2033),${EXTEN:8})

exten => _RG-2034.,1,NoCDR()
exten => _RG-2034.,n,Macro(dial,${DB(AMPUSER/2034/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2034),${EXTEN:8})

exten => _RG-2035.,1,NoCDR()
exten => _RG-2035.,n,Macro(dial,${DB(AMPUSER/2035/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2035),${EXTEN:8})

exten => _RG-2036.,1,NoCDR()
exten => _RG-2036.,n,Macro(dial,${DB(AMPUSER/2036/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2036),${EXTEN:8})

exten => _RG-2037.,1,NoCDR()
exten => _RG-2037.,n,Macro(dial,${DB(AMPUSER/2037/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2037),${EXTEN:8})

exten => _RG-2038.,1,NoCDR()
exten => _RG-2038.,n,Macro(dial,${DB(AMPUSER/2038/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2038),${EXTEN:8})

exten => _RG-2039.,1,NoCDR()
exten => _RG-2039.,n,Macro(dial,${DB(AMPUSER/2039/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2039),${EXTEN:8})

exten => _RG-2040.,1,NoCDR()
exten => _RG-2040.,n,Macro(dial,${DB(AMPUSER/2040/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2040),${EXTEN:8})

exten => _RG-2041.,1,NoCDR()
exten => _RG-2041.,n,Macro(dial,${DB(AMPUSER/2041/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2041),${EXTEN:8})

exten => _RG-2042.,1,NoCDR()
exten => _RG-2042.,n,Macro(dial,${DB(AMPUSER/2042/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2042),${EXTEN:8})

exten => _RG-2043.,1,NoCDR()
exten => _RG-2043.,n,Macro(dial,${DB(AMPUSER/2043/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2043),${EXTEN:8})

exten => _RG-2044.,1,NoCDR()
exten => _RG-2044.,n,Macro(dial,${DB(AMPUSER/2044/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2044),${EXTEN:8})

exten => _RG-2045.,1,NoCDR()
exten => _RG-2045.,n,Macro(dial,${DB(AMPUSER/2045/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2045),${EXTEN:8})

exten => _RG-2046.,1,NoCDR()
exten => _RG-2046.,n,Macro(dial,${DB(AMPUSER/2046/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2046),${EXTEN:8})

exten => _RG-2047.,1,NoCDR()
exten => _RG-2047.,n,Macro(dial,${DB(AMPUSER/2047/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2047),${EXTEN:8})

exten => _RG-2048.,1,NoCDR()
exten => _RG-2048.,n,Macro(dial,${DB(AMPUSER/2048/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2048),${EXTEN:8})

exten => _RG-2049.,1,NoCDR()
exten => _RG-2049.,n,Macro(dial,${DB(AMPUSER/2049/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^2049),${EXTEN:8})

exten => _RG-3010.,1,NoCDR()
exten => _RG-3010.,n,Macro(dial,${DB(AMPUSER/3010/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^3010),${EXTEN:8})

exten => _RG-3800.,1,NoCDR()
exten => _RG-3800.,n,Macro(dial,${DB(AMPUSER/3800/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^3800),${EXTEN:8})

exten => _RG-4000.,1,NoCDR()
exten => _RG-4000.,n,Macro(dial,${DB(AMPUSER/4000/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^4000),${EXTEN:8})

exten => _RG-5000.,1,NoCDR()
exten => _RG-5000.,n,Macro(dial,${DB(AMPUSER/5000/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^5000),${EXTEN:8})

exten => _RG-6000.,1,NoCDR()
exten => _RG-6000.,n,Macro(dial,${DB(AMPUSER/6000/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^6000),${EXTEN:8})

exten => _RG-7500.,1,NoCDR()
exten => _RG-7500.,n,Macro(dial,${DB(AMPUSER/7500/followme/grptime)},${DIAL_OPTIONS}M(confirm^^^7500),${EXTEN:8})

;--== end of [fmgrps] ==--;


[sub-fmsetcid]
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]
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] ==--;


[ext-featurecodes]
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 => *86,1,Goto(from-internal,*86,1)

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

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


[app-dnd-off]
exten => *79,1,Answer
exten => *79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => *79,n,Noop(Deleting: fop2state/${CHAN}) ${DB_DELETE(fop2state/${CHAN}))})
exten => *79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
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]
exten => *78,1,Answer
exten => *78,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => *78,n,Set(DB(fop2state/${CHAN})=Do not Disturb)
exten => *78,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Do not Disturb)
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]
exten => *76,1,Answer
exten => *76,n,Set(CHAN=${CUT(CHANNEL,-,1)})
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,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Do not Disturb)
exten => *76,n,Set(DB(fop2state/${CHAN})=Do not Disturb)
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,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
exten => *76,n,Noop(Deleting: fop2state/${CHAN} ${DB_DELETE(fop2state/${CHAN})})
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]
exten => *761001,1,Goto(app-dnd-toggle,*76,1)
exten => *761001,hint,Custom:DEVDND1001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


[app-queue-toggle]
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Set(QUEUESTAT=LOGGEDOUT)
exten => s,n,AGI(queue_devstate.agi,getqueues,${AMPUSER})
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(${CALLBACKNUM})
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/${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: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]
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]
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL,)
exten => s,n,Set(CALLBACKNUM=${AMPUSER})
exten => s,n,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,QueueLog(${QUEUENO},MANAGER,${IF($[${LEN(${AMPUSERCIDNAME})}>0]?${AMPUSERCIDNAME}:${AMPUSER})},REMOVEMEMBER,)
exten => s,n,MacroExit()

;--== end of [macro-toggle-del-agent] ==--;


[macro-toggle-add-agent]
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL,)
exten => s,n,Set(CALLBACKNUM=${AMPUSER})
exten => s,n,GotoIf($["${DB(QPENALTY/${QUEUENO}/dynmemberonly)}" = "yes" & ${DB_EXISTS(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})} != 1]?invalid)
exten => s,n,ExecIf($["${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(AMPUSER/${CALLBACKNUM}/queues/qnostate)}" = "ignorestate"]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})},,${DB(AMPUSER/${CALLBACKNUM}/cidname)}))
exten => s,n,UserEvent(AgentLogin,Agent: ${CALLBACKNUM})
exten => s,n,QueueLog(${QUEUENO},MANAGER,${IF($[${LEN(${AMPUSERCIDNAME})}>0]?${AMPUSERCIDNAME}:${AMPUSER})},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]
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Set(MEMBR=Local/${AMPUSER}@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]
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]
exten => 101,1,Macro(user-callerid,)
exten => 101,n,Answer
exten => 101,n,Macro(blkvm-set,reset)
exten => 101,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"]?Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)))
exten => 101,n,Set(__NODEST=${EXTEN})
exten => 101,n,Set(QCIDPP=${IF($[${LEN(${VQ_CIDPP})}>0]?${VQ_CIDPP}: )})
exten => 101,n,Set(VQ_CIDPP=)
exten => 101,n,ExecIf($["${QCIDPP}"!=""]?Macro(prepend-cid,${QCIDPP}))
exten => 101,n,Set(QAINFO=${IF($[${LEN(${VQ_AINFO})}>0]?${VQ_AINFO}: )})
exten => 101,n,Set(VQ_AINFO=)
exten => 101,n,ExecIf($["${QAINFO}"!=""]?Set(__ALERT_INFO=${QAINFO}))
exten => 101,n,Set(QJOINMSG=${IF($[${LEN(${VQ_JOINMSG})}>0]?${IF($["${VQ_JOINMSG}"!="0"]?${VQ_JOINMSG}: )}:custom/2)})
exten => 101,n,Set(VQ_JOINMSG=)
exten => 101,n,Set(QMOH=${IF($["${VQ_MOH}"!=""]?${VQ_MOH}: )})
exten => 101,n,Set(VQ_MOH=)
exten => 101,n,ExecIf($["${QMOH}"!=""]?Set(__MOHCLASS=${QMOH}))
exten => 101,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => 101,n,Set(QRETRY=${IF($[${LEN(${VQ_RETRY})}>0]?${VQ_RETRY}: )})
exten => 101,n,Set(VQ_RETRY=)
exten => 101,n(qoptions),Set(QOPTIONS=${IF($[${LEN(${VQ_OPTIONS})}>0]?${VQ_OPTIONS}:t)}${QCANCELMISSED}${QRINGOPTS}${QRETRY})
exten => 101,n,Set(VQ_OPTIONS=)
exten => 101,n(qgosub),Set(QGOSUB=${IF($[${LEN(${VQ_GOSUB})}>0]?${VQ_GOSUB}:${QGOSUB})})
exten => 101,n,Set(VQ_GOSUB=)
exten => 101,n(qagi),Set(QAGI=${IF($[${LEN(${VQ_AGI})}>0]?${VQ_AGI}:${QAGI})})
exten => 101,n,Set(VQ_AGI=)
exten => 101,n(qrule),Set(QRULE=${IF($[${LEN(${VQ_RULE})}>0]?${IF($["${VQ_RULE}"!="0"]?${VQ_RULE}: )}:${QRULE})})
exten => 101,n,Set(VQ_RULE=)
exten => 101,n(qposition),Set(QPOSITION=${IF($[${LEN(${VQ_POSITION})}>0]?${VQ_POSITION}:${QPOSITION})})
exten => 101,n,Set(VQ_POSITION=)
exten => 101,n,Set(__MIXMON_FORMAT=wav)
exten => 101,n,Gosub(sub-record-check,s,1(q,101,always))
exten => 101,n,ExecIf($["${QJOINMSG}"!="" && ${QUEUE_MEMBER(101,ready)}<1]?Playback(${QJOINMSG}, ))
exten => 101,n,QueueLog(101,${UNIQUEID},NONE,DID,${FROM_DID})
exten => 101,n,Set(QAANNOUNCE=${IF($[${LEN(${VQ_AANNOUNCE})}>0]?${IF($["${VQ_AANNOUNCE}"!="0"]?${VQ_AANNOUNCE}: )}: )})
exten => 101,n,Set(VQ_AANNOUNCE=)
exten => 101,n,Set(QMAXWAIT=${IF($[${LEN(${VQ_MAXWAIT})}>0]?${VQ_MAXWAIT}:50)})
exten => 101,n,Set(VQ_MAXWAIT=)
exten => 101,n(qcall),Queue(101,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})
exten => 101,n,Macro(blkvm-clr,)
exten => 101,n,Gosub(sub-record-cancel,s,1())
exten => 101,n,Set(__NODEST=)
exten => 101,n,Set(_QUEUE_PRIO=0)
exten => 101,n,Set(QDEST=${VQ_DEST})
exten => 101,n,Set(VQ_DEST=)
exten => 101,n(gotodest),GotoIf($["${QDEST}"=""]?ivr-3,s,1:${CUT(QDEST,^,1)},${CUT(QDEST,^,2)},${CUT(QDEST,^,3)})

exten => 101*,1,Macro(agent-add,101,)

exten => 101**,1,Macro(agent-del,101)

exten => *45101,1,Set(QUEUENO=101)
exten => *45101,n,Goto(app-queue-toggle,s,start)

exten => *46101,1,Gosub(app-queue-pause-toggle,s,1(101))

exten => 102,1,Macro(user-callerid,)
exten => 102,n,Answer
exten => 102,n,Macro(blkvm-set,reset)
exten => 102,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"]?Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)))
exten => 102,n,Set(__NODEST=${EXTEN})
exten => 102,n,Set(QCIDPP=${IF($[${LEN(${VQ_CIDPP})}>0]?${VQ_CIDPP}: )})
exten => 102,n,Set(VQ_CIDPP=)
exten => 102,n,ExecIf($["${QCIDPP}"!=""]?Macro(prepend-cid,${QCIDPP}))
exten => 102,n,Set(QAINFO=${IF($[${LEN(${VQ_AINFO})}>0]?${VQ_AINFO}: )})
exten => 102,n,Set(VQ_AINFO=)
exten => 102,n,ExecIf($["${QAINFO}"!=""]?Set(__ALERT_INFO=${QAINFO}))
exten => 102,n,Set(QJOINMSG=${IF($[${LEN(${VQ_JOINMSG})}>0]?${IF($["${VQ_JOINMSG}"!="0"]?${VQ_JOINMSG}: )}: )})
exten => 102,n,Set(VQ_JOINMSG=)
exten => 102,n,Set(QMOH=${IF($["${VQ_MOH}"!=""]?${VQ_MOH}: )})
exten => 102,n,Set(VQ_MOH=)
exten => 102,n,ExecIf($["${QMOH}"!=""]?Set(__MOHCLASS=${QMOH}))
exten => 102,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => 102,n,Set(QRETRY=${IF($[${LEN(${VQ_RETRY})}>0]?${VQ_RETRY}: )})
exten => 102,n,Set(VQ_RETRY=)
exten => 102,n(qoptions),Set(QOPTIONS=${IF($[${LEN(${VQ_OPTIONS})}>0]?${VQ_OPTIONS}:t)}${QCANCELMISSED}${QRINGOPTS}${QRETRY})
exten => 102,n,Set(VQ_OPTIONS=)
exten => 102,n(qgosub),Set(QGOSUB=${IF($[${LEN(${VQ_GOSUB})}>0]?${VQ_GOSUB}:${QGOSUB})})
exten => 102,n,Set(VQ_GOSUB=)
exten => 102,n(qagi),Set(QAGI=${IF($[${LEN(${VQ_AGI})}>0]?${VQ_AGI}:${QAGI})})
exten => 102,n,Set(VQ_AGI=)
exten => 102,n(qrule),Set(QRULE=${IF($[${LEN(${VQ_RULE})}>0]?${IF($["${VQ_RULE}"!="0"]?${VQ_RULE}: )}:${QRULE})})
exten => 102,n,Set(VQ_RULE=)
exten => 102,n(qposition),Set(QPOSITION=${IF($[${LEN(${VQ_POSITION})}>0]?${VQ_POSITION}:${QPOSITION})})
exten => 102,n,Set(VQ_POSITION=)
exten => 102,n,Gosub(sub-record-check,s,1(q,102,dontcare))
exten => 102,n,ExecIf($["${QJOINMSG}"!=""]?Playback(${QJOINMSG}, ))
exten => 102,n,QueueLog(102,${UNIQUEID},NONE,DID,${FROM_DID})
exten => 102,n,Set(QAANNOUNCE=${IF($[${LEN(${VQ_AANNOUNCE})}>0]?${IF($["${VQ_AANNOUNCE}"!="0"]?${VQ_AANNOUNCE}: )}: )})
exten => 102,n,Set(VQ_AANNOUNCE=)
exten => 102,n,Set(QMAXWAIT=${IF($[${LEN(${VQ_MAXWAIT})}>0]?${VQ_MAXWAIT}: )})
exten => 102,n,Set(VQ_MAXWAIT=)
exten => 102,n(qcall),Queue(102,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})
exten => 102,n,Macro(blkvm-clr,)
exten => 102,n,Gosub(sub-record-cancel,s,1())
exten => 102,n,Set(__NODEST=)
exten => 102,n,Set(_QUEUE_PRIO=0)
exten => 102,n,Set(QDEST=${VQ_DEST})
exten => 102,n,Set(VQ_DEST=)
exten => 102,n(gotodest),GotoIf($["${QDEST}"=""]?:${CUT(QDEST,^,1)},${CUT(QDEST,^,2)},${CUT(QDEST,^,3)})

exten => 102*,1,Macro(agent-add,102,)

exten => 102**,1,Macro(agent-del,102)

exten => *45102,1,Set(QUEUENO=102)
exten => *45102,n,Goto(app-queue-toggle,s,start)

exten => *46102,1,Gosub(app-queue-pause-toggle,s,1(102))

exten => *45,1,Goto(app-all-queue-toggle,s,start)

exten => _*45*X.,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1001,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1002,1,Goto(app-all-queue-toggle,s,start)
exten => *45*1002,hint,Custom:QUEUE1002*101

exten => *45*1003,1,Goto(app-all-queue-toggle,s,start)

exten => *45*1004,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2001,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2002,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2003,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2004,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2005,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2006,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2007,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2008,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2009,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2010,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2011,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2012,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2013,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2014,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2015,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2016,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2017,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2018,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2019,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2020,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2021,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2022,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2023,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2024,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2025,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2026,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2027,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2028,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2029,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2030,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2031,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2032,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2033,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2034,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2035,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2036,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2037,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2038,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2039,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2040,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2041,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2042,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2043,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2044,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2045,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2046,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2047,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2048,1,Goto(app-all-queue-toggle,s,start)

exten => *45*2049,1,Goto(app-all-queue-toggle,s,start)

exten => *45*3010,1,Goto(app-all-queue-toggle,s,start)

exten => *45*3800,1,Goto(app-all-queue-toggle,s,start)

exten => *45*4000,1,Goto(app-all-queue-toggle,s,start)

exten => *45*5000,1,Goto(app-all-queue-toggle,s,start)

exten => *45*6000,1,Goto(app-all-queue-toggle,s,start)

exten => *45*7500,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*1001,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1002*101,1,Gosub(app-queue-pause-toggle,s,1(101))
exten => *46*1002*101,hint,qpause:101:Local/1002@from-queue/n

exten => *46*1002,1,Goto(app-all-queue-pause-toggle,s,1)
exten => *46*1002,hint,qpause:101:Local/1002@from-queue/n

exten => *46*1003,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*1004,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2001,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2002*102,1,Gosub(app-queue-pause-toggle,s,1(102))
exten => *46*2002*102,hint,qpause:102:Local/2002@from-queue/n

exten => *46*2002,1,Goto(app-all-queue-pause-toggle,s,1)
exten => *46*2002,hint,qpause:102:Local/2002@from-queue/n

exten => *46*2003,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2004,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2005,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2006,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2007,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2008,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2009,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2010,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2011,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2012,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2013,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2014,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2015*102,1,Gosub(app-queue-pause-toggle,s,1(102))
exten => *46*2015*102,hint,qpause:102:Local/2015@from-queue/n

exten => *46*2015,1,Goto(app-all-queue-pause-toggle,s,1)
exten => *46*2015,hint,qpause:102:Local/2015@from-queue/n

exten => *46*2016,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2017,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2018,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2019,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2020,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2021,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2022,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2023,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2024,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2025,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2026,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2027,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2028,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2029,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2030,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2031,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2032,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2033,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2034,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2035,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2036,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2037,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2038,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2039,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2040,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2041,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2042,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2043,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2044,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2045,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2046,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2047,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2048,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*2049,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*3010,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*3800,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*4000,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*5000,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*6000,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *46*7500,1,Goto(app-all-queue-pause-toggle,s,1)

exten => *47*1001*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*1001*101,n,Hangup

exten => *47*1001*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*1001*102,n,Hangup

exten => *47*1001,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*1001,n,Hangup

exten => *47*1002*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*1002*101,n,Hangup

exten => *47*1002*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*1002*102,n,Hangup

exten => *47*1002,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*1002,n,Hangup

exten => *47*1003*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*1003*101,n,Hangup

exten => *47*1003*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*1003*102,n,Hangup

exten => *47*1003,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*1003,n,Hangup

exten => *47*1004*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*1004*101,n,Hangup

exten => *47*1004*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*1004*102,n,Hangup

exten => *47*1004,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*1004,n,Hangup

exten => *47*2001*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2001*101,n,Hangup

exten => *47*2001*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2001*102,n,Hangup

exten => *47*2001,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2001,n,Hangup

exten => *47*2002*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2002*101,n,Hangup

exten => *47*2002*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2002*102,n,Hangup

exten => *47*2002,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2002,n,Hangup

exten => *47*2003*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2003*101,n,Hangup

exten => *47*2003*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2003*102,n,Hangup

exten => *47*2003,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2003,n,Hangup

exten => *47*2004*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2004*101,n,Hangup

exten => *47*2004*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2004*102,n,Hangup

exten => *47*2004,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2004,n,Hangup

exten => *47*2005*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2005*101,n,Hangup

exten => *47*2005*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2005*102,n,Hangup

exten => *47*2005,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2005,n,Hangup

exten => *47*2006*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2006*101,n,Hangup

exten => *47*2006*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2006*102,n,Hangup

exten => *47*2006,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2006,n,Hangup

exten => *47*2007*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2007*101,n,Hangup

exten => *47*2007*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2007*102,n,Hangup

exten => *47*2007,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2007,n,Hangup

exten => *47*2008*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2008*101,n,Hangup

exten => *47*2008*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2008*102,n,Hangup

exten => *47*2008,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2008,n,Hangup

exten => *47*2009*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2009*101,n,Hangup

exten => *47*2009*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2009*102,n,Hangup

exten => *47*2009,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2009,n,Hangup

exten => *47*2010*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2010*101,n,Hangup

exten => *47*2010*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2010*102,n,Hangup

exten => *47*2010,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2010,n,Hangup

exten => *47*2011*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2011*101,n,Hangup

exten => *47*2011*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2011*102,n,Hangup

exten => *47*2011,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2011,n,Hangup

exten => *47*2012*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2012*101,n,Hangup

exten => *47*2012*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2012*102,n,Hangup

exten => *47*2012,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2012,n,Hangup

exten => *47*2013*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2013*101,n,Hangup

exten => *47*2013*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2013*102,n,Hangup

exten => *47*2013,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2013,n,Hangup

exten => *47*2014*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2014*101,n,Hangup

exten => *47*2014*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2014*102,n,Hangup

exten => *47*2014,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2014,n,Hangup

exten => *47*2015*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2015*101,n,Hangup

exten => *47*2015*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2015*102,n,Hangup

exten => *47*2015,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2015,n,Hangup

exten => *47*2016*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2016*101,n,Hangup

exten => *47*2016*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2016*102,n,Hangup

exten => *47*2016,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2016,n,Hangup

exten => *47*2017*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2017*101,n,Hangup

exten => *47*2017*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2017*102,n,Hangup

exten => *47*2017,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2017,n,Hangup

exten => *47*2018*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2018*101,n,Hangup

exten => *47*2018*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2018*102,n,Hangup

exten => *47*2018,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2018,n,Hangup

exten => *47*2019*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2019*101,n,Hangup

exten => *47*2019*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2019*102,n,Hangup

exten => *47*2019,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2019,n,Hangup

exten => *47*2020*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2020*101,n,Hangup

exten => *47*2020*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2020*102,n,Hangup

exten => *47*2020,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2020,n,Hangup

exten => *47*2021*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2021*101,n,Hangup

exten => *47*2021*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2021*102,n,Hangup

exten => *47*2021,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2021,n,Hangup

exten => *47*2022*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2022*101,n,Hangup

exten => *47*2022*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2022*102,n,Hangup

exten => *47*2022,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2022,n,Hangup

exten => *47*2023*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2023*101,n,Hangup

exten => *47*2023*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2023*102,n,Hangup

exten => *47*2023,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2023,n,Hangup

exten => *47*2024*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2024*101,n,Hangup

exten => *47*2024*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2024*102,n,Hangup

exten => *47*2024,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2024,n,Hangup

exten => *47*2025*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2025*101,n,Hangup

exten => *47*2025*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2025*102,n,Hangup

exten => *47*2025,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2025,n,Hangup

exten => *47*2026*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2026*101,n,Hangup

exten => *47*2026*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2026*102,n,Hangup

exten => *47*2026,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2026,n,Hangup

exten => *47*2027*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2027*101,n,Hangup

exten => *47*2027*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2027*102,n,Hangup

exten => *47*2027,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2027,n,Hangup

exten => *47*2028*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2028*101,n,Hangup

exten => *47*2028*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2028*102,n,Hangup

exten => *47*2028,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2028,n,Hangup

exten => *47*2029*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2029*101,n,Hangup

exten => *47*2029*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2029*102,n,Hangup

exten => *47*2029,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2029,n,Hangup

exten => *47*2030*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2030*101,n,Hangup

exten => *47*2030*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2030*102,n,Hangup

exten => *47*2030,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2030,n,Hangup

exten => *47*2031*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2031*101,n,Hangup

exten => *47*2031*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2031*102,n,Hangup

exten => *47*2031,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2031,n,Hangup

exten => *47*2032*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2032*101,n,Hangup

exten => *47*2032*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2032*102,n,Hangup

exten => *47*2032,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2032,n,Hangup

exten => *47*2033*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2033*101,n,Hangup

exten => *47*2033*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2033*102,n,Hangup

exten => *47*2033,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2033,n,Hangup

exten => *47*2034*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2034*101,n,Hangup

exten => *47*2034*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2034*102,n,Hangup

exten => *47*2034,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2034,n,Hangup

exten => *47*2035*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2035*101,n,Hangup

exten => *47*2035*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2035*102,n,Hangup

exten => *47*2035,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2035,n,Hangup

exten => *47*2036*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2036*101,n,Hangup

exten => *47*2036*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2036*102,n,Hangup

exten => *47*2036,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2036,n,Hangup

exten => *47*2037*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2037*101,n,Hangup

exten => *47*2037*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2037*102,n,Hangup

exten => *47*2037,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2037,n,Hangup

exten => *47*2038*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2038*101,n,Hangup

exten => *47*2038*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2038*102,n,Hangup

exten => *47*2038,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2038,n,Hangup

exten => *47*2039*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2039*101,n,Hangup

exten => *47*2039*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2039*102,n,Hangup

exten => *47*2039,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2039,n,Hangup

exten => *47*2040*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2040*101,n,Hangup

exten => *47*2040*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2040*102,n,Hangup

exten => *47*2040,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2040,n,Hangup

exten => *47*2041*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2041*101,n,Hangup

exten => *47*2041*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2041*102,n,Hangup

exten => *47*2041,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2041,n,Hangup

exten => *47*2042*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2042*101,n,Hangup

exten => *47*2042*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2042*102,n,Hangup

exten => *47*2042,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2042,n,Hangup

exten => *47*2043*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2043*101,n,Hangup

exten => *47*2043*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2043*102,n,Hangup

exten => *47*2043,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2043,n,Hangup

exten => *47*2044*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2044*101,n,Hangup

exten => *47*2044*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2044*102,n,Hangup

exten => *47*2044,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2044,n,Hangup

exten => *47*2045*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2045*101,n,Hangup

exten => *47*2045*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2045*102,n,Hangup

exten => *47*2045,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2045,n,Hangup

exten => *47*2046*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2046*101,n,Hangup

exten => *47*2046*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2046*102,n,Hangup

exten => *47*2046,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2046,n,Hangup

exten => *47*2047*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2047*101,n,Hangup

exten => *47*2047*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2047*102,n,Hangup

exten => *47*2047,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2047,n,Hangup

exten => *47*2048*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2048*101,n,Hangup

exten => *47*2048*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2048*102,n,Hangup

exten => *47*2048,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2048,n,Hangup

exten => *47*2049*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*2049*101,n,Hangup

exten => *47*2049*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*2049*102,n,Hangup

exten => *47*2049,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*2049,n,Hangup

exten => *47*3010*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*3010*101,n,Hangup

exten => *47*3010*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*3010*102,n,Hangup

exten => *47*3010,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*3010,n,Hangup

exten => *47*3800*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*3800*101,n,Hangup

exten => *47*3800*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*3800*102,n,Hangup

exten => *47*3800,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*3800,n,Hangup

exten => *47*4000*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*4000*101,n,Hangup

exten => *47*4000*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*4000*102,n,Hangup

exten => *47*4000,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*4000,n,Hangup

exten => *47*5000*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*5000*101,n,Hangup

exten => *47*5000*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*5000*102,n,Hangup

exten => *47*5000,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*5000,n,Hangup

exten => *47*6000*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*6000*101,n,Hangup

exten => *47*6000*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*6000*102,n,Hangup

exten => *47*6000,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*6000,n,Hangup

exten => *47*7500*101,1,Gosub(app-queue-caller-count,s,1(101))
exten => *47*7500*101,n,Hangup

exten => *47*7500*102,1,Gosub(app-queue-caller-count,s,1(102))
exten => *47*7500*102,n,Hangup

exten => *47*7500,1,Gosub(app-queue-caller-count,s,1(101&102))
exten => *47*7500,n,Hangup

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

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


[from-queue]
exten => 101,1,Goto(from-internal,${QAGENT},1)

exten => 102,1,Goto(from-internal,${QAGENT},1)

exten => _.,1,Set(QAGENT=${EXTEN})
exten => _.,n,Goto(${NODEST},1)

;--== end of [from-queue] ==--;


[app-queue-caller-count]
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-only
include => from-internal
exten => foo,1,Noop(bar)

;--== end of [from-queue-exten-internal] ==--;


[from-queue-exten-only]
exten => 1001,1,Set(RingGroupMethod=none)
exten => 1001,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1001,n(checkrecord),Gosub(sub-record-check,s,1(exten,1001))
exten => 1001,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1001)
exten => 1001,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1001,n,Hangup

exten => 1002,1,Set(RingGroupMethod=none)
exten => 1002,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1002,n(checkrecord),Gosub(sub-record-check,s,1(exten,1002))
exten => 1002,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1002)
exten => 1002,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1002,n,Hangup

exten => 1003,1,Set(RingGroupMethod=none)
exten => 1003,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1003,n(checkrecord),Gosub(sub-record-check,s,1(exten,1003))
exten => 1003,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1003)
exten => 1003,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1003,n,Hangup

exten => 1004,1,Set(RingGroupMethod=none)
exten => 1004,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 1004,n(checkrecord),Gosub(sub-record-check,s,1(exten,1004))
exten => 1004,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},1004)
exten => 1004,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 1004,n,Hangup

exten => 2001,1,Set(RingGroupMethod=none)
exten => 2001,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2001,n(checkrecord),Gosub(sub-record-check,s,1(exten,2001))
exten => 2001,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2001)
exten => 2001,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2001,n,Hangup

exten => 2002,1,Set(RingGroupMethod=none)
exten => 2002,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2002,n(checkrecord),Gosub(sub-record-check,s,1(exten,2002))
exten => 2002,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2002)
exten => 2002,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2002,n,Hangup

exten => 2003,1,Set(RingGroupMethod=none)
exten => 2003,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2003,n(checkrecord),Gosub(sub-record-check,s,1(exten,2003))
exten => 2003,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2003)
exten => 2003,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2003,n,Hangup

exten => 2004,1,Set(RingGroupMethod=none)
exten => 2004,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2004,n(checkrecord),Gosub(sub-record-check,s,1(exten,2004))
exten => 2004,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2004)
exten => 2004,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2004,n,Hangup

exten => 2005,1,Set(RingGroupMethod=none)
exten => 2005,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2005,n(checkrecord),Gosub(sub-record-check,s,1(exten,2005))
exten => 2005,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2005)
exten => 2005,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2005,n,Hangup

exten => 2006,1,Set(RingGroupMethod=none)
exten => 2006,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2006,n(checkrecord),Gosub(sub-record-check,s,1(exten,2006))
exten => 2006,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2006)
exten => 2006,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2006,n,Hangup

exten => 2007,1,Set(RingGroupMethod=none)
exten => 2007,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2007,n(checkrecord),Gosub(sub-record-check,s,1(exten,2007))
exten => 2007,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2007)
exten => 2007,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2007,n,Hangup

exten => 2008,1,Set(RingGroupMethod=none)
exten => 2008,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2008,n(checkrecord),Gosub(sub-record-check,s,1(exten,2008))
exten => 2008,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2008)
exten => 2008,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2008,n,Hangup

exten => 2009,1,Set(RingGroupMethod=none)
exten => 2009,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2009,n(checkrecord),Gosub(sub-record-check,s,1(exten,2009))
exten => 2009,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2009)
exten => 2009,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2009,n,Hangup

exten => 2010,1,Set(RingGroupMethod=none)
exten => 2010,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2010,n(checkrecord),Gosub(sub-record-check,s,1(exten,2010))
exten => 2010,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2010)
exten => 2010,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2010,n,Hangup

exten => 2011,1,Set(RingGroupMethod=none)
exten => 2011,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2011,n(checkrecord),Gosub(sub-record-check,s,1(exten,2011))
exten => 2011,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2011)
exten => 2011,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2011,n,Hangup

exten => 2012,1,Set(RingGroupMethod=none)
exten => 2012,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2012,n(checkrecord),Gosub(sub-record-check,s,1(exten,2012))
exten => 2012,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2012)
exten => 2012,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2012,n,Hangup

exten => 2013,1,Set(RingGroupMethod=none)
exten => 2013,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2013,n(checkrecord),Gosub(sub-record-check,s,1(exten,2013))
exten => 2013,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2013)
exten => 2013,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2013,n,Hangup

exten => 2014,1,Set(RingGroupMethod=none)
exten => 2014,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2014,n(checkrecord),Gosub(sub-record-check,s,1(exten,2014))
exten => 2014,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2014)
exten => 2014,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2014,n,Hangup

exten => 2015,1,Set(RingGroupMethod=none)
exten => 2015,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2015,n(checkrecord),Gosub(sub-record-check,s,1(exten,2015))
exten => 2015,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2015)
exten => 2015,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2015,n,Hangup

exten => 2016,1,Set(RingGroupMethod=none)
exten => 2016,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2016,n(checkrecord),Gosub(sub-record-check,s,1(exten,2016))
exten => 2016,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2016)
exten => 2016,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2016,n,Hangup

exten => 2017,1,Set(RingGroupMethod=none)
exten => 2017,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2017,n(checkrecord),Gosub(sub-record-check,s,1(exten,2017))
exten => 2017,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2017)
exten => 2017,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2017,n,Hangup

exten => 2018,1,Set(RingGroupMethod=none)
exten => 2018,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2018,n(checkrecord),Gosub(sub-record-check,s,1(exten,2018))
exten => 2018,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2018)
exten => 2018,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2018,n,Hangup

exten => 2019,1,Set(RingGroupMethod=none)
exten => 2019,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2019,n(checkrecord),Gosub(sub-record-check,s,1(exten,2019))
exten => 2019,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2019)
exten => 2019,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2019,n,Hangup

exten => 2020,1,Set(RingGroupMethod=none)
exten => 2020,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2020,n(checkrecord),Gosub(sub-record-check,s,1(exten,2020))
exten => 2020,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2020)
exten => 2020,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2020,n,Hangup

exten => 2021,1,Set(RingGroupMethod=none)
exten => 2021,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2021,n(checkrecord),Gosub(sub-record-check,s,1(exten,2021))
exten => 2021,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2021)
exten => 2021,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2021,n,Hangup

exten => 2022,1,Set(RingGroupMethod=none)
exten => 2022,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2022,n(checkrecord),Gosub(sub-record-check,s,1(exten,2022))
exten => 2022,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2022)
exten => 2022,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2022,n,Hangup

exten => 2023,1,Set(RingGroupMethod=none)
exten => 2023,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2023,n(checkrecord),Gosub(sub-record-check,s,1(exten,2023))
exten => 2023,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2023)
exten => 2023,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2023,n,Hangup

exten => 2024,1,Set(RingGroupMethod=none)
exten => 2024,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2024,n(checkrecord),Gosub(sub-record-check,s,1(exten,2024))
exten => 2024,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2024)
exten => 2024,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2024,n,Hangup

exten => 2025,1,Set(RingGroupMethod=none)
exten => 2025,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2025,n(checkrecord),Gosub(sub-record-check,s,1(exten,2025))
exten => 2025,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2025)
exten => 2025,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2025,n,Hangup

exten => 2026,1,Set(RingGroupMethod=none)
exten => 2026,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2026,n(checkrecord),Gosub(sub-record-check,s,1(exten,2026))
exten => 2026,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2026)
exten => 2026,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2026,n,Hangup

exten => 2027,1,Set(RingGroupMethod=none)
exten => 2027,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2027,n(checkrecord),Gosub(sub-record-check,s,1(exten,2027))
exten => 2027,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2027)
exten => 2027,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2027,n,Hangup

exten => 2028,1,Set(RingGroupMethod=none)
exten => 2028,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2028,n(checkrecord),Gosub(sub-record-check,s,1(exten,2028))
exten => 2028,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2028)
exten => 2028,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2028,n,Hangup

exten => 2029,1,Set(RingGroupMethod=none)
exten => 2029,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2029,n(checkrecord),Gosub(sub-record-check,s,1(exten,2029))
exten => 2029,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2029)
exten => 2029,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2029,n,Hangup

exten => 2030,1,Set(RingGroupMethod=none)
exten => 2030,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2030,n(checkrecord),Gosub(sub-record-check,s,1(exten,2030))
exten => 2030,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2030)
exten => 2030,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2030,n,Hangup

exten => 2031,1,Set(RingGroupMethod=none)
exten => 2031,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2031,n(checkrecord),Gosub(sub-record-check,s,1(exten,2031))
exten => 2031,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2031)
exten => 2031,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2031,n,Hangup

exten => 2032,1,Set(RingGroupMethod=none)
exten => 2032,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2032,n(checkrecord),Gosub(sub-record-check,s,1(exten,2032))
exten => 2032,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2032)
exten => 2032,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2032,n,Hangup

exten => 2033,1,Set(RingGroupMethod=none)
exten => 2033,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2033,n(checkrecord),Gosub(sub-record-check,s,1(exten,2033))
exten => 2033,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2033)
exten => 2033,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2033,n,Hangup

exten => 2034,1,Set(RingGroupMethod=none)
exten => 2034,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2034,n(checkrecord),Gosub(sub-record-check,s,1(exten,2034))
exten => 2034,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2034)
exten => 2034,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2034,n,Hangup

exten => 2035,1,Set(RingGroupMethod=none)
exten => 2035,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2035,n(checkrecord),Gosub(sub-record-check,s,1(exten,2035))
exten => 2035,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2035)
exten => 2035,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2035,n,Hangup

exten => 2036,1,Set(RingGroupMethod=none)
exten => 2036,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2036,n(checkrecord),Gosub(sub-record-check,s,1(exten,2036))
exten => 2036,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2036)
exten => 2036,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2036,n,Hangup

exten => 2037,1,Set(RingGroupMethod=none)
exten => 2037,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2037,n(checkrecord),Gosub(sub-record-check,s,1(exten,2037))
exten => 2037,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2037)
exten => 2037,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2037,n,Hangup

exten => 2038,1,Set(RingGroupMethod=none)
exten => 2038,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2038,n(checkrecord),Gosub(sub-record-check,s,1(exten,2038))
exten => 2038,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2038)
exten => 2038,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2038,n,Hangup

exten => 2039,1,Set(RingGroupMethod=none)
exten => 2039,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2039,n(checkrecord),Gosub(sub-record-check,s,1(exten,2039))
exten => 2039,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2039)
exten => 2039,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2039,n,Hangup

exten => 2040,1,Set(RingGroupMethod=none)
exten => 2040,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2040,n(checkrecord),Gosub(sub-record-check,s,1(exten,2040))
exten => 2040,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2040)
exten => 2040,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2040,n,Hangup

exten => 2041,1,Set(RingGroupMethod=none)
exten => 2041,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2041,n(checkrecord),Gosub(sub-record-check,s,1(exten,2041))
exten => 2041,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2041)
exten => 2041,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2041,n,Hangup

exten => 2042,1,Set(RingGroupMethod=none)
exten => 2042,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2042,n(checkrecord),Gosub(sub-record-check,s,1(exten,2042))
exten => 2042,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2042)
exten => 2042,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2042,n,Hangup

exten => 2043,1,Set(RingGroupMethod=none)
exten => 2043,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2043,n(checkrecord),Gosub(sub-record-check,s,1(exten,2043))
exten => 2043,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2043)
exten => 2043,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2043,n,Hangup

exten => 2044,1,Set(RingGroupMethod=none)
exten => 2044,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2044,n(checkrecord),Gosub(sub-record-check,s,1(exten,2044))
exten => 2044,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2044)
exten => 2044,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2044,n,Hangup

exten => 2045,1,Set(RingGroupMethod=none)
exten => 2045,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2045,n(checkrecord),Gosub(sub-record-check,s,1(exten,2045))
exten => 2045,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2045)
exten => 2045,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2045,n,Hangup

exten => 2046,1,Set(RingGroupMethod=none)
exten => 2046,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2046,n(checkrecord),Gosub(sub-record-check,s,1(exten,2046))
exten => 2046,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2046)
exten => 2046,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2046,n,Hangup

exten => 2047,1,Set(RingGroupMethod=none)
exten => 2047,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2047,n(checkrecord),Gosub(sub-record-check,s,1(exten,2047))
exten => 2047,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2047)
exten => 2047,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2047,n,Hangup

exten => 2048,1,Set(RingGroupMethod=none)
exten => 2048,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2048,n(checkrecord),Gosub(sub-record-check,s,1(exten,2048))
exten => 2048,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2048)
exten => 2048,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2048,n,Hangup

exten => 2049,1,Set(RingGroupMethod=none)
exten => 2049,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 2049,n(checkrecord),Gosub(sub-record-check,s,1(exten,2049))
exten => 2049,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},2049)
exten => 2049,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 2049,n,Hangup

exten => 3010,1,Set(RingGroupMethod=none)
exten => 3010,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 3010,n(checkrecord),Gosub(sub-record-check,s,1(exten,3010))
exten => 3010,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},3010)
exten => 3010,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 3010,n,Hangup

exten => 3800,1,Set(RingGroupMethod=none)
exten => 3800,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 3800,n(checkrecord),Gosub(sub-record-check,s,1(exten,3800))
exten => 3800,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},3800)
exten => 3800,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 3800,n,Hangup

exten => 4000,1,Set(RingGroupMethod=none)
exten => 4000,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 4000,n(checkrecord),Gosub(sub-record-check,s,1(exten,4000))
exten => 4000,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},4000)
exten => 4000,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 4000,n,Hangup

exten => 5000,1,Set(RingGroupMethod=none)
exten => 5000,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 5000,n(checkrecord),Gosub(sub-record-check,s,1(exten,5000))
exten => 5000,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},5000)
exten => 5000,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 5000,n,Hangup

exten => 6000,1,Set(RingGroupMethod=none)
exten => 6000,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 6000,n(checkrecord),Gosub(sub-record-check,s,1(exten,6000))
exten => 6000,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},6000)
exten => 6000,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 6000,n,Hangup

exten => 7500,1,Set(RingGroupMethod=none)
exten => 7500,n,Set(QDOPTS=${IF($["${CALLER_DEST}"!=""]?g)}${IF($["${AGENT_DEST}"!=""]?F(${AGENT_DEST}))})
exten => 7500,n(checkrecord),Gosub(sub-record-check,s,1(exten,7500))
exten => 7500,n,Macro(dial-one,,${DIAL_OPTIONS}${QDOPTS},7500)
exten => 7500,n,GotoIf($["${CALLER_DEST}"!=""]?${CUT(CALLER_DEST,^,1)},${CUT(CALLER_DEST,^,2)},${CUT(CALLER_DEST,^,3)})
exten => 7500,n,Hangup

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

;--== end of [from-queue-exten-only] ==--;


[macro-agent-add]
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]
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-cf-busy-off]
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-off-any]
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-on]
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-busy-prompting-on]
exten => *900,1,Answer
exten => *900,n,Wait(1)
exten => *900,n,Macro(user-callerid,)
exten => *900,n,Read(fromext,call-fwd-on-busy&please-enter-your&extension&then-press-pound,,,,)
exten => *900,n,Set(fromext=${IF($["${fromext}"=""]?${AMPUSER}:${fromext})})
exten => *900,n,Wait(1)
exten => *900,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *900,n,GotoIf($["${toext}"=""]?startread)
exten => *900,n,Wait(1)
exten => *900,n,Set(DB(CFB/${fromext})=${toext})
exten => *900,n(hook_1),Playback(call-fwd-on-busy&for&extension)
exten => *900,n,SayDigits(${fromext})
exten => *900,n,Playback(is-set-to)
exten => *900,n,SayDigits(${toext})
exten => *900,n,Macro(hangupcall,)

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

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


[app-cf-off]
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,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *73,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: )
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-off-any]
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-on]
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,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *72,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: ${toext})
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-prompting-on]
exten => *720,1,Answer
exten => *720,n,Wait(1)
exten => *720,n,Macro(user-callerid,)
exten => *720,n,Read(fromext,call-fwd-unconditional&please-enter-your&extension&then-press-pound,,,,)
exten => *720,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *720,n,Wait(1)
exten => *720,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *720,n,GotoIf($["foo${toext}"="foo"]?startread)
exten => *720,n,Wait(1)
exten => *720,n,Set(DB(CF/${fromext})=${toext})
exten => *720,n,Set(STATE=BUSY)
exten => *720,n,Gosub(app-cf-prompting-on,sstate,1())
exten => *720,n(hook_1),Playback(call-fwd-unconditional&for&extension)
exten => *720,n,SayDigits(${fromext})
exten => *720,n,Playback(is-set-to)
exten => *720,n,SayDigits(${toext})
exten => *720,n,Macro(hangupcall,)

exten => _*720.,1,Answer
exten => _*720.,n,Wait(1)
exten => _*720.,n,Macro(user-callerid,)
exten => _*720.,n,Set(fromext=${AMPUSER})
exten => _*720.,n,Set(toext=${EXTEN:4})
exten => _*720.,n,Set(DB(CF/${fromext})=${toext})
exten => _*720.,n,Set(STATE=BUSY)
exten => _*720.,n,Gosub(app-cf-prompting-on,sstate,1())
exten => _*720.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*720.,n,SayDigits(${fromext})
exten => _*720.,n,Playback(is-set-to)
exten => _*720.,n,SayDigits(${toext})
exten => _*720.,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-unavailable-off]
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]
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] ==--;


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

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

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


[app-cf-toggle]
exten => *740,1,Answer
exten => *740,n,Wait(1)
exten => *740,n,Macro(user-callerid,)
exten => *740,n,Set(fromext=${AMPUSER})
exten => *740,n,GotoIf($["${DB(CF/${fromext})}" = ""]?activate:deactivate)
exten => *740,n(activate),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *740,n,GotoIf($["${toext}"=""]?activate)
exten => *740,n,Wait(1)
exten => *740,n(toext),Set(DB(CF/${fromext})=${toext})
exten => *740,n,Set(STATE=BUSY)
exten => *740,n,Gosub(app-cf-toggle,sstate,1())
exten => *740,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *740,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: ${toext})
exten => *740,n(hook_on),Playback(call-fwd-unconditional&for&extension)
exten => *740,n,SayDigits(${fromext})
exten => *740,n,Playback(is-set-to)
exten => *740,n,SayDigits(${toext})
exten => *740,n,Macro(hangupcall,)
exten => *740,n(setdirect),Answer
exten => *740,n,Wait(1)
exten => *740,n,Macro(user-callerid,)
exten => *740,n,Goto(toext)
exten => *740,n(deactivate),Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => *740,n,Set(STATE=NOT_INUSE)
exten => *740,n,Gosub(app-cf-toggle,sstate,1())
exten => *740,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *740,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: )
exten => *740,n(hook_off),Playback(call-fwd-unconditional&de-activated)
exten => *740,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] ==--;


[ext-cf-hints]
exten => *7401001,1,Goto(app-cf-toggle,*740,1)
exten => *7401001,hint,Custom:DEVCF1001

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

exten => *7401002,1,Goto(app-cf-toggle,*740,1)
exten => *7401002,hint,Custom:DEVCF1002

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

exten => *7401003,1,Goto(app-cf-toggle,*740,1)
exten => *7401003,hint,Custom:DEVCF1003

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

exten => *7401004,1,Goto(app-cf-toggle,*740,1)
exten => *7401004,hint,Custom:DEVCF1004

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

exten => *7402001,1,Goto(app-cf-toggle,*740,1)
exten => *7402001,hint,Custom:DEVCF2001

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

exten => *7402002,1,Goto(app-cf-toggle,*740,1)
exten => *7402002,hint,Custom:DEVCF2002

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

exten => *7402003,1,Goto(app-cf-toggle,*740,1)
exten => *7402003,hint,Custom:DEVCF2003

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

exten => *7402004,1,Goto(app-cf-toggle,*740,1)
exten => *7402004,hint,Custom:DEVCF2004

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

exten => *7402005,1,Goto(app-cf-toggle,*740,1)
exten => *7402005,hint,Custom:DEVCF2005

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

exten => *7402006,1,Goto(app-cf-toggle,*740,1)
exten => *7402006,hint,Custom:DEVCF2006

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

exten => *7402007,1,Goto(app-cf-toggle,*740,1)
exten => *7402007,hint,Custom:DEVCF2007

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

exten => *7402008,1,Goto(app-cf-toggle,*740,1)
exten => *7402008,hint,Custom:DEVCF2008

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

exten => *7402009,1,Goto(app-cf-toggle,*740,1)
exten => *7402009,hint,Custom:DEVCF2009

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

exten => *7402010,1,Goto(app-cf-toggle,*740,1)
exten => *7402010,hint,Custom:DEVCF2010

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

exten => *7402011,1,Goto(app-cf-toggle,*740,1)
exten => *7402011,hint,Custom:DEVCF2011

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

exten => *7402012,1,Goto(app-cf-toggle,*740,1)
exten => *7402012,hint,Custom:DEVCF2012

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

exten => *7402013,1,Goto(app-cf-toggle,*740,1)
exten => *7402013,hint,Custom:DEVCF2013

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

exten => *7402014,1,Goto(app-cf-toggle,*740,1)
exten => *7402014,hint,Custom:DEVCF2014

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

exten => *7402015,1,Goto(app-cf-toggle,*740,1)
exten => *7402015,hint,Custom:DEVCF2015

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

exten => *7402016,1,Goto(app-cf-toggle,*740,1)
exten => *7402016,hint,Custom:DEVCF2016

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

exten => *7402017,1,Goto(app-cf-toggle,*740,1)
exten => *7402017,hint,Custom:DEVCF2017

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

exten => *7402018,1,Goto(app-cf-toggle,*740,1)
exten => *7402018,hint,Custom:DEVCF2018

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

exten => *7402019,1,Goto(app-cf-toggle,*740,1)
exten => *7402019,hint,Custom:DEVCF2019

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

exten => *7402020,1,Goto(app-cf-toggle,*740,1)
exten => *7402020,hint,Custom:DEVCF2020

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

exten => *7402021,1,Goto(app-cf-toggle,*740,1)
exten => *7402021,hint,Custom:DEVCF2021

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

exten => *7402022,1,Goto(app-cf-toggle,*740,1)
exten => *7402022,hint,Custom:DEVCF2022

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

exten => *7402023,1,Goto(app-cf-toggle,*740,1)
exten => *7402023,hint,Custom:DEVCF2023

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

exten => *7402024,1,Goto(app-cf-toggle,*740,1)
exten => *7402024,hint,Custom:DEVCF2024

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

exten => *7402025,1,Goto(app-cf-toggle,*740,1)
exten => *7402025,hint,Custom:DEVCF2025

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

exten => *7402026,1,Goto(app-cf-toggle,*740,1)
exten => *7402026,hint,Custom:DEVCF2026

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

exten => *7402027,1,Goto(app-cf-toggle,*740,1)
exten => *7402027,hint,Custom:DEVCF2027

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

exten => *7402028,1,Goto(app-cf-toggle,*740,1)
exten => *7402028,hint,Custom:DEVCF2028

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

exten => *7402029,1,Goto(app-cf-toggle,*740,1)
exten => *7402029,hint,Custom:DEVCF2029

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

exten => *7402030,1,Goto(app-cf-toggle,*740,1)
exten => *7402030,hint,Custom:DEVCF2030

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

exten => *7402031,1,Goto(app-cf-toggle,*740,1)
exten => *7402031,hint,Custom:DEVCF2031

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

exten => *7402032,1,Goto(app-cf-toggle,*740,1)
exten => *7402032,hint,Custom:DEVCF2032

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

exten => *7402033,1,Goto(app-cf-toggle,*740,1)
exten => *7402033,hint,Custom:DEVCF2033

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

exten => *7402034,1,Goto(app-cf-toggle,*740,1)
exten => *7402034,hint,Custom:DEVCF2034

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

exten => *7402035,1,Goto(app-cf-toggle,*740,1)
exten => *7402035,hint,Custom:DEVCF2035

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

exten => *7402036,1,Goto(app-cf-toggle,*740,1)
exten => *7402036,hint,Custom:DEVCF2036

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

exten => *7402037,1,Goto(app-cf-toggle,*740,1)
exten => *7402037,hint,Custom:DEVCF2037

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

exten => *7402038,1,Goto(app-cf-toggle,*740,1)
exten => *7402038,hint,Custom:DEVCF2038

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

exten => *7402039,1,Goto(app-cf-toggle,*740,1)
exten => *7402039,hint,Custom:DEVCF2039

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

exten => *7402040,1,Goto(app-cf-toggle,*740,1)
exten => *7402040,hint,Custom:DEVCF2040

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

exten => *7402041,1,Goto(app-cf-toggle,*740,1)
exten => *7402041,hint,Custom:DEVCF2041

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

exten => *7402042,1,Goto(app-cf-toggle,*740,1)
exten => *7402042,hint,Custom:DEVCF2042

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

exten => *7402043,1,Goto(app-cf-toggle,*740,1)
exten => *7402043,hint,Custom:DEVCF2043

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

exten => *7402044,1,Goto(app-cf-toggle,*740,1)
exten => *7402044,hint,Custom:DEVCF2044

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

exten => *7402045,1,Goto(app-cf-toggle,*740,1)
exten => *7402045,hint,Custom:DEVCF2045

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

exten => *7402046,1,Goto(app-cf-toggle,*740,1)
exten => *7402046,hint,Custom:DEVCF2046

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

exten => *7402047,1,Goto(app-cf-toggle,*740,1)
exten => *7402047,hint,Custom:DEVCF2047

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

exten => *7402048,1,Goto(app-cf-toggle,*740,1)
exten => *7402048,hint,Custom:DEVCF2048

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

exten => *7402049,1,Goto(app-cf-toggle,*740,1)
exten => *7402049,hint,Custom:DEVCF2049

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

exten => *7403010,1,Goto(app-cf-toggle,*740,1)
exten => *7403010,hint,Custom:DEVCF3010

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

exten => *7403800,1,Goto(app-cf-toggle,*740,1)
exten => *7403800,hint,Custom:DEVCF3800

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

exten => *7404000,1,Goto(app-cf-toggle,*740,1)
exten => *7404000,hint,Custom:DEVCF4000

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

exten => *7405000,1,Goto(app-cf-toggle,*740,1)
exten => *7405000,hint,Custom:DEVCF5000

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

exten => *7406000,1,Goto(app-cf-toggle,*740,1)
exten => *7406000,hint,Custom:DEVCF6000

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

exten => *7407500,1,Goto(app-cf-toggle,*740,1)
exten => *7407500,hint,Custom:DEVCF7500

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

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


[ext-intercom]
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(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => _*80.,n,Set(_SIPURI=)
exten => _*80.,n,Set(_ALERTINFO=Alert-Info: Ring Answer)
exten => _*80.,n,Set(_CALLINFO=Call-Info: <uri>\;answer-after=0)
exten => _*80.,n,Set(_SIPURI=intercom=true)
exten => _*80.,n,Set(_DOPTIONS=A(beep))
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(check),ChanIsAvail(${DIAL},s)
exten => _*80.,n,GotoIf($["${AVAILORIGCHAN}" = ""]?end)
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,ConfBridge(${PAGE_CONF},qwAG,,)
exten => page,n,Hangup

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


[ext-intercom-users]
exten => *801001,1,Goto(ext-intercom,${EXTEN},1)

exten => *801002,1,Goto(ext-intercom,${EXTEN},1)

exten => *801003,1,Goto(ext-intercom,${EXTEN},1)

exten => *801004,1,Goto(ext-intercom,${EXTEN},1)

exten => *802001,1,Goto(ext-intercom,${EXTEN},1)

exten => *802002,1,Goto(ext-intercom,${EXTEN},1)

exten => *802003,1,Goto(ext-intercom,${EXTEN},1)

exten => *802004,1,Goto(ext-intercom,${EXTEN},1)

exten => *802005,1,Goto(ext-intercom,${EXTEN},1)

exten => *802006,1,Goto(ext-intercom,${EXTEN},1)

exten => *802007,1,Goto(ext-intercom,${EXTEN},1)

exten => *802008,1,Goto(ext-intercom,${EXTEN},1)

exten => *802009,1,Goto(ext-intercom,${EXTEN},1)

exten => *802010,1,Goto(ext-intercom,${EXTEN},1)

exten => *802011,1,Goto(ext-intercom,${EXTEN},1)

exten => *802012,1,Goto(ext-intercom,${EXTEN},1)

exten => *802013,1,Goto(ext-intercom,${EXTEN},1)

exten => *802014,1,Goto(ext-intercom,${EXTEN},1)

exten => *802015,1,Goto(ext-intercom,${EXTEN},1)

exten => *802016,1,Goto(ext-intercom,${EXTEN},1)

exten => *802017,1,Goto(ext-intercom,${EXTEN},1)

exten => *802018,1,Goto(ext-intercom,${EXTEN},1)

exten => *802019,1,Goto(ext-intercom,${EXTEN},1)

exten => *802020,1,Goto(ext-intercom,${EXTEN},1)

exten => *802021,1,Goto(ext-intercom,${EXTEN},1)

exten => *802022,1,Goto(ext-intercom,${EXTEN},1)

exten => *802023,1,Goto(ext-intercom,${EXTEN},1)

exten => *802024,1,Goto(ext-intercom,${EXTEN},1)

exten => *802025,1,Goto(ext-intercom,${EXTEN},1)

exten => *802026,1,Goto(ext-intercom,${EXTEN},1)

exten => *802027,1,Goto(ext-intercom,${EXTEN},1)

exten => *802028,1,Goto(ext-intercom,${EXTEN},1)

exten => *802029,1,Goto(ext-intercom,${EXTEN},1)

exten => *802030,1,Goto(ext-intercom,${EXTEN},1)

exten => *802031,1,Goto(ext-intercom,${EXTEN},1)

exten => *802032,1,Goto(ext-intercom,${EXTEN},1)

exten => *802033,1,Goto(ext-intercom,${EXTEN},1)

exten => *802034,1,Goto(ext-intercom,${EXTEN},1)

exten => *802035,1,Goto(ext-intercom,${EXTEN},1)

exten => *802036,1,Goto(ext-intercom,${EXTEN},1)

exten => *802037,1,Goto(ext-intercom,${EXTEN},1)

exten => *802038,1,Goto(ext-intercom,${EXTEN},1)

exten => *802039,1,Goto(ext-intercom,${EXTEN},1)

exten => *802040,1,Goto(ext-intercom,${EXTEN},1)

exten => *802041,1,Goto(ext-intercom,${EXTEN},1)

exten => *802042,1,Goto(ext-intercom,${EXTEN},1)

exten => *802043,1,Goto(ext-intercom,${EXTEN},1)

exten => *802044,1,Goto(ext-intercom,${EXTEN},1)

exten => *802045,1,Goto(ext-intercom,${EXTEN},1)

exten => *802046,1,Goto(ext-intercom,${EXTEN},1)

exten => *802047,1,Goto(ext-intercom,${EXTEN},1)

exten => *802048,1,Goto(ext-intercom,${EXTEN},1)

exten => *802049,1,Goto(ext-intercom,${EXTEN},1)

exten => *803010,1,Goto(ext-intercom,${EXTEN},1)

exten => *803800,1,Goto(ext-intercom,${EXTEN},1)

exten => *804000,1,Goto(ext-intercom,${EXTEN},1)

exten => *805000,1,Goto(ext-intercom,${EXTEN},1)

exten => *806000,1,Goto(ext-intercom,${EXTEN},1)

exten => *807500,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]
exten => s,1,Set(DIAL=${DB(DEVICE/${ARG1}/dial)})
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(phone=${SIPPEER(${CUT(DIAL,/,2)}:useragent)})
exten => s,n,ExecIf($["${phone:0:5}" = "Mitel"]?Set(CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0))
exten => s,n,ExecIf($["${phone:0:9}" = "Panasonic"]?Set(ALERTINFO=Alert-Info: Intercom))
exten => s,n,ExecIf($["${phone:0:7}" = "Polycom"]?Set(ALERTINFO=Alert-Info: Auto Answer))
exten => s,n,ExecIf($["${phone:0:6}" = "Digium"]?Set(ALERTINFO=Alert-Info: ring-answer))
exten => s,n,ExecIf($["${ALERTINFO}" != ""]?SipAddHeader(${ALERTINFO}))
exten => s,n,ExecIf($["${CALLINFO}" != ""]?SipAddHeader(${CALLINFO}))
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] ==--;


[app-paging]
exten => ssetup,1,Set(_SIPURI=)
exten => ssetup,n,Set(_ALERTINFO=Alert-Info: Ring Answer)
exten => ssetup,n,Set(_CALLINFO=Call-Info: <uri>\;answer-after=0)
exten => ssetup,n,Set(_SIPURI=intercom=true)
exten => ssetup,n,Set(_DOPTIONS=A(beep))
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,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-dialvm]
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(${MAILBOX_EXISTS(${MAILBOX}@${VMCONTEXT})}?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 => *982001,1,Goto(dvm${EXTEN:3},1)
exten => *982001,hint,MWI:2001@default

exten => *982002,1,Goto(dvm${EXTEN:3},1)
exten => *982002,hint,MWI:2002@default

exten => *982003,1,Goto(dvm${EXTEN:3},1)
exten => *982003,hint,MWI:2003@default

exten => *982004,1,Goto(dvm${EXTEN:3},1)
exten => *982004,hint,MWI:2004@default

exten => *982009,1,Goto(dvm${EXTEN:3},1)
exten => *982009,hint,MWI:2009@default

exten => *982010,1,Goto(dvm${EXTEN:3},1)
exten => *982010,hint,MWI:2010@default

exten => *985000,1,Goto(dvm${EXTEN:3},1)
exten => *985000,hint,MWI:5000@default

exten => _dvm.,1,Answer
exten => _dvm.,n,Wait(1)
exten => _dvm.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _dvm.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _dvm.,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?${IVR_CONTEXT},return,1)
exten => _dvm.,n,Macro(hangupcall,)

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


[from-did-direct-ivr]
exten => *2001,1,Macro(blkvm-clr,)
exten => *2001,n,Set(__NODEST=)
exten => *2001,n,Macro(vm,2001,DIRECTDIAL,${IVR_RETVM})
exten => *2001,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2002,1,Macro(blkvm-clr,)
exten => *2002,n,Set(__NODEST=)
exten => *2002,n,Macro(vm,2002,DIRECTDIAL,${IVR_RETVM})
exten => *2002,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2003,1,Macro(blkvm-clr,)
exten => *2003,n,Set(__NODEST=)
exten => *2003,n,Macro(vm,2003,DIRECTDIAL,${IVR_RETVM})
exten => *2003,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2004,1,Macro(blkvm-clr,)
exten => *2004,n,Set(__NODEST=)
exten => *2004,n,Macro(vm,2004,DIRECTDIAL,${IVR_RETVM})
exten => *2004,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2009,1,Macro(blkvm-clr,)
exten => *2009,n,Set(__NODEST=)
exten => *2009,n,Macro(vm,2009,DIRECTDIAL,${IVR_RETVM})
exten => *2009,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *2010,1,Macro(blkvm-clr,)
exten => *2010,n,Set(__NODEST=)
exten => *2010,n,Macro(vm,2010,DIRECTDIAL,${IVR_RETVM})
exten => *2010,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => *5000,1,Macro(blkvm-clr,)
exten => *5000,n,Set(__NODEST=)
exten => *5000,n,Macro(vm,5000,DIRECTDIAL,${IVR_RETVM})
exten => *5000,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?ext-local,vmret,playret)

exten => 1001,1,Macro(blkvm-clr,)
exten => 1001,n,Set(__NODEST=)
exten => 1001,n,Goto(from-did-direct,1001,1)

exten => 1002,1,Macro(blkvm-clr,)
exten => 1002,n,Set(__NODEST=)
exten => 1002,n,Goto(from-did-direct,1002,1)

exten => 1003,1,Macro(blkvm-clr,)
exten => 1003,n,Set(__NODEST=)
exten => 1003,n,Goto(from-did-direct,1003,1)

exten => 1004,1,Macro(blkvm-clr,)
exten => 1004,n,Set(__NODEST=)
exten => 1004,n,Goto(from-did-direct,1004,1)

exten => 2001,1,Macro(blkvm-clr,)
exten => 2001,n,Set(__NODEST=)
exten => 2001,n,Goto(from-did-direct,2001,1)

exten => 2002,1,Macro(blkvm-clr,)
exten => 2002,n,Set(__NODEST=)
exten => 2002,n,Goto(from-did-direct,2002,1)

exten => 2003,1,Macro(blkvm-clr,)
exten => 2003,n,Set(__NODEST=)
exten => 2003,n,Goto(from-did-direct,2003,1)

exten => 2004,1,Macro(blkvm-clr,)
exten => 2004,n,Set(__NODEST=)
exten => 2004,n,Goto(from-did-direct,2004,1)

exten => 2005,1,Macro(blkvm-clr,)
exten => 2005,n,Set(__NODEST=)
exten => 2005,n,Goto(from-did-direct,2005,1)

exten => 2006,1,Macro(blkvm-clr,)
exten => 2006,n,Set(__NODEST=)
exten => 2006,n,Goto(from-did-direct,2006,1)

exten => 2007,1,Macro(blkvm-clr,)
exten => 2007,n,Set(__NODEST=)
exten => 2007,n,Goto(from-did-direct,2007,1)

exten => 2008,1,Macro(blkvm-clr,)
exten => 2008,n,Set(__NODEST=)
exten => 2008,n,Goto(from-did-direct,2008,1)

exten => 2009,1,Macro(blkvm-clr,)
exten => 2009,n,Set(__NODEST=)
exten => 2009,n,Goto(from-did-direct,2009,1)

exten => 2010,1,Macro(blkvm-clr,)
exten => 2010,n,Set(__NODEST=)
exten => 2010,n,Goto(from-did-direct,2010,1)

exten => 2011,1,Macro(blkvm-clr,)
exten => 2011,n,Set(__NODEST=)
exten => 2011,n,Goto(from-did-direct,2011,1)

exten => 2012,1,Macro(blkvm-clr,)
exten => 2012,n,Set(__NODEST=)
exten => 2012,n,Goto(from-did-direct,2012,1)

exten => 2013,1,Macro(blkvm-clr,)
exten => 2013,n,Set(__NODEST=)
exten => 2013,n,Goto(from-did-direct,2013,1)

exten => 2014,1,Macro(blkvm-clr,)
exten => 2014,n,Set(__NODEST=)
exten => 2014,n,Goto(from-did-direct,2014,1)

exten => 2015,1,Macro(blkvm-clr,)
exten => 2015,n,Set(__NODEST=)
exten => 2015,n,Goto(from-did-direct,2015,1)

exten => 2016,1,Macro(blkvm-clr,)
exten => 2016,n,Set(__NODEST=)
exten => 2016,n,Goto(from-did-direct,2016,1)

exten => 2017,1,Macro(blkvm-clr,)
exten => 2017,n,Set(__NODEST=)
exten => 2017,n,Goto(from-did-direct,2017,1)

exten => 2018,1,Macro(blkvm-clr,)
exten => 2018,n,Set(__NODEST=)
exten => 2018,n,Goto(from-did-direct,2018,1)

exten => 2019,1,Macro(blkvm-clr,)
exten => 2019,n,Set(__NODEST=)
exten => 2019,n,Goto(from-did-direct,2019,1)

exten => 2020,1,Macro(blkvm-clr,)
exten => 2020,n,Set(__NODEST=)
exten => 2020,n,Goto(from-did-direct,2020,1)

exten => 2021,1,Macro(blkvm-clr,)
exten => 2021,n,Set(__NODEST=)
exten => 2021,n,Goto(from-did-direct,2021,1)

exten => 2022,1,Macro(blkvm-clr,)
exten => 2022,n,Set(__NODEST=)
exten => 2022,n,Goto(from-did-direct,2022,1)

exten => 2023,1,Macro(blkvm-clr,)
exten => 2023,n,Set(__NODEST=)
exten => 2023,n,Goto(from-did-direct,2023,1)

exten => 2024,1,Macro(blkvm-clr,)
exten => 2024,n,Set(__NODEST=)
exten => 2024,n,Goto(from-did-direct,2024,1)

exten => 2025,1,Macro(blkvm-clr,)
exten => 2025,n,Set(__NODEST=)
exten => 2025,n,Goto(from-did-direct,2025,1)

exten => 2026,1,Macro(blkvm-clr,)
exten => 2026,n,Set(__NODEST=)
exten => 2026,n,Goto(from-did-direct,2026,1)

exten => 2027,1,Macro(blkvm-clr,)
exten => 2027,n,Set(__NODEST=)
exten => 2027,n,Goto(from-did-direct,2027,1)

exten => 2028,1,Macro(blkvm-clr,)
exten => 2028,n,Set(__NODEST=)
exten => 2028,n,Goto(from-did-direct,2028,1)

exten => 2029,1,Macro(blkvm-clr,)
exten => 2029,n,Set(__NODEST=)
exten => 2029,n,Goto(from-did-direct,2029,1)

exten => 2030,1,Macro(blkvm-clr,)
exten => 2030,n,Set(__NODEST=)
exten => 2030,n,Goto(from-did-direct,2030,1)

exten => 2031,1,Macro(blkvm-clr,)
exten => 2031,n,Set(__NODEST=)
exten => 2031,n,Goto(from-did-direct,2031,1)

exten => 2032,1,Macro(blkvm-clr,)
exten => 2032,n,Set(__NODEST=)
exten => 2032,n,Goto(from-did-direct,2032,1)

exten => 2033,1,Macro(blkvm-clr,)
exten => 2033,n,Set(__NODEST=)
exten => 2033,n,Goto(from-did-direct,2033,1)

exten => 2034,1,Macro(blkvm-clr,)
exten => 2034,n,Set(__NODEST=)
exten => 2034,n,Goto(from-did-direct,2034,1)

exten => 2035,1,Macro(blkvm-clr,)
exten => 2035,n,Set(__NODEST=)
exten => 2035,n,Goto(from-did-direct,2035,1)

exten => 2036,1,Macro(blkvm-clr,)
exten => 2036,n,Set(__NODEST=)
exten => 2036,n,Goto(from-did-direct,2036,1)

exten => 2037,1,Macro(blkvm-clr,)
exten => 2037,n,Set(__NODEST=)
exten => 2037,n,Goto(from-did-direct,2037,1)

exten => 2038,1,Macro(blkvm-clr,)
exten => 2038,n,Set(__NODEST=)
exten => 2038,n,Goto(from-did-direct,2038,1)

exten => 2039,1,Macro(blkvm-clr,)
exten => 2039,n,Set(__NODEST=)
exten => 2039,n,Goto(from-did-direct,2039,1)

exten => 2040,1,Macro(blkvm-clr,)
exten => 2040,n,Set(__NODEST=)
exten => 2040,n,Goto(from-did-direct,2040,1)

exten => 2041,1,Macro(blkvm-clr,)
exten => 2041,n,Set(__NODEST=)
exten => 2041,n,Goto(from-did-direct,2041,1)

exten => 2042,1,Macro(blkvm-clr,)
exten => 2042,n,Set(__NODEST=)
exten => 2042,n,Goto(from-did-direct,2042,1)

exten => 2043,1,Macro(blkvm-clr,)
exten => 2043,n,Set(__NODEST=)
exten => 2043,n,Goto(from-did-direct,2043,1)

exten => 2044,1,Macro(blkvm-clr,)
exten => 2044,n,Set(__NODEST=)
exten => 2044,n,Goto(from-did-direct,2044,1)

exten => 2045,1,Macro(blkvm-clr,)
exten => 2045,n,Set(__NODEST=)
exten => 2045,n,Goto(from-did-direct,2045,1)

exten => 2046,1,Macro(blkvm-clr,)
exten => 2046,n,Set(__NODEST=)
exten => 2046,n,Goto(from-did-direct,2046,1)

exten => 2047,1,Macro(blkvm-clr,)
exten => 2047,n,Set(__NODEST=)
exten => 2047,n,Goto(from-did-direct,2047,1)

exten => 2048,1,Macro(blkvm-clr,)
exten => 2048,n,Set(__NODEST=)
exten => 2048,n,Goto(from-did-direct,2048,1)

exten => 2049,1,Macro(blkvm-clr,)
exten => 2049,n,Set(__NODEST=)
exten => 2049,n,Goto(from-did-direct,2049,1)

exten => 3010,1,Macro(blkvm-clr,)
exten => 3010,n,Set(__NODEST=)
exten => 3010,n,Goto(from-did-direct,3010,1)

exten => 3800,1,Macro(blkvm-clr,)
exten => 3800,n,Set(__NODEST=)
exten => 3800,n,Goto(from-did-direct,3800,1)

exten => 4000,1,Macro(blkvm-clr,)
exten => 4000,n,Set(__NODEST=)
exten => 4000,n,Goto(from-did-direct,4000,1)

exten => 5000,1,Macro(blkvm-clr,)
exten => 5000,n,Set(__NODEST=)
exten => 5000,n,Goto(from-did-direct,5000,1)

exten => 6000,1,Macro(blkvm-clr,)
exten => 6000,n,Set(__NODEST=)
exten => 6000,n,Goto(from-did-direct,6000,1)

exten => 7500,1,Macro(blkvm-clr,)
exten => 7500,n,Set(__NODEST=)
exten => 7500,n,Goto(from-did-direct,7500,1)

;--== end of [from-did-direct-ivr] ==--;


[app-vmmain]
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(${MAILBOX_EXISTS(${AMPUSER}@${VMCONTEXT})}?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),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,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] ==--;


[app-calltrace]
exten => *69,1,Goto(app-calltrace-perform,s,1)

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


[app-calltrace-perform]
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-echo-test]
exten => *43,1,Answer
exten => *43,n,Macro(user-callerid,)
exten => *43,n,Wait(1)
exten => *43,n,Playback(demo-echotest)
exten => *43,n,Echo()
exten => *43,n,Playback(demo-echodone)
exten => *43,n,Hangup

;--== end of [app-echo-test] ==--;


[app-speakextennum]
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]
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]
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]
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] ==--;


[play-system-recording]
exten => 10,1,Answer
exten => 10,n,Playback(custom/1)
exten => 10,n,Hangup

exten => 11,1,Answer
exten => 11,n,Playback(custom/2)
exten => 11,n,Hangup

exten => 12,1,Answer
exten => 12,n,Playback(custom/3)
exten => 12,n,Hangup

exten => 13,1,Answer
exten => 13,n,Playback(custom/4)
exten => 13,n,Hangup

exten => 6,1,Answer
exten => 6,n,Playback(custom/6)
exten => 6,n,Hangup

;--== end of [play-system-recording] ==--;


[vmnotify-main]
exten => _X.,1,Macro(blkvm-set,)
exten => _X.,n,Dial(Local/${EXTEN}@from-internal,45,M(auto-blkvm))
exten => _X.,n,Hangup

;--== end of [vmnotify-main] ==--;


[vmnotify-dummy]
exten => 1,1,Answer
exten => 1,n,Wait(300)
exten => 1,n,Hangup

;--== end of [vmnotify-dummy] ==--;


[macro-outisbusy]
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] ==--;


[app-userlogonoff]
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]
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]
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]
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

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


[app-zapbarge]
exten => 888,1,Macro(user-callerid,)
exten => 888,n,Set(GROUP()=${CALLERID(number)})
exten => 888,n,Answer
exten => 888,n,Wait(1)
exten => 888,n,DAHDIBarge()
exten => 888,n,Hangup

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


[app-chanspy]
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]
exten => 7777,1,Goto(from-pstn,${EXTEN},1)

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

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


[ext-did]
include => ext-did-0001
include => ext-did-0002
exten => foo,1,Noop(bar)

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


[ext-did-catchall]
exten => s,1,Noop(No DID or CID Match)
exten => s,n(a2),Answer
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] ==--;


[ext-trunk]
exten => 1,1,Set(TDIAL_STRING=DAHDI/g0)
exten => 1,n,Set(DIAL_TRUNK=1)
exten => 1,n,Goto(ext-trunk,tdial,1)

exten => 3,1,Set(TDIAL_STRING=SIP/GoFiber2)
exten => 3,n,Set(DIAL_TRUNK=3)
exten => 3,n,Goto(ext-trunk,tdial,1)

exten => 4,1,Set(TDIAL_STRING=SIP/Examone)
exten => 4,n,Set(DIAL_TRUNK=4)
exten => 4,n,Goto(ext-trunk,tdial,1)

exten => 5,1,Set(TDIAL_STRING=SIP/GoFiber1)
exten => 5,n,Set(DIAL_TRUNK=5)
exten => 5,n,Goto(ext-trunk,tdial,1)

exten => 6,1,Set(TDIAL_STRING=SIP/LYNC)
exten => 6,n,Set(DIAL_TRUNK=6)
exten => 6,n,Goto(ext-trunk,tdial,1)

exten => 7,1,Set(SS=$)
exten => 7,n,Set(TDIAL_STRING=Barred)
exten => 7,n,Set(DIAL_TRUNK=7)
exten => 7,n,Goto(ext-trunk,tcustom,1)

exten => 8,1,Set(TDIAL_STRING=SIP/Trunk-PBX2-PBX1)
exten => 8,n,Set(DIAL_TRUNK=8)
exten => 8,n,Goto(ext-trunk,tdial,1)

exten => 9,1,Set(TDIAL_STRING=SIP/Trunk-PBX1-DND)
exten => 9,n,Set(DIAL_TRUNK=9)
exten => 9,n,Goto(ext-trunk,tdial,1)

exten => tcustom,1,Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK})
exten => tcustom,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}" = ""]?nomax)
exten => tcustom,n,GotoIf($[${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}}]?hangit)
exten => tcustom,n(nomax),ExecIf($["${CALLINGPRES_SV}" != ""]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => tcustom,n,Set(DIAL_NUMBER=${FROM_DID})
exten => tcustom,n,GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]?sub-flp-${DIAL_TRUNK},s,1())
exten => tcustom,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => tcustom,n,Set(CALLERID(number)=${CALLERID(number):0:40})
exten => tcustom,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => tcustom,n,Set(DIAL_TRUNK_OPTIONS=${IF($["${DB_EXISTS(TRUNK/${DIAL_TRUNK}/dialopts)}" = "1"]?${DB_RESULT}:${TRUNK_OPTIONS})})
exten => tcustom,n,Dial(${EVAL(${TDIAL_STRING})},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})
exten => tcustom,n(hangit),Hangup

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},${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-GoFiber2]
exten => _.,1,Set(GROUP()=OUT_3)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-GoFiber2] ==--;


[from-trunk-sip-Examone]
exten => _.,1,Set(GROUP()=OUT_4)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-Examone] ==--;


[from-trunk-sip-GoFiber1]
exten => _.,1,Set(GROUP()=OUT_5)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-GoFiber1] ==--;


[from-trunk-sip-LYNC]
exten => _.,1,Set(GROUP()=OUT_6)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-LYNC] ==--;


[from-trunk-sip-Trunk-PBX2-PBX1]
exten => _.,1,Set(GROUP()=OUT_8)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-Trunk-PBX2-PBX1] ==--;


[from-trunk-sip-Trunk-PBX1-DND]
exten => _.,1,Set(GROUP()=OUT_9)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

;--== end of [from-trunk-sip-Trunk-PBX1-DND] ==--;


[sub-flp-2]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_2})
exten => s,n,Return()

;--== end of [sub-flp-2] ==--;


[sub-flp-4]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_4})
exten => s,n,Return()

;--== end of [sub-flp-4] ==--;


[sub-flp-6]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_6})
exten => s,n,Return()

;--== end of [sub-flp-6] ==--;


[sub-flp-7]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_7})
exten => s,n,Return()

;--== end of [sub-flp-7] ==--;


[sub-flp-8]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_8})
exten => s,n,Return()

;--== end of [sub-flp-8] ==--;


[sub-flp-9]
exten => s,1,ExecIf($[${REGEX("^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$" ${DIAL_NUMBER})} = 1]?Return())
exten => s,n,Return()
exten => s,n(match),Set(DIAL_NUMBER=${TARGET_FLP_9})
exten => s,n,Return()

;--== end of [sub-flp-9] ==--;


[sub-record-cancel]
exten => s,1,Set(__REC_POLICY_MODE=${REC_POLICY_MODE_SAVE})
exten => s,n,ExecIf($["${REC_STATUS}"!="RECORDING"]?Return())
exten => s,n,StopMixMonitor()
exten => s,n,Set(__REC_STATUS=)
exten => s,n,Set(MON_BASE=${IF($[${LEN(${MIXMON_DIR})}]?${MIXMON_DIR}:${ASTSPOOLDIR}/monitor/)}${YEAR}/${MONTH}/${DAY}/)
exten => s,n,Set(__MON_FMT=${IF($[${LEN(${MIXMON_FORMAT})}]?${IF($["${MIXMON_FORMAT}"="wav49"]?WAV:${MIXMON_FORMAT})}:wav)})
exten => s,n,ExecIf($[${LEN(${CALLFILENAME})} & ${STAT(f,${MON_BASE}${CALLFILENAME}.${MON_FMT})}]?System(rm -f ${MON_BASE}${CALLFILENAME}.${MON_FMT}))
exten => s,n,Set(__CALLFILENAME=)
exten => s,n,Set(CDR(recordingfile)=)
exten => s,n,Return()

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


[sub-record-check]
exten => s,1,Set(REC_POLICY_MODE_SAVE=${REC_POLICY_MODE})
exten => s,n,GotoIf($["${BLINDTRANSFER}" = ""]?check)
exten => s,n,ResetCDR()
exten => s,n,GotoIf($["${REC_STATUS}" != "RECORDING"]?check)
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST})
exten => s,n(check),Set(__MON_FMT=${IF($["${MIXMON_FORMAT}"="wav49"]?WAV:${MIXMON_FORMAT})})
exten => s,n,GotoIf($["${REC_STATUS}"!="RECORDING"]?next)
exten => s,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => s,n,Return()
exten => s,n(next),ExecIf($[!${LEN(${ARG1})}]?Return())
exten => s,n,ExecIf($["${REC_POLICY_MODE}"="" & "${ARG3}"!=""]?Set(__REC_POLICY_MODE=${ARG3}))
exten => s,n,GotoIf($["${REC_STATUS}"!=""]?${ARG1},1)
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(__CALLFILENAME=${ARG1}-${ARG2}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID})
exten => s,n,Goto(${ARG1},1)

exten => rg,1,GosubIf($["${REC_POLICY_MODE}"="always"]?record,1(${EXTEN},${REC_POLICY_MODE},${FROMEXTEN}))
exten => rg,n,Return()

exten => force,1,GosubIf($["${REC_POLICY_MODE}"="always"]?record,1(${EXTEN},${REC_POLICY_MODE},${FROMEXTEN}))
exten => force,n,Return()

exten => q,1,GosubIf($["${REC_POLICY_MODE}"="always"]?recq,1(${EXTEN},${ARG2},${FROMEXTEN}))
exten => q,n,Return()

exten => out,1,ExecIf($["${REC_POLICY_MODE}"=""]?Set(__REC_POLICY_MODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/external)}))
exten => out,n,GosubIf($["${REC_POLICY_MODE}"="always"]?record,1(exten,${ARG2},${FROMEXTEN}))
exten => out,n,Return()

exten => exten,1,GotoIf($["${REC_POLICY_MODE}"!=""]?callee)
exten => exten,n,Set(__REC_POLICY_MODE=${IF($[${LEN(${FROM_DID})}]?${DB(AMPUSER/${ARG2}/recording/in/external)}:${DB(AMPUSER/${ARG2}/recording/in/internal)})})
exten => exten,n,GotoIf($["${REC_POLICY_MODE}"="dontcare"]?caller)
exten => exten,n,GotoIf($["${DB(AMPUSER/${FROMEXTEN}/recording/out/internal)}"="dontcare" | "${FROM_DID}"!=""]?callee)
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),GosubIf($["${REC_POLICY_MODE}"="always"]?record,1(${EXTEN},${ARG2},${FROMEXTEN}))
exten => exten,n,Return()
exten => exten,n(caller),Set(__REC_POLICY_MODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/internal)})
exten => exten,n,GosubIf($["${REC_POLICY_MODE}"="always"]?record,1(${EXTEN},${ARG2},${FROMEXTEN}))
exten => exten,n,Return()

exten => conf,1,Gosub(recconf,1(${EXTEN},${ARG2},${ARG2}))
exten => conf,n,Return()

exten => page,1,GosubIf($["${REC_POLICY_MODE}"="always"]?recconf,1(${EXTEN},${ARG2},${FROMEXTEN}))
exten => page,n,Return()

exten => record,1,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => record,n,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})
exten => record,n,Set(__REC_STATUS=RECORDING)
exten => record,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => record,n,Return()

exten => recq,1,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => recq,n,Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
exten => recq,n,MixMonitor(${MONITOR_FILENAME}.${MIXMON_FORMAT},${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 => recconf,1,Set(__CALLFILENAME=${IF($[${MEETME_INFO(parties,${ARG2})}]?${DB(RECCONF/${ARG2})}:${ARG1}-${ARG2}-${ARG3}-${TIMESTR}-${UNIQUEID})})
exten => recconf,n,ExecIf($[!${MEETME_INFO(parties,${ARG2})}]?Set(DB(RECCONF/${ARG2})=${CALLFILENAME}))
exten => recconf,n,Set(MEETME_RECORDINGFILE=${IF($[${LEN(${MIXMON_DIR})}]?${MIXMON_DIR}:${ASTSPOOLDIR}/monitor/)}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
exten => recconf,n,Set(MEETME_RECORDINGFORMAT=${MIXMON_FORMAT})
exten => recconf,n,ExecIf($["${REC_POLICY_MODE}"!="always"]?Return())
exten => recconf,n,Set(__REC_STATUS=RECORDING)
exten => recconf,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => recconf,n,Return()

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


[macro-one-touch-record]
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($["${ONETOUCH_REC}"="RECORDING"]?Playback(beep))
exten => s,n,ExecIf($["${ONETOUCH_REC}"="PAUSED"]?Playback(beep&beep))
exten => s,n,MacroExit()

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


[macro-prepend-cid]
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 => outrt-3 ; DNC
include => outrt-1 ; Primary
exten => foo,1,Noop(bar)

;--== end of [outbound-allroutes] ==--;


[outrt-3] ; DNC
exten => 12017958200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12017958200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12017958200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12017958200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12017958200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12017958200,n,Set(_NODEST=)
exten => 12017958200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12017958200,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12017958200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12017958200,n,Set(_KEEPCID=TRUE)
exten => 12017958200,n,Goto(ivr-4,s,1)

exten => 12018644505,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12018644505,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12018644505,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12018644505,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12018644505,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12018644505,n,Set(_NODEST=)
exten => 12018644505,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12018644505,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12018644505,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12018644505,n,Set(_KEEPCID=TRUE)
exten => 12018644505,n,Goto(ivr-4,s,1)

exten => 12093345886,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12093345886,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12093345886,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12093345886,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12093345886,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12093345886,n,Set(_NODEST=)
exten => 12093345886,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12093345886,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12093345886,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12093345886,n,Set(_KEEPCID=TRUE)
exten => 12093345886,n,Goto(ivr-4,s,1)

exten => 12095244817,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12095244817,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12095244817,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12095244817,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12095244817,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12095244817,n,Set(_NODEST=)
exten => 12095244817,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12095244817,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12095244817,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12095244817,n,Set(_KEEPCID=TRUE)
exten => 12095244817,n,Goto(ivr-4,s,1)

exten => 12095715071,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12095715071,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12095715071,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12095715071,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12095715071,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12095715071,n,Set(_NODEST=)
exten => 12095715071,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12095715071,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12095715071,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12095715071,n,Set(_KEEPCID=TRUE)
exten => 12095715071,n,Goto(ivr-4,s,1)

exten => 12393952444,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 12393952444,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 12393952444,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 12393952444,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 12393952444,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 12393952444,n,Set(_NODEST=)
exten => 12393952444,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 12393952444,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 12393952444,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 12393952444,n,Set(_KEEPCID=TRUE)
exten => 12393952444,n,Goto(ivr-4,s,1)

exten => 13104403131,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 13104403131,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 13104403131,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 13104403131,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 13104403131,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 13104403131,n,Set(_NODEST=)
exten => 13104403131,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 13104403131,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 13104403131,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 13104403131,n,Set(_KEEPCID=TRUE)
exten => 13104403131,n,Goto(ivr-4,s,1)

exten => 14014537950,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 14014537950,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 14014537950,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 14014537950,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 14014537950,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 14014537950,n,Set(_NODEST=)
exten => 14014537950,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 14014537950,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 14014537950,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 14014537950,n,Set(_KEEPCID=TRUE)
exten => 14014537950,n,Goto(ivr-4,s,1)

exten => 14089233333,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 14089233333,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 14089233333,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 14089233333,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 14089233333,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 14089233333,n,Set(_NODEST=)
exten => 14089233333,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 14089233333,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 14089233333,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 14089233333,n,Set(_KEEPCID=TRUE)
exten => 14089233333,n,Goto(ivr-4,s,1)

exten => 14253178025,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 14253178025,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 14253178025,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 14253178025,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 14253178025,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 14253178025,n,Set(_NODEST=)
exten => 14253178025,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 14253178025,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 14253178025,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 14253178025,n,Set(_KEEPCID=TRUE)
exten => 14253178025,n,Goto(ivr-4,s,1)

exten => 14808824040,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 14808824040,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 14808824040,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 14808824040,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 14808824040,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 14808824040,n,Set(_NODEST=)
exten => 14808824040,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 14808824040,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 14808824040,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 14808824040,n,Set(_KEEPCID=TRUE)
exten => 14808824040,n,Goto(ivr-4,s,1)

exten => 15032572500,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15032572500,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15032572500,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15032572500,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15032572500,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15032572500,n,Set(_NODEST=)
exten => 15032572500,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15032572500,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15032572500,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15032572500,n,Set(_KEEPCID=TRUE)
exten => 15032572500,n,Goto(ivr-4,s,1)

exten => 15032960061,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15032960061,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15032960061,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15032960061,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15032960061,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15032960061,n,Set(_NODEST=)
exten => 15032960061,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15032960061,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15032960061,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15032960061,n,Set(_KEEPCID=TRUE)
exten => 15032960061,n,Goto(ivr-4,s,1)

exten => 15088943643,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15088943643,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15088943643,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15088943643,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15088943643,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15088943643,n,Set(_NODEST=)
exten => 15088943643,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15088943643,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15088943643,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15088943643,n,Set(_KEEPCID=TRUE)
exten => 15088943643,n,Goto(ivr-4,s,1)

exten => 15184654771,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15184654771,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15184654771,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15184654771,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15184654771,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15184654771,n,Set(_NODEST=)
exten => 15184654771,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15184654771,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15184654771,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15184654771,n,Set(_KEEPCID=TRUE)
exten => 15184654771,n,Goto(ivr-4,s,1)

exten => 15186081150,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15186081150,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15186081150,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15186081150,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15186081150,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15186081150,n,Set(_NODEST=)
exten => 15186081150,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15186081150,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15186081150,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15186081150,n,Set(_KEEPCID=TRUE)
exten => 15186081150,n,Goto(ivr-4,s,1)

exten => 15186644185,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15186644185,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15186644185,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15186644185,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15186644185,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15186644185,n,Set(_NODEST=)
exten => 15186644185,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15186644185,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15186644185,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15186644185,n,Set(_KEEPCID=TRUE)
exten => 15186644185,n,Goto(ivr-4,s,1)

exten => 15188435993,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15188435993,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15188435993,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15188435993,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15188435993,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15188435993,n,Set(_NODEST=)
exten => 15188435993,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15188435993,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15188435993,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15188435993,n,Set(_KEEPCID=TRUE)
exten => 15188435993,n,Goto(ivr-4,s,1)

exten => 15188692429,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 15188692429,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 15188692429,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 15188692429,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 15188692429,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 15188692429,n,Set(_NODEST=)
exten => 15188692429,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 15188692429,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 15188692429,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 15188692429,n,Set(_KEEPCID=TRUE)
exten => 15188692429,n,Goto(ivr-4,s,1)

exten => 16095815502,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16095815502,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16095815502,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16095815502,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16095815502,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16095815502,n,Set(_NODEST=)
exten => 16095815502,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16095815502,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16095815502,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16095815502,n,Set(_KEEPCID=TRUE)
exten => 16095815502,n,Goto(ivr-4,s,1)

exten => 16173183250,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16173183250,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16173183250,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16173183250,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16173183250,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16173183250,n,Set(_NODEST=)
exten => 16173183250,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16173183250,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16173183250,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16173183250,n,Set(_KEEPCID=TRUE)
exten => 16173183250,n,Goto(ivr-4,s,1)

exten => 16177868899,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16177868899,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16177868899,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16177868899,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16177868899,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16177868899,n,Set(_NODEST=)
exten => 16177868899,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16177868899,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16177868899,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16177868899,n,Set(_KEEPCID=TRUE)
exten => 16177868899,n,Goto(ivr-4,s,1)

exten => 16188334511,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16188334511,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16188334511,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16188334511,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16188334511,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16188334511,n,Set(_NODEST=)
exten => 16188334511,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16188334511,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16188334511,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16188334511,n,Set(_KEEPCID=TRUE)
exten => 16188334511,n,Goto(ivr-4,s,1)

exten => 16263975116,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16263975116,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16263975116,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16263975116,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16263975116,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16263975116,n,Set(_NODEST=)
exten => 16263975116,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16263975116,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16263975116,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16263975116,n,Set(_KEEPCID=TRUE)
exten => 16263975116,n,Goto(ivr-4,s,1)

exten => 16508887556,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 16508887556,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 16508887556,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 16508887556,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 16508887556,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 16508887556,n,Set(_NODEST=)
exten => 16508887556,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 16508887556,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 16508887556,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 16508887556,n,Set(_KEEPCID=TRUE)
exten => 16508887556,n,Goto(ivr-4,s,1)

exten => 17145370200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17145370200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17145370200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17145370200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17145370200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17145370200,n,Set(_NODEST=)
exten => 17145370200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17145370200,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17145370200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17145370200,n,Set(_KEEPCID=TRUE)
exten => 17145370200,n,Goto(ivr-4,s,1)

exten => 17146152000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17146152000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17146152000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17146152000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17146152000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17146152000,n,Set(_NODEST=)
exten => 17146152000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17146152000,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17146152000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17146152000,n,Set(_KEEPCID=TRUE)
exten => 17146152000,n,Goto(ivr-4,s,1)

exten => 17146752000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17146752000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17146752000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17146752000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17146752000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17146752000,n,Set(_NODEST=)
exten => 17146752000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17146752000,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17146752000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17146752000,n,Set(_KEEPCID=TRUE)
exten => 17146752000,n,Goto(ivr-4,s,1)

exten => 17149525027,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17149525027,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17149525027,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17149525027,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17149525027,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17149525027,n,Set(_NODEST=)
exten => 17149525027,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17149525027,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17149525027,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17149525027,n,Set(_KEEPCID=TRUE)
exten => 17149525027,n,Goto(ivr-4,s,1)

exten => 17149923940,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17149923940,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17149923940,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17149923940,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17149923940,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17149923940,n,Set(_NODEST=)
exten => 17149923940,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17149923940,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17149923940,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17149923940,n,Set(_KEEPCID=TRUE)
exten => 17149923940,n,Goto(ivr-4,s,1)

exten => 17182508000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17182508000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17182508000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17182508000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17182508000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17182508000,n,Set(_NODEST=)
exten => 17182508000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17182508000,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17182508000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17182508000,n,Set(_KEEPCID=TRUE)
exten => 17182508000,n,Goto(ivr-4,s,1)

exten => 17277733126,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17277733126,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17277733126,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17277733126,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17277733126,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17277733126,n,Set(_NODEST=)
exten => 17277733126,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17277733126,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17277733126,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17277733126,n,Set(_KEEPCID=TRUE)
exten => 17277733126,n,Goto(ivr-4,s,1)

exten => 17277733203,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17277733203,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17277733203,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17277733203,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17277733203,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17277733203,n,Set(_NODEST=)
exten => 17277733203,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17277733203,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17277733203,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17277733203,n,Set(_KEEPCID=TRUE)
exten => 17277733203,n,Goto(ivr-4,s,1)

exten => 17604150071,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17604150071,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17604150071,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17604150071,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17604150071,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17604150071,n,Set(_NODEST=)
exten => 17604150071,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17604150071,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17604150071,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17604150071,n,Set(_KEEPCID=TRUE)
exten => 17604150071,n,Goto(ivr-4,s,1)

exten => 17606337746,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17606337746,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17606337746,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17606337746,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17606337746,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17606337746,n,Set(_NODEST=)
exten => 17606337746,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17606337746,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17606337746,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17606337746,n,Set(_KEEPCID=TRUE)
exten => 17606337746,n,Goto(ivr-4,s,1)

exten => 17606346661,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17606346661,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17606346661,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17606346661,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17606346661,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17606346661,n,Set(_NODEST=)
exten => 17606346661,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17606346661,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17606346661,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17606346661,n,Set(_KEEPCID=TRUE)
exten => 17606346661,n,Goto(ivr-4,s,1)

exten => 17607248411,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17607248411,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17607248411,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17607248411,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17607248411,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17607248411,n,Set(_NODEST=)
exten => 17607248411,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17607248411,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17607248411,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17607248411,n,Set(_KEEPCID=TRUE)
exten => 17607248411,n,Goto(ivr-4,s,1)

exten => 17708745400,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17708745400,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17708745400,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17708745400,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17708745400,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17708745400,n,Set(_NODEST=)
exten => 17708745400,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17708745400,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17708745400,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17708745400,n,Set(_KEEPCID=TRUE)
exten => 17708745400,n,Goto(ivr-4,s,1)

exten => 17738973016,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17738973016,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17738973016,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17738973016,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17738973016,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17738973016,n,Set(_NODEST=)
exten => 17738973016,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17738973016,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17738973016,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17738973016,n,Set(_KEEPCID=TRUE)
exten => 17738973016,n,Goto(ivr-4,s,1)

exten => 17876191830,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17876191830,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17876191830,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17876191830,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17876191830,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17876191830,n,Set(_NODEST=)
exten => 17876191830,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17876191830,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17876191830,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17876191830,n,Set(_KEEPCID=TRUE)
exten => 17876191830,n,Goto(ivr-4,s,1)

exten => 17876726638,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17876726638,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17876726638,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17876726638,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17876726638,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17876726638,n,Set(_NODEST=)
exten => 17876726638,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17876726638,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17876726638,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17876726638,n,Set(_KEEPCID=TRUE)
exten => 17876726638,n,Goto(ivr-4,s,1)

exten => 17878271110,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 17878271110,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 17878271110,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 17878271110,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 17878271110,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 17878271110,n,Set(_NODEST=)
exten => 17878271110,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 17878271110,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 17878271110,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 17878271110,n,Set(_KEEPCID=TRUE)
exten => 17878271110,n,Goto(ivr-4,s,1)

exten => 18003082794,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18003082794,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18003082794,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18003082794,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18003082794,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18003082794,n,Set(_NODEST=)
exten => 18003082794,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18003082794,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18003082794,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18003082794,n,Set(_KEEPCID=TRUE)
exten => 18003082794,n,Goto(ivr-4,s,1)

exten => 18055788300,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18055788300,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18055788300,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18055788300,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18055788300,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18055788300,n,Set(_NODEST=)
exten => 18055788300,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18055788300,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18055788300,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18055788300,n,Set(_KEEPCID=TRUE)
exten => 18055788300,n,Goto(ivr-4,s,1)

exten => 18187082222,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18187082222,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18187082222,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18187082222,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18187082222,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18187082222,n,Set(_NODEST=)
exten => 18187082222,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18187082222,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18187082222,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18187082222,n,Set(_KEEPCID=TRUE)
exten => 18187082222,n,Goto(ivr-4,s,1)

exten => 18436929571,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18436929571,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18436929571,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18436929571,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18436929571,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18436929571,n,Set(_NODEST=)
exten => 18436929571,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18436929571,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18436929571,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18436929571,n,Set(_KEEPCID=TRUE)
exten => 18436929571,n,Goto(ivr-4,s,1)

exten => 18453316211,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18453316211,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18453316211,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18453316211,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18453316211,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18453316211,n,Set(_NODEST=)
exten => 18453316211,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18453316211,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18453316211,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18453316211,n,Set(_KEEPCID=TRUE)
exten => 18453316211,n,Goto(ivr-4,s,1)

exten => 18454731188,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18454731188,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18454731188,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18454731188,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18454731188,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18454731188,n,Set(_NODEST=)
exten => 18454731188,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18454731188,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18454731188,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18454731188,n,Set(_KEEPCID=TRUE)
exten => 18454731188,n,Goto(ivr-4,s,1)

exten => 18582317980,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18582317980,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18582317980,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18582317980,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18582317980,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18582317980,n,Set(_NODEST=)
exten => 18582317980,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18582317980,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18582317980,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18582317980,n,Set(_KEEPCID=TRUE)
exten => 18582317980,n,Goto(ivr-4,s,1)

exten => 18582788300,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18582788300,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18582788300,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18582788300,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18582788300,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18582788300,n,Set(_NODEST=)
exten => 18582788300,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18582788300,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18582788300,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18582788300,n,Set(_KEEPCID=TRUE)
exten => 18582788300,n,Goto(ivr-4,s,1)

exten => 18584994000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18584994000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18584994000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18584994000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18584994000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18584994000,n,Set(_NODEST=)
exten => 18584994000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18584994000,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18584994000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18584994000,n,Set(_KEEPCID=TRUE)
exten => 18584994000,n,Goto(ivr-4,s,1)

exten => 18584996446,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18584996446,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18584996446,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18584996446,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18584996446,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18584996446,n,Set(_NODEST=)
exten => 18584996446,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18584996446,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18584996446,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18584996446,n,Set(_KEEPCID=TRUE)
exten => 18584996446,n,Goto(ivr-4,s,1)

exten => 18585548545,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18585548545,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18585548545,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18585548545,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18585548545,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18585548545,n,Set(_NODEST=)
exten => 18585548545,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18585548545,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18585548545,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18585548545,n,Set(_KEEPCID=TRUE)
exten => 18585548545,n,Goto(ivr-4,s,1)

exten => 18586780310,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18586780310,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18586780310,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18586780310,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18586780310,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18586780310,n,Set(_NODEST=)
exten => 18586780310,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18586780310,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18586780310,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18586780310,n,Set(_KEEPCID=TRUE)
exten => 18586780310,n,Goto(ivr-4,s,1)

exten => 18589749755,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18589749755,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18589749755,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18589749755,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18589749755,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18589749755,n,Set(_NODEST=)
exten => 18589749755,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18589749755,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18589749755,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18589749755,n,Set(_KEEPCID=TRUE)
exten => 18589749755,n,Goto(ivr-4,s,1)

exten => 18644540000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 18644540000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 18644540000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 18644540000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 18644540000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 18644540000,n,Set(_NODEST=)
exten => 18644540000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 18644540000,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 18644540000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 18644540000,n,Set(_KEEPCID=TRUE)
exten => 18644540000,n,Goto(ivr-4,s,1)

exten => 19094726189,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19094726189,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19094726189,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19094726189,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19094726189,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19094726189,n,Set(_NODEST=)
exten => 19094726189,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19094726189,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19094726189,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19094726189,n,Set(_KEEPCID=TRUE)
exten => 19094726189,n,Goto(ivr-4,s,1)

exten => 19098061063,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19098061063,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19098061063,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19098061063,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19098061063,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19098061063,n,Set(_NODEST=)
exten => 19098061063,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19098061063,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19098061063,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19098061063,n,Set(_KEEPCID=TRUE)
exten => 19098061063,n,Goto(ivr-4,s,1)

exten => 19098061529,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19098061529,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19098061529,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19098061529,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19098061529,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19098061529,n,Set(_NODEST=)
exten => 19098061529,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19098061529,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19098061529,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19098061529,n,Set(_KEEPCID=TRUE)
exten => 19098061529,n,Goto(ivr-4,s,1)

exten => 19098861600,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19098861600,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19098861600,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19098861600,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19098861600,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19098861600,n,Set(_NODEST=)
exten => 19098861600,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19098861600,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19098861600,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19098861600,n,Set(_KEEPCID=TRUE)
exten => 19098861600,n,Goto(ivr-4,s,1)

exten => 19098876333,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19098876333,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19098876333,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19098876333,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19098876333,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19098876333,n,Set(_NODEST=)
exten => 19098876333,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19098876333,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19098876333,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19098876333,n,Set(_KEEPCID=TRUE)
exten => 19098876333,n,Goto(ivr-4,s,1)

exten => 19253015005,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19253015005,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19253015005,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19253015005,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19253015005,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19253015005,n,Set(_NODEST=)
exten => 19253015005,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19253015005,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19253015005,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19253015005,n,Set(_KEEPCID=TRUE)
exten => 19253015005,n,Goto(ivr-4,s,1)

exten => 19412572930,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19412572930,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19412572930,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19412572930,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19412572930,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19412572930,n,Set(_NODEST=)
exten => 19412572930,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19412572930,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19412572930,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19412572930,n,Set(_KEEPCID=TRUE)
exten => 19412572930,n,Goto(ivr-4,s,1)

exten => 19413428200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19413428200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19413428200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19413428200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19413428200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19413428200,n,Set(_NODEST=)
exten => 19413428200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19413428200,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19413428200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19413428200,n,Set(_KEEPCID=TRUE)
exten => 19413428200,n,Goto(ivr-4,s,1)

exten => 19513030575,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19513030575,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19513030575,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19513030575,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19513030575,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19513030575,n,Set(_NODEST=)
exten => 19513030575,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19513030575,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19513030575,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19513030575,n,Set(_KEEPCID=TRUE)
exten => 19513030575,n,Goto(ivr-4,s,1)

exten => 19516524343,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19516524343,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19516524343,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19516524343,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19516524343,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19516524343,n,Set(_NODEST=)
exten => 19516524343,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19516524343,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19516524343,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19516524343,n,Set(_KEEPCID=TRUE)
exten => 19516524343,n,Goto(ivr-4,s,1)

exten => 19516961818,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19516961818,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19516961818,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19516961818,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19516961818,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19516961818,n,Set(_NODEST=)
exten => 19516961818,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19516961818,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19516961818,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19516961818,n,Set(_KEEPCID=TRUE)
exten => 19516961818,n,Goto(ivr-4,s,1)

exten => 19516962928,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19516962928,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19516962928,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19516962928,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19516962928,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19516962928,n,Set(_NODEST=)
exten => 19516962928,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19516962928,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19516962928,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19516962928,n,Set(_KEEPCID=TRUE)
exten => 19516962928,n,Goto(ivr-4,s,1)

exten => 19516965388,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19516965388,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19516965388,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19516965388,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19516965388,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19516965388,n,Set(_NODEST=)
exten => 19516965388,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19516965388,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19516965388,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19516965388,n,Set(_KEEPCID=TRUE)
exten => 19516965388,n,Goto(ivr-4,s,1)

exten => 19549423991,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 19549423991,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 19549423991,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 19549423991,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 19549423991,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 19549423991,n,Set(_NODEST=)
exten => 19549423991,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 19549423991,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 19549423991,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 19549423991,n,Set(_KEEPCID=TRUE)
exten => 19549423991,n,Goto(ivr-4,s,1)

exten => 2017958200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2017958200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2017958200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2017958200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2017958200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2017958200,n,Set(_NODEST=)
exten => 2017958200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2017958200,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2017958200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2017958200,n,Set(_KEEPCID=TRUE)
exten => 2017958200,n,Goto(ivr-4,s,1)

exten => 2018644505,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2018644505,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2018644505,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2018644505,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2018644505,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2018644505,n,Set(_NODEST=)
exten => 2018644505,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2018644505,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2018644505,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2018644505,n,Set(_KEEPCID=TRUE)
exten => 2018644505,n,Goto(ivr-4,s,1)

exten => 2093345886,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2093345886,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2093345886,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2093345886,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2093345886,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2093345886,n,Set(_NODEST=)
exten => 2093345886,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2093345886,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2093345886,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2093345886,n,Set(_KEEPCID=TRUE)
exten => 2093345886,n,Goto(ivr-4,s,1)

exten => 2095244817,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2095244817,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2095244817,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2095244817,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2095244817,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2095244817,n,Set(_NODEST=)
exten => 2095244817,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2095244817,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2095244817,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2095244817,n,Set(_KEEPCID=TRUE)
exten => 2095244817,n,Goto(ivr-4,s,1)

exten => 2095715071,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2095715071,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2095715071,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2095715071,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2095715071,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2095715071,n,Set(_NODEST=)
exten => 2095715071,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2095715071,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2095715071,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2095715071,n,Set(_KEEPCID=TRUE)
exten => 2095715071,n,Goto(ivr-4,s,1)

exten => 2393952444,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 2393952444,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 2393952444,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 2393952444,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 2393952444,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 2393952444,n,Set(_NODEST=)
exten => 2393952444,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 2393952444,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 2393952444,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 2393952444,n,Set(_KEEPCID=TRUE)
exten => 2393952444,n,Goto(ivr-4,s,1)

exten => 3104403131,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 3104403131,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 3104403131,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 3104403131,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 3104403131,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 3104403131,n,Set(_NODEST=)
exten => 3104403131,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 3104403131,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 3104403131,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 3104403131,n,Set(_KEEPCID=TRUE)
exten => 3104403131,n,Goto(ivr-4,s,1)

exten => 3105437019,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 3105437019,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 3105437019,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 3105437019,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 3105437019,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 3105437019,n,Set(_NODEST=)
exten => 3105437019,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 3105437019,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 3105437019,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 3105437019,n,Set(_KEEPCID=TRUE)
exten => 3105437019,n,Goto(ivr-4,s,1)

exten => 3105437023,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 3105437023,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 3105437023,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 3105437023,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 3105437023,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 3105437023,n,Set(_NODEST=)
exten => 3105437023,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 3105437023,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 3105437023,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 3105437023,n,Set(_KEEPCID=TRUE)
exten => 3105437023,n,Goto(ivr-4,s,1)

exten => 4014537950,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 4014537950,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 4014537950,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 4014537950,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 4014537950,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 4014537950,n,Set(_NODEST=)
exten => 4014537950,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 4014537950,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 4014537950,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 4014537950,n,Set(_KEEPCID=TRUE)
exten => 4014537950,n,Goto(ivr-4,s,1)

exten => 4089233333,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 4089233333,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 4089233333,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 4089233333,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 4089233333,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 4089233333,n,Set(_NODEST=)
exten => 4089233333,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 4089233333,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 4089233333,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 4089233333,n,Set(_KEEPCID=TRUE)
exten => 4089233333,n,Goto(ivr-4,s,1)

exten => 4253178025,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 4253178025,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 4253178025,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 4253178025,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 4253178025,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 4253178025,n,Set(_NODEST=)
exten => 4253178025,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 4253178025,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 4253178025,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 4253178025,n,Set(_KEEPCID=TRUE)
exten => 4253178025,n,Goto(ivr-4,s,1)

exten => 4808824040,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 4808824040,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 4808824040,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 4808824040,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 4808824040,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 4808824040,n,Set(_NODEST=)
exten => 4808824040,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 4808824040,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 4808824040,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 4808824040,n,Set(_KEEPCID=TRUE)
exten => 4808824040,n,Goto(ivr-4,s,1)

exten => 5032572500,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5032572500,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5032572500,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5032572500,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5032572500,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5032572500,n,Set(_NODEST=)
exten => 5032572500,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5032572500,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5032572500,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5032572500,n,Set(_KEEPCID=TRUE)
exten => 5032572500,n,Goto(ivr-4,s,1)

exten => 5032960061,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5032960061,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5032960061,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5032960061,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5032960061,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5032960061,n,Set(_NODEST=)
exten => 5032960061,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5032960061,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5032960061,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5032960061,n,Set(_KEEPCID=TRUE)
exten => 5032960061,n,Goto(ivr-4,s,1)

exten => 5088943643,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5088943643,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5088943643,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5088943643,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5088943643,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5088943643,n,Set(_NODEST=)
exten => 5088943643,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5088943643,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5088943643,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5088943643,n,Set(_KEEPCID=TRUE)
exten => 5088943643,n,Goto(ivr-4,s,1)

exten => 5184654771,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5184654771,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5184654771,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5184654771,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5184654771,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5184654771,n,Set(_NODEST=)
exten => 5184654771,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5184654771,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5184654771,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5184654771,n,Set(_KEEPCID=TRUE)
exten => 5184654771,n,Goto(ivr-4,s,1)

exten => 5186081150,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5186081150,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5186081150,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5186081150,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5186081150,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5186081150,n,Set(_NODEST=)
exten => 5186081150,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5186081150,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5186081150,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5186081150,n,Set(_KEEPCID=TRUE)
exten => 5186081150,n,Goto(ivr-4,s,1)

exten => 5186644185,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5186644185,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5186644185,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5186644185,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5186644185,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5186644185,n,Set(_NODEST=)
exten => 5186644185,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5186644185,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5186644185,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5186644185,n,Set(_KEEPCID=TRUE)
exten => 5186644185,n,Goto(ivr-4,s,1)

exten => 5188435993,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5188435993,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5188435993,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5188435993,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5188435993,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5188435993,n,Set(_NODEST=)
exten => 5188435993,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5188435993,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5188435993,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5188435993,n,Set(_KEEPCID=TRUE)
exten => 5188435993,n,Goto(ivr-4,s,1)

exten => 5188692429,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 5188692429,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 5188692429,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 5188692429,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 5188692429,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 5188692429,n,Set(_NODEST=)
exten => 5188692429,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 5188692429,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 5188692429,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 5188692429,n,Set(_KEEPCID=TRUE)
exten => 5188692429,n,Goto(ivr-4,s,1)

exten => 6095815502,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6095815502,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6095815502,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6095815502,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6095815502,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6095815502,n,Set(_NODEST=)
exten => 6095815502,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6095815502,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6095815502,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6095815502,n,Set(_KEEPCID=TRUE)
exten => 6095815502,n,Goto(ivr-4,s,1)

exten => 6173183250,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6173183250,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6173183250,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6173183250,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6173183250,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6173183250,n,Set(_NODEST=)
exten => 6173183250,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6173183250,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6173183250,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6173183250,n,Set(_KEEPCID=TRUE)
exten => 6173183250,n,Goto(ivr-4,s,1)

exten => 6177868899,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6177868899,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6177868899,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6177868899,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6177868899,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6177868899,n,Set(_NODEST=)
exten => 6177868899,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6177868899,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6177868899,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6177868899,n,Set(_KEEPCID=TRUE)
exten => 6177868899,n,Goto(ivr-4,s,1)

exten => 6188334511,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6188334511,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6188334511,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6188334511,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6188334511,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6188334511,n,Set(_NODEST=)
exten => 6188334511,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6188334511,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6188334511,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6188334511,n,Set(_KEEPCID=TRUE)
exten => 6188334511,n,Goto(ivr-4,s,1)

exten => 6263975116,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6263975116,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6263975116,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6263975116,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6263975116,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6263975116,n,Set(_NODEST=)
exten => 6263975116,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6263975116,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6263975116,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6263975116,n,Set(_KEEPCID=TRUE)
exten => 6263975116,n,Goto(ivr-4,s,1)

exten => 6508887556,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 6508887556,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 6508887556,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 6508887556,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 6508887556,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 6508887556,n,Set(_NODEST=)
exten => 6508887556,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 6508887556,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 6508887556,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 6508887556,n,Set(_KEEPCID=TRUE)
exten => 6508887556,n,Goto(ivr-4,s,1)

exten => 7145370200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7145370200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7145370200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7145370200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7145370200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7145370200,n,Set(_NODEST=)
exten => 7145370200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7145370200,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7145370200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7145370200,n,Set(_KEEPCID=TRUE)
exten => 7145370200,n,Goto(ivr-4,s,1)

exten => 7146152000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7146152000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7146152000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7146152000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7146152000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7146152000,n,Set(_NODEST=)
exten => 7146152000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7146152000,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7146152000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7146152000,n,Set(_KEEPCID=TRUE)
exten => 7146152000,n,Goto(ivr-4,s,1)

exten => 7146752000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7146752000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7146752000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7146752000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7146752000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7146752000,n,Set(_NODEST=)
exten => 7146752000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7146752000,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7146752000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7146752000,n,Set(_KEEPCID=TRUE)
exten => 7146752000,n,Goto(ivr-4,s,1)

exten => 7149525027,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7149525027,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7149525027,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7149525027,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7149525027,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7149525027,n,Set(_NODEST=)
exten => 7149525027,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7149525027,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7149525027,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7149525027,n,Set(_KEEPCID=TRUE)
exten => 7149525027,n,Goto(ivr-4,s,1)

exten => 7149923940,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7149923940,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7149923940,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7149923940,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7149923940,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7149923940,n,Set(_NODEST=)
exten => 7149923940,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7149923940,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7149923940,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7149923940,n,Set(_KEEPCID=TRUE)
exten => 7149923940,n,Goto(ivr-4,s,1)

exten => 7182508000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7182508000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7182508000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7182508000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7182508000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7182508000,n,Set(_NODEST=)
exten => 7182508000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7182508000,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7182508000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7182508000,n,Set(_KEEPCID=TRUE)
exten => 7182508000,n,Goto(ivr-4,s,1)

exten => 7277733126,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7277733126,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7277733126,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7277733126,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7277733126,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7277733126,n,Set(_NODEST=)
exten => 7277733126,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7277733126,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7277733126,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7277733126,n,Set(_KEEPCID=TRUE)
exten => 7277733126,n,Goto(ivr-4,s,1)

exten => 7277733203,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7277733203,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7277733203,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7277733203,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7277733203,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7277733203,n,Set(_NODEST=)
exten => 7277733203,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7277733203,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7277733203,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7277733203,n,Set(_KEEPCID=TRUE)
exten => 7277733203,n,Goto(ivr-4,s,1)

exten => 7604150071,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7604150071,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7604150071,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7604150071,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7604150071,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7604150071,n,Set(_NODEST=)
exten => 7604150071,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7604150071,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7604150071,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7604150071,n,Set(_KEEPCID=TRUE)
exten => 7604150071,n,Goto(ivr-4,s,1)

exten => 7606337746,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7606337746,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7606337746,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7606337746,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7606337746,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7606337746,n,Set(_NODEST=)
exten => 7606337746,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7606337746,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 7606337746,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7606337746,n,Set(_KEEPCID=TRUE)
exten => 7606337746,n,Goto(ivr-4,s,1)

exten => 7606346661,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7606346661,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7606346661,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7606346661,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7606346661,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7606346661,n,Set(_NODEST=)
exten => 7606346661,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7606346661,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7606346661,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7606346661,n,Set(_KEEPCID=TRUE)
exten => 7606346661,n,Goto(ivr-4,s,1)

exten => 7607248411,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7607248411,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7607248411,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7607248411,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7607248411,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7607248411,n,Set(_NODEST=)
exten => 7607248411,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7607248411,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7607248411,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7607248411,n,Set(_KEEPCID=TRUE)
exten => 7607248411,n,Goto(ivr-4,s,1)

exten => 7708745400,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7708745400,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7708745400,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7708745400,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7708745400,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7708745400,n,Set(_NODEST=)
exten => 7708745400,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7708745400,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7708745400,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7708745400,n,Set(_KEEPCID=TRUE)
exten => 7708745400,n,Goto(ivr-4,s,1)

exten => 7738973016,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7738973016,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7738973016,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7738973016,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7738973016,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7738973016,n,Set(_NODEST=)
exten => 7738973016,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7738973016,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7738973016,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7738973016,n,Set(_KEEPCID=TRUE)
exten => 7738973016,n,Goto(ivr-4,s,1)

exten => 7876191830,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7876191830,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7876191830,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7876191830,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7876191830,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7876191830,n,Set(_NODEST=)
exten => 7876191830,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7876191830,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7876191830,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7876191830,n,Set(_KEEPCID=TRUE)
exten => 7876191830,n,Goto(ivr-4,s,1)

exten => 7876726638,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7876726638,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7876726638,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7876726638,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7876726638,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7876726638,n,Set(_NODEST=)
exten => 7876726638,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7876726638,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7876726638,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7876726638,n,Set(_KEEPCID=TRUE)
exten => 7876726638,n,Goto(ivr-4,s,1)

exten => 7878271110,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 7878271110,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 7878271110,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 7878271110,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 7878271110,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 7878271110,n,Set(_NODEST=)
exten => 7878271110,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 7878271110,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 7878271110,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 7878271110,n,Set(_KEEPCID=TRUE)
exten => 7878271110,n,Goto(ivr-4,s,1)

exten => 8003082794,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8003082794,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8003082794,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8003082794,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8003082794,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8003082794,n,Set(_NODEST=)
exten => 8003082794,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8003082794,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8003082794,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8003082794,n,Set(_KEEPCID=TRUE)
exten => 8003082794,n,Goto(ivr-4,s,1)

exten => 8055788300,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8055788300,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8055788300,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8055788300,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8055788300,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8055788300,n,Set(_NODEST=)
exten => 8055788300,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8055788300,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8055788300,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8055788300,n,Set(_KEEPCID=TRUE)
exten => 8055788300,n,Goto(ivr-4,s,1)

exten => 8187082222,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8187082222,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8187082222,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8187082222,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8187082222,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8187082222,n,Set(_NODEST=)
exten => 8187082222,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8187082222,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8187082222,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8187082222,n,Set(_KEEPCID=TRUE)
exten => 8187082222,n,Goto(ivr-4,s,1)

exten => 8436929571,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8436929571,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8436929571,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8436929571,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8436929571,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8436929571,n,Set(_NODEST=)
exten => 8436929571,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8436929571,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8436929571,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8436929571,n,Set(_KEEPCID=TRUE)
exten => 8436929571,n,Goto(ivr-4,s,1)

exten => 8453316211,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8453316211,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8453316211,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8453316211,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8453316211,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8453316211,n,Set(_NODEST=)
exten => 8453316211,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8453316211,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8453316211,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8453316211,n,Set(_KEEPCID=TRUE)
exten => 8453316211,n,Goto(ivr-4,s,1)

exten => 8454731188,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8454731188,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8454731188,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8454731188,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8454731188,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8454731188,n,Set(_NODEST=)
exten => 8454731188,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8454731188,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8454731188,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8454731188,n,Set(_KEEPCID=TRUE)
exten => 8454731188,n,Goto(ivr-4,s,1)

exten => 8582317980,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8582317980,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8582317980,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8582317980,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8582317980,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8582317980,n,Set(_NODEST=)
exten => 8582317980,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8582317980,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 8582317980,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8582317980,n,Set(_KEEPCID=TRUE)
exten => 8582317980,n,Goto(ivr-4,s,1)

exten => 8582788300,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8582788300,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8582788300,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8582788300,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8582788300,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8582788300,n,Set(_NODEST=)
exten => 8582788300,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8582788300,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8582788300,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8582788300,n,Set(_KEEPCID=TRUE)
exten => 8582788300,n,Goto(ivr-4,s,1)

exten => 8584994000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8584994000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8584994000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8584994000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8584994000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8584994000,n,Set(_NODEST=)
exten => 8584994000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8584994000,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8584994000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8584994000,n,Set(_KEEPCID=TRUE)
exten => 8584994000,n,Goto(ivr-4,s,1)

exten => 8584996446,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8584996446,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8584996446,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8584996446,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8584996446,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8584996446,n,Set(_NODEST=)
exten => 8584996446,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8584996446,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8584996446,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8584996446,n,Set(_KEEPCID=TRUE)
exten => 8584996446,n,Goto(ivr-4,s,1)

exten => 8585548545,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8585548545,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8585548545,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8585548545,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8585548545,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8585548545,n,Set(_NODEST=)
exten => 8585548545,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8585548545,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 8585548545,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8585548545,n,Set(_KEEPCID=TRUE)
exten => 8585548545,n,Goto(ivr-4,s,1)

exten => 8586780310,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8586780310,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8586780310,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8586780310,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8586780310,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8586780310,n,Set(_NODEST=)
exten => 8586780310,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8586780310,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8586780310,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8586780310,n,Set(_KEEPCID=TRUE)
exten => 8586780310,n,Goto(ivr-4,s,1)

exten => 8589749755,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8589749755,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8589749755,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8589749755,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8589749755,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8589749755,n,Set(_NODEST=)
exten => 8589749755,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8589749755,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8589749755,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8589749755,n,Set(_KEEPCID=TRUE)
exten => 8589749755,n,Goto(ivr-4,s,1)

exten => 8644540000,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 8644540000,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 8644540000,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 8644540000,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 8644540000,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 8644540000,n,Set(_NODEST=)
exten => 8644540000,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 8644540000,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 8644540000,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 8644540000,n,Set(_KEEPCID=TRUE)
exten => 8644540000,n,Goto(ivr-4,s,1)

exten => 9094726189,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9094726189,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9094726189,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9094726189,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9094726189,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9094726189,n,Set(_NODEST=)
exten => 9094726189,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9094726189,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9094726189,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9094726189,n,Set(_KEEPCID=TRUE)
exten => 9094726189,n,Goto(ivr-4,s,1)

exten => 9098061063,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9098061063,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9098061063,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9098061063,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9098061063,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9098061063,n,Set(_NODEST=)
exten => 9098061063,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9098061063,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9098061063,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9098061063,n,Set(_KEEPCID=TRUE)
exten => 9098061063,n,Goto(ivr-4,s,1)

exten => 9098061529,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9098061529,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9098061529,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9098061529,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9098061529,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9098061529,n,Set(_NODEST=)
exten => 9098061529,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9098061529,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9098061529,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9098061529,n,Set(_KEEPCID=TRUE)
exten => 9098061529,n,Goto(ivr-4,s,1)

exten => 9098861600,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9098861600,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9098861600,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9098861600,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9098861600,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9098861600,n,Set(_NODEST=)
exten => 9098861600,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9098861600,n,Macro(dialout-trunk,9,${EXTEN},,off)
exten => 9098861600,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9098861600,n,Set(_KEEPCID=TRUE)
exten => 9098861600,n,Goto(ivr-4,s,1)

exten => 9098876333,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9098876333,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9098876333,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9098876333,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9098876333,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9098876333,n,Set(_NODEST=)
exten => 9098876333,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9098876333,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9098876333,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9098876333,n,Set(_KEEPCID=TRUE)
exten => 9098876333,n,Goto(ivr-4,s,1)

exten => 9253015005,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9253015005,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9253015005,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9253015005,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9253015005,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9253015005,n,Set(_NODEST=)
exten => 9253015005,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9253015005,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9253015005,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9253015005,n,Set(_KEEPCID=TRUE)
exten => 9253015005,n,Goto(ivr-4,s,1)

exten => 9412572930,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9412572930,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9412572930,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9412572930,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9412572930,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9412572930,n,Set(_NODEST=)
exten => 9412572930,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9412572930,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9412572930,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9412572930,n,Set(_KEEPCID=TRUE)
exten => 9412572930,n,Goto(ivr-4,s,1)

exten => 9413428200,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9413428200,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9413428200,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9413428200,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9413428200,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9413428200,n,Set(_NODEST=)
exten => 9413428200,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9413428200,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9413428200,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9413428200,n,Set(_KEEPCID=TRUE)
exten => 9413428200,n,Goto(ivr-4,s,1)

exten => 9513030575,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9513030575,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9513030575,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9513030575,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9513030575,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9513030575,n,Set(_NODEST=)
exten => 9513030575,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9513030575,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9513030575,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9513030575,n,Set(_KEEPCID=TRUE)
exten => 9513030575,n,Goto(ivr-4,s,1)

exten => 9516524343,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9516524343,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9516524343,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9516524343,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9516524343,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9516524343,n,Set(_NODEST=)
exten => 9516524343,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9516524343,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9516524343,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9516524343,n,Set(_KEEPCID=TRUE)
exten => 9516524343,n,Goto(ivr-4,s,1)

exten => 9516961818,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9516961818,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9516961818,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9516961818,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9516961818,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9516961818,n,Set(_NODEST=)
exten => 9516961818,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9516961818,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9516961818,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9516961818,n,Set(_KEEPCID=TRUE)
exten => 9516961818,n,Goto(ivr-4,s,1)

exten => 9516962928,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9516962928,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9516962928,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9516962928,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9516962928,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9516962928,n,Set(_NODEST=)
exten => 9516962928,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9516962928,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9516962928,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9516962928,n,Set(_KEEPCID=TRUE)
exten => 9516962928,n,Goto(ivr-4,s,1)

exten => 9516965388,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9516965388,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9516965388,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9516965388,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9516965388,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9516965388,n,Set(_NODEST=)
exten => 9516965388,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9516965388,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9516965388,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9516965388,n,Set(_KEEPCID=TRUE)
exten => 9516965388,n,Goto(ivr-4,s,1)

exten => 9549423991,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => 9549423991,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => 9549423991,n,Set(ROUTE_CIDSAVE=${CALLERID(all)})
exten => 9549423991,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => 9549423991,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=9000))
exten => 9549423991,n,Set(_NODEST=)
exten => 9549423991,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => 9549423991,n,Macro(dialout-trunk,9,1${EXTEN},,off)
exten => 9549423991,n,Set(CALLERID(all)=${ROUTE_CIDSAVE})
exten => 9549423991,n,Set(_KEEPCID=TRUE)
exten => 9549423991,n,Goto(ivr-4,s,1)

;--== end of [outrt-3] ==--;


[outrt-1] ; Primary
exten => _1NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
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,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,5,${EXTEN},,on)
exten => _1NXXNXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},,on)
exten => _1NXXNXXXXXX,n,Macro(outisbusy,)

exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
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,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,5,1${EXTEN},,on)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,3,1${EXTEN},,on)
exten => _NXXNXXXXXX,n,Macro(outisbusy,)

exten => _NXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
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,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => _NXXXXXX,n,Macro(dialout-trunk,5,1949${EXTEN},,on)
exten => _NXXXXXX,n,Macro(dialout-trunk,3,1949${EXTEN},,on)
exten => _NXXXXXX,n,Macro(outisbusy,)

;--== end of [outrt-1] ==--;


[app-blackhole]
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]
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] ==--;


[macro-confirm]
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]
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]
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]
exten => s,1,Authenticate(${ARG3},)
exten => s,n,ResetCDR()
exten => s,n,Return()

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


[macro-dialout-trunk]
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},${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 => 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]
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]
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(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(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]
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,ExecIf($["${OUTKEEPCID_${ARG1}}" = "cnum"]?Set(CALLERID(name)=))
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-dahdi
exten => foo,1,Noop(bar)

;--== end of [from-zaptel] ==--;


[from-dahdi]
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] ==--;


[vm-callme]
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] ==--;


[macro-dial-confirm]
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]
exten => s,1,Set(CHANNEL(musicclass)=${ARG1})

;--== end of [macro-setmusic] ==--;


[macro-block-cf]
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]
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,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,Macro(get-vmcontext,${MEXTEN})
exten => vmx,n,GotoIf($[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.wav)} = 1) || (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.WAV)} = 1)]?tmpgreet)
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(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 (beeb 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-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]
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($["${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},))
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]
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]
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]
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]
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]
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]
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),ExecIf($["${ONETOUCH_RECFILE}"!="" & "${CDR(recordingfile)}"=""]?Set(CDR(recordingfile)=${ONETOUCH_RECFILE}))
exten => s,n,Hangup
exten => s,n,MacroExit()

;--== end of [macro-hangupcall] ==--;


[macro-dial-one]
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,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/${EXTTOCALL}/cidname)})
exten => s,n,Set(CONNECTEDLINE(num)=${EXTTOCALL})
exten => s,n,Set(D_OPTIONS=${D_OPTIONS}I)
exten => s,n(godial),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,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] ==--;


[fop2-park]
exten => _X.,1,Set(ARRAY(RETURN_EXTENSION,RETURN_CONTEXT,PARKBUTTON)=${CUT(EXTEN,:,1)},${CUT(EXTEN,:,2)},${CUT(EXTEN,:,3)})
exten => _X.,n,GotoIf($["${PARKBUTTON}" = "PARK/default"]?dopark)
exten => _X.,n,GotoIf($["${PARKBUTTON}" = ""]?dopark)
exten => _X.,n,Set(PARKINGLOT=${PARKBUTTON:5})
exten => _X.,n(dopark),Park(,${RETURN_CONTEXT},${RETURN_EXTENSION},1,s)

;--== end of [fop2-park] ==--;


[from-internal-additional]
include => park-hints
include => app-recordings
include => vmblast-grp
include => app-fax
include => app-blacklist
include => app-campon-cancel
include => app-campon-request
include => app-campon-toggle
include => ext-group
include => grps
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-hotelwakeup
include => ext-meetme
include => app-dnd-off
include => app-dnd-on
include => app-dnd-toggle
include => ext-dnd-hints
include => ext-queues
include => app-queue-toggle
include => app-queue-caller-count
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-busy-prompting-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-prompting-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-cf-unavailable-prompt-on
include => app-cf-toggle
include => ext-cf-hints
include => ext-intercom-users
include => app-dialvm
include => app-vmmain
include => app-calltrace
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => app-userlogonoff
include => ext-local-confirm
include => findmefollow-ringallv2
include => app-pickup
include => app-zapbarge
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]
exten => h,1,Hangup

;--== end of [from-internal-noxfer-additional] ==--;


