; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui


[globals]
#include globals_custom.conf
CALLFILENAME = ""
DIAL_OPTIONS = tTm
TRUNK_OPTIONS = 
DIAL_OUT = 9
FAX = 
FAX_RX = system
FAX_RX_EMAIL = pedro.a@xxxxx.com
FAX_RX_FROM = pedro.a@xxxxx.com
INCOMING = group-all
NULL = ""
OPERATOR = 
OPERATOR_XTN = 
PARKNOTIFY = SIP/200
RECORDEXTEN = ""
RINGTIMER = 30
DIRECTORY = 
AFTER_INCOMING = 
IN_OVERRIDE = forcereghours
REGTIME = 7:55-17:05
REGDAYS = mon-fri
DIRECTORY_OPTS = 
DIALOUTIDS = 1/2/3/4/5/6/
OUTCID_2 = 
VM_PREFIX = *
VM_OPTS = 
VM_GAIN = 
VM_DDTYPE = u
TIMEFORMAT = kM
TONEZONE = br
ALLOW_SIP_ANON = no
VMX_CONTEXT = 
VMX_PRI = 
VMX_TIMEDEST_CONTEXT = 
VMX_TIMEDEST_EXT = 
VMX_TIMEDEST_PRI = 
VMX_LOOPDEST_CONTEXT = 
VMX_LOOPDEST_EXT = 
VMX_LOOPDEST_PRI = 
VMX_OPTS_TIMEOUT = 
VMX_OPTS_LOOP = 
VMX_OPTS_DOVM = 
VMX_TIMEOUT = 
VMX_REPEAT = 
VMX_LOOPS = 
TRANSFER_CONTEXT = from-internal-xfer
ZAPTEL_DELAY = 0
OUTMAXCHANS_2 = 
OUTPREFIX_2 = 
OUT_2 = DGV/4
OUTDISABLE_3 = off
OUTFAIL_3 = 
OUTKEEPCID_3 = off
OUTCID_3 = 
OUTMAXCHANS_3 = 
OUTPREFIX_3 = 21
OUT_3 = SIP/phoneclub2
OUTDISABLE_1 = off
OUTFAIL_1 = 
OUTKEEPCID_1 = off
OUTCID_1 = 
OUTMAXCHANS_1 = 
OUTPREFIX_1 = 21
OUT_1 = SIP/phoneclub
OUTKEEPCID_2 = off
OUTFAIL_2 = 
OUTDISABLE_2 = off
OUTDISABLE_4 = off
OUTFAIL_4 = 
OUTKEEPCID_4 = off
OUTCID_4 = 
OUTMAXCHANS_4 = 
OUTPREFIX_4 = 
OUT_4 = SIP/vono
OUTDISABLE_5 = off
OUTFAIL_5 = 
OUTKEEPCID_5 = off
OUTCID_5 = 
OUTMAXCHANS_5 = 
OUTPREFIX_5 = +5521
OUT_5 = SIP/Gizmo5
OUTDISABLE_6 = off
OUTFAIL_6 = 
OUTKEEPCID_6 = off
OUTCID_6 = 
OUTMAXCHANS_6 = 
OUTPREFIX_6 = 
OUT_6 = SIP/teleligue
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
ASTLOGDIR = /var/log/asterisk
CWINUSEBUSY = true
AMPMGRUSER = admin
AMPMGRPASS = digi


;end of [globals]


[ext-queues]
include => ext-queues-custom
exten => 50,1,Macro(user-callerid,)
exten => 50,n,Answer
exten => 50,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 50,n,Set(__BLKVM_BASE=${EXTEN})
exten => 50,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 50,n,Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm))
exten => 50,n,Set(__NODEST=${EXTEN})
exten => 50,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
exten => 50,n,Queue(50,t,,,60)
exten => 50,n,dbDel(${BLKVM_OVERRIDE})
exten => 50,n,Set(__NODEST=)
exten => 50,n,Goto(from-did-direct,1,1)
exten => 50*,1,Macro(agent-add,50,)
exten => 50**,1,Macro(agent-del,50,50)

; end of [ext-queues]


[app-dialvm]
include => app-dialvm-custom
exten => *98,1,Answer
exten => *98,n,Wait(1)
exten => *98,n,VoiceMailMain()
exten => *98,n,Macro(hangupcall,)
exten => _*98.,1,Answer
exten => _*98.,n,Wait(1)
exten => _*98.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _*98.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _*98.,n,Macro(hangupcall,)

; end of [app-dialvm]


[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),VoiceMailMain(${CALLERID(num)}@${VMCONTEXT})
exten => *97,n,Macro(hangupcall,)

; end of [app-vmmain]


[app-recordings]
include => app-recordings-custom
exten => *77,1,Macro(user-callerid,)
exten => *77,n,Wait(2)
exten => *77,n,Macro(systemrecording,dorecord)
exten => *99,1,Macro(user-callerid,)
exten => *99,n,Wait(2)
exten => *99,n,Macro(systemrecording,docheck)

; end of [app-recordings]


[ext-recordings]
include => ext-recordings-custom
exten => recording-3,1,Answer
exten => recording-3,n,Playback(custom/anuncio)
exten => recording-3,n,Hangup
exten => recording-2,1,Answer
exten => recording-2,n,Playback(custom/exemplo)
exten => recording-2,n,Hangup

; end of [ext-recordings]


[park-dial]
include => park-dial-custom
exten => t,1,Noop(Parked Call Timed Out and Got Orphaned)
exten => t,n,Goto(from-did-direct,1,1)

; end of [park-dial]


[app-blacklist-check]
include => app-blacklist-check-custom
exten => s,1,LookupBlacklist()
exten => s,n,GotoIf($["${LOOKUPBLSTATUS}"="FOUND"]?blacklisted)
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]
include => app-blacklist-custom
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-add]
include => app-blacklist-add-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,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,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-last]
include => app-blacklist-last-custom
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]
include => app-blacklist-remove-custom
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,dbDel(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-miscapps-1]
include => app-miscapps-1-custom
exten => *33,1,Noop(Running miscapp 1: Fax)
exten => *33,n,Goto(custom-fax,fax,1)

; end of [app-miscapps-1]


[app-calltrace]
include => app-calltrace-custom
exten => *69,1,Goto(app-calltrace-perform,s,1)

; end of [app-calltrace]


[app-calltrace-perform]
include => app-calltrace-perform-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,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]
include => app-echo-test-custom
exten => *43,1,Answer
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]
include => app-speakextennum-custom
exten => *65,1,Answer
exten => *65,n,Wait(1)
exten => *65,n,Macro(user-callerid,)
exten => *65,n,Playback(your)
exten => *65,n,Playback(extension)
exten => *65,n,Playback(is)
exten => *65,n,SayDigits(${AMPUSER})
exten => *65,n,Wait(2)
exten => *65,n,Hangup

; end of [app-speakextennum]


[app-speakingclock]
include => app-speakingclock-custom
exten => *60,1,Answer
exten => *60,n,Wait(1)
exten => *60,n,Set(NumLoops=0)
exten => *60,n(start),Set(FutureTime=$[${EPOCH} + 11])
exten => *60,n,Playback(at-tone-time-exactly)
exten => *60,n,GotoIf($["${TIMEFORMAT}" = "kM"]?hr24format)
exten => *60,n,SayUnixTime(${FutureTime},,IM \'and\' S \'seconds\' p)
exten => *60,n,Goto(waitloop)
exten => *60,n(hr24format),SayUnixTime(${FutureTime},,kM \'and\' S \'seconds\')
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]


[ext-group]
include => ext-group-custom
exten => 600,1,Macro(user-callerid,)
exten => 600,n,GotoIf($["foo${BLKVM_OVERRIDE}" = "foo"]?skipdb)
exten => 600,n,GotoIf($["${DB(${BLKVM_OVERRIDE})}" = "TRUE"]?skipov)
exten => 600,n(skipdb),Set(__NODEST=)
exten => 600,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 600,n,Set(__BLKVM_BASE=${EXTEN})
exten => 600,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 600,n(skipov),Set(RRNODEST=${NODEST})
exten => 600,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 600,n,Set(RecordMethod=Group)
exten => 600,n,Macro(record-enable,1-2-3,${RecordMethod})
exten => 600,n,Set(RingGroupMethod=ringall)
exten => 600,n(DIALGRP),Macro(dial,50,${DIAL_OPTIONS},1-2-3)
exten => 600,n,Set(RingGroupMethod=)
exten => 600,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 600,n,Set(__NODEST=)
exten => 600,n,dbDel(${BLKVM_OVERRIDE})
exten => 600,n,Goto(from-did-direct,1,1)
exten => 600,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})
exten => 601,1,Macro(user-callerid,)
exten => 601,n,GotoIf($["foo${BLKVM_OVERRIDE}" = "foo"]?skipdb)
exten => 601,n,GotoIf($["${DB(${BLKVM_OVERRIDE})}" = "TRUE"]?skipov)
exten => 601,n(skipdb),Set(__NODEST=)
exten => 601,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 601,n,Set(__BLKVM_BASE=${EXTEN})
exten => 601,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 601,n(skipov),Set(RRNODEST=${NODEST})
exten => 601,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 601,n,Set(RecordMethod=Group)
exten => 601,n,Macro(record-enable,,${RecordMethod})
exten => 601,n,Set(RingGroupMethod=ringall)
exten => 601,n(DIALGRP),Macro(dial,60,${DIAL_OPTIONS},)
exten => 601,n,Set(RingGroupMethod=)
exten => 601,n,GotoIf($["foo${RRNODEST}" != "foo"]?nodest)
exten => 601,n,Set(__NODEST=)
exten => 601,n,dbDel(${BLKVM_OVERRIDE})
exten => 601,n,Hangup
exten => 601,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

; end of [ext-group]


[macro-pinsets]
include => macro-pinsets-custom
exten => s,1,GotoIf(${ARG2} = 1?cdr,1)
exten => s,n,Authenticate(/etc/asterisk/pinset_${ARG1},)
exten => cdr,1,Authenticate(/etc/asterisk/pinset_${ARG1},a)

; end of [macro-pinsets]


[ivr-3]
include => ivr-3-custom
include => ext-findmefollow
include => ext-local
exten => h,1,Hangup
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Background(custom/exemplo)
exten => s,n,WaitExten(,)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => i,1,Playback(invalid)
exten => i,n,Goto(loop,1)
exten => t,1,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 2]?hang,1)
exten => loop,n,Goto(ivr-3,s,begin)
exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Goto(ivr-3,s,begin)
exten => fax,1,Goto(ext-fax,in_fax,1)

; end of [ivr-3]


[app-cf-busy-off]
include => app-cf-busy-off-custom
exten => *91,1,Answer
exten => *91,n,Wait(1)
exten => *91,n,Macro(user-callerid,)
exten => *91,n,dbDel(CFB/${AMPUSER})
exten => *91,n,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,dbDel(CFB/${fromext})
exten => _*91.,n,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]
include => app-cf-busy-off-any-custom
exten => *92,1,Answer
exten => *92,n,Wait(1)
exten => *92,n,Playback(please-enter-your&extension)
exten => *92,n,Read(fromext,then-press-pound,,,,)
exten => *92,n,Wait(1)
exten => *92,n,dbDel(CFB/${fromext})
exten => *92,n,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]
include => app-cf-busy-on-custom
exten => *90,1,Answer
exten => *90,n,Wait(1)
exten => *90,n,Macro(user-callerid,)
exten => *90,n,Playback(call-fwd-on-busy)
exten => *90,n,Playback(please-enter-your&extension)
exten => *90,n,Read(fromext,then-press-pound,,,,)
exten => *90,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *90,n,Wait(1)
exten => *90,n(startread),Playback(ent-target-attendant)
exten => *90,n,Read(toext,then-press-pound,,,,)
exten => *90,n,GotoIf($["foo${toext}"="foo"]?startread)
exten => *90,n,Wait(1)
exten => *90,n,Set(DB(CFB/${fromext})=${toext})
exten => *90,n,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(DB(CFB/${AMPUSER})=${EXTEN:3})
exten => _*90.,n,Playback(call-fwd-on-busy&for&extension)
exten => _*90.,n,SayDigits(${AMPUSER})
exten => _*90.,n,Playback(is-set-to)
exten => _*90.,n,SayDigits(${EXTEN:3})
exten => _*90.,n,Macro(hangupcall,)

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


[app-cf-off]
include => app-cf-off-custom
exten => *73,1,Answer
exten => *73,n,Wait(1)
exten => *73,n,Macro(user-callerid,)
exten => *73,n,dbDel(CF/${AMPUSER})
exten => *73,n,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,dbDel(CF/${fromext})
exten => _*73.,n,Playback(call-fwd-unconditional&for&extension)
exten => _*73.,n,SayDigits(${fromext})
exten => _*73.,n,Playback(cancelled)
exten => _*73.,n,Macro(hangupcall,)

; end of [app-cf-off]


[app-cf-off-any]
include => app-cf-off-any-custom
exten => *74,1,Answer
exten => *74,n,Wait(1)
exten => *74,n,Playback(please-enter-your&extension)
exten => *74,n,Read(fromext,then-press-pound,,,,)
exten => *74,n,Wait(1)
exten => *74,n,dbDel(CF/${fromext})
exten => *74,n,Playback(call-fwd-unconditional&for&extension)
exten => *74,n,SayDigits(${fromext})
exten => *74,n,Playback(cancelled)
exten => *74,n,Macro(hangupcall,)

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


[app-cf-on]
include => app-cf-on-custom
exten => *72,1,Answer
exten => *72,n,Wait(1)
exten => *72,n,Macro(user-callerid,)
exten => *72,n,Playback(call-fwd-unconditional)
exten => *72,n,Playback(please-enter-your&extension)
exten => *72,n,Read(fromext,then-press-pound,,,,)
exten => *72,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *72,n,Wait(1)
exten => *72,n(startread),Playback(ent-target-attendant)
exten => *72,n,Read(toext,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,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(DB(CF/${AMPUSER(number)})=${EXTEN:3})
exten => _*72.,n,Playback(call-fwd-unconditional&for&extension)
exten => _*72.,n,SayDigits(${AMPUSER})
exten => _*72.,n,Playback(is-set-to)
exten => _*72.,n,SayDigits(${EXTEN:3})
exten => _*72.,n,Macro(hangupcall,)

; end of [app-cf-on]


[app-cf-unavailable-off]
include => app-cf-unavailable-off-custom
exten => *53,1,Answer
exten => *53,n,Wait(1)
exten => *53,n,Macro(user-callerid,)
exten => *53,n,dbDel(CFU/${AMPUSER})
exten => *53,n,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,dbDel(CFU/${fromext})
exten => _*53.,n,Playback(call-fwd-no-ans&for&extension)
exten => _*53.,n,SayDigits(${fromext})
exten => _*53.,n,Playback(cancelled)
exten => _*53.,n,Macro(hangupcall,)

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


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

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


[macro-speeddial-lookup]
include => macro-speeddial-lookup-custom
exten => s,1,GotoIf($["${ARG2}"=""]]?lookupsys)
exten => s,n,Set(SPEEDDIALNUMBER=)
exten => s,n(lookupuser),Set(SPEEDDIALNUMBER=${DB(AMPUSER/${ARG2}/speeddials/${ARG1})})
exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?lookupsys)
exten => s,n,Noop(Found speeddial ${ARG1} for user ${ARG2}: ${SPEEDDIALNUMBER})
exten => s,n,Goto(end)
exten => s,lookupuser+101(lookupsys),Set(SPEEDDIALNUMBER=${DB(sysspeeddials/${ARG1})})
exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?failed)
exten => s,n,Noop(Found system speeddial ${ARG1}: ${SPEEDDIALNUMBER})
exten => s,n,Goto(end)
exten => s,lookupsys+101(failed),Noop(No system or user speeddial found)
exten => s,n(end),Noop(End of Speeddial-lookup)

; end of [macro-speeddial-lookup]


[app-speeddial]
include => app-speeddial-custom
exten => _*0.,1,Macro(user-callerid,)
exten => _*0.,n,Set(SPEEDDIALLOCATION=${EXTEN:2})
exten => _*0.,n(lookup),Macro(speeddial-lookup,${SPEEDDIALLOCATION},${AMPUSER})
exten => _*0.,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?failed)
exten => _*0.,n,Dial(Local/${SPEEDDIALNUMBER}@from-internal/n,)
exten => _*0.,lookup+101(failed),Playback(speed-dial-empty)
exten => _*0.,n,Congestion(20)
exten => *75,1,Goto(app-speeddial-set,s,1)

; end of [app-speeddial]


[app-speeddial-set]
include => app-speeddial-set-custom
exten => s,1,Macro(user-callerid,)
exten => s,n(setloc),Read(newlocation,speed-enterlocation,,,,)
exten => s,n(lookup),Macro(speeddial-lookup,${newlocation},${AMPUSER})
exten => s,n(lookup),GotoIf($["${SPEEDDIALNUMBER}"!=""]?conflicts)
exten => s,n(setnum),Read(newnum,speed-enternumber,,,,)
exten => s,n(success),Set(DB(AMPUSER/${AMPUSER}/speeddials/${newlocation})=${newnum})
exten => s,n,Playback(speed-dial)
exten => s,n,SayDigits(${newlocation})
exten => s,n,Playback(is-set-to)
exten => s,n,SayDigits(${newnum})
exten => s,n,Hangup
exten => s,n(conflicts),Playback(speed-dial)
exten => s,n,SayDigits(${newlocation})
exten => s,n,Playback(is-in-use)
exten => s,n,Background(press-1&to-listen-to-it&press-2&to-enter-a-diff&location&press-3&to-change&telephone-number)
exten => 1,1,Playback(speed-dial)
exten => 1,n,SayDigits(${newlocation})
exten => 1,n,Playback(is-set-to)
exten => 1,n,SayDigits(${SPEEDDIALNUMBER})
exten => 1,n,Goto(s,conflicts)
exten => 2,1,Goto(s,setloc)
exten => 3,1,Goto(s,setnum)
exten => t,1,Congestion(20)

; end of [app-speeddial-set]


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

; end of [app-callwaiting-cwoff]


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

; end of [app-callwaiting-cwon]


[app-dnd-off]
include => app-dnd-off-custom
exten => *79,1,Answer
exten => *79,n,Wait(1)
exten => *79,n,Macro(user-callerid,)
exten => *79,n,dbDel(DND/${AMPUSER})
exten => *79,n,Playback(do-not-disturb&de-activated)
exten => *79,n,Macro(hangupcall,)

; end of [app-dnd-off]


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

; end of [app-dnd-on]


[app-userlogonoff]
include => app-userlogonoff-custom
exten => *56,1,Macro(user-logoff,)
exten => *56,n,Hangup
exten => *55,1,Macro(user-logon,)
exten => *55,n,Hangup
exten => _*55.,1,Macro(user-logon,${EXTEN:3},)
exten => _*55.,n,Hangup

; end of [app-userlogonoff]


[app-pickup]
include => app-pickup-custom
exten => _**.,1,Noop(Attempt to Pickup ${EXTEN:2} by ${CALLERID(num)})
exten => _**.,n,Pickup(${EXTEN:2})

; end of [app-pickup]


[app-chanspy]
include => app-chanspy-custom
exten => 555,1,Macro(user-callerid,)
exten => 555,n,Answer
exten => 555,n,Wait(1)
exten => 555,n,ChanSpy()
exten => 555,n,Hangup

; end of [app-chanspy]


[ext-test]
include => ext-test-custom
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall,)

; end of [ext-test]


[ext-did]
include => ext-did-custom
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => s,1,Set(__FROM_DID=s)
exten => s,n,Gosub(app-blacklist-check,s,1)
exten => s,n,GotoIf($[ "${CALLERID(name)}" != "" ] ?cidok)
exten => s,n,Set(CALLERID(name)=${CALLERID(num)})
exten => s,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => s,n,Goto(ext-queues,50,1)
exten => /,1,Set(__FROM_DID=/)
exten => /,n,Gosub(app-blacklist-check,s,1)
exten => /,n,GotoIf($[ "${CALLERID(name)}" != "" ] ?cidok)
exten => /,n,Set(CALLERID(name)=${CALLERID(num)})
exten => /,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => /,n,Goto(from-did-direct,1,1)
exten => 2140627098,1,Set(__FROM_DID=2140627098)
exten => 2140627098,n,Gosub(app-blacklist-check,s,1)
exten => 2140627098,n,GotoIf($[ "${CALLERID(name)}" != "" ] ?cidok)
exten => 2140627098,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 2140627098,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 2140627098,n,Goto(from-did-direct,1,1)

; end of [ext-did]


[ext-did-catchall]
include => ext-did-catchall-custom
exten => _X.,1,Noop(Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.)
exten => _X.,n,Goto(ext-did,s,1)

; end of [ext-did-catchall]


[macro-from-digivoice-4]
include => macro-from-digivoice-4-custom
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => s,1,Noop(Entering macro-from-digivoice-4 with DID = ${DID})
exten => s,n,Gosub(app-blacklist-check,s,1)
exten => s,n,Set(__FROM_DID=s)
exten => s,n,GotoIf($[ "${CALLERID(name)}" != "" ] ?cidok)
exten => s,n,Set(CALLERID(name)=${CALLERID(num)})
exten => s,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => s,n,Ringing()
exten => s,n,Set(FAX_RX_EMAIL=pedro.a@xxxxx.com)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Goto(ext-group,600,1)

; end of [macro-from-digivoice-4]


[ext-local]
include => ext-local-custom
exten => 1,1,Macro(exten-vm,novm,1)
exten => 1,n,Hangup
exten => 1,hint,SIP/1
exten => 2,1,Macro(exten-vm,novm,2)
exten => 2,n,Hangup
exten => 2,hint,SIP/2
exten => 3,1,Macro(exten-vm,novm,3)
exten => 3,n,Hangup
exten => 3,hint,SIP/3
exten => 5,1,Macro(exten-vm,novm,5)
exten => 5,n,Hangup
exten => 5,hint,SIP/5

; end of [ext-local]


[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-Oi
include => outrt-002-vono
include => outrt-003-gizmo
include => outrt-004-phoneclube
include => outrt-005-phoneclub2
include => outrt-006-teleligue
exten => foo,1,Noop(bar)

; end of [outbound-allroutes]


[outrt-001-Oi]
include => outrt-001-Oi-custom
exten => _XXXXX,1,Macro(dialout-trunk,2,${EXTEN},,)
exten => _XXXXX,n,Macro(outisbusy,)
exten => _XXXXXXXXXXX,1,Macro(dialout-trunk,2,${EXTEN},,)
exten => _XXXXXXXXXXX,n,Macro(outisbusy,)
exten => _[2-6]X.,1,Macro(dialout-trunk,2,${EXTEN},,)
exten => _[2-6]X.,n,Macro(outisbusy,)

; end of [outrt-001-Oi]


[outrt-002-vono]
include => outrt-002-vono-custom
exten => _0XXX[2-6]X.,1,Macro(dialout-trunk,4,${EXTEN:1},,)
exten => _0XXX[2-6]X.,n,Macro(outisbusy,)

; end of [outrt-002-vono]


[outrt-003-gizmo]
include => outrt-003-gizmo-custom
exten => _9[2-6]XXXXXXX,1,Macro(dialout-trunk,5,${EXTEN:1},,)
exten => _9[2-6]XXXXXXX,n,Macro(outisbusy,)

; end of [outrt-003-gizmo]


[outrt-004-phoneclube]
include => outrt-004-phoneclube-custom
exten => _3[2-6]XXXXXX.,1,Macro(dialout-trunk,1,${EXTEN:1},,)
exten => _3[2-6]XXXXXX.,n,Macro(outisbusy,)

; end of [outrt-004-phoneclube]


[outrt-005-phoneclub2]
include => outrt-005-phoneclub2-custom
exten => _3X.,1,Macro(dialout-trunk,3,${EXTEN:1},,)
exten => _3X.,n,Macro(outisbusy,)

; end of [outrt-005-phoneclub2]


[outrt-006-teleligue]
include => outrt-006-teleligue-custom
exten => _5[2-6]X.,1,Macro(dialout-trunk,6,${EXTEN:1},,)
exten => _5[2-6]X.,n,Macro(outisbusy,)

; end of [outrt-006-teleligue]


[app-blackhole]
include => app-blackhole-custom
exten => hangup,1,Noop(Blackhole Dest: Hangup)
exten => hangup,n,Hangup
exten => zapateller,1,Noop(Blackhole Dest: Play SIT Tone)
exten => zapateller,n,Answer
exten => zapateller,n,Zapateller()
exten => musiconhold,1,Noop(Blackhole Dest: Put caller on hold forever)
exten => musiconhold,n,Answer
exten => musiconhold,n,MusicOnHold()
exten => congestion,1,Noop(Blackhole Dest: Congestion)
exten => congestion,n,Answer
exten => congestion,n,Playtones(congestion)
exten => congestion,n,Congestion(20)
exten => congestion,n,Hangup
exten => busy,1,Noop(Blackhole Dest: Busy)
exten => busy,n,Answer
exten => busy,n,Playtones(busy)
exten => busy,n,Busy(20)
exten => busy,n,Hangup

; end of [app-blackhole]


[bad-number]
include => bad-number-custom
exten => _X.,1,Wait(1)
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
exten => _*.,1,Wait(1)
exten => _*.,n,Playback(silence/1&feature-not-avail-line&silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _*.,n,Wait(1)
exten => _*.,n,Congestion(20)
exten => _*.,n,Hangup

; end of [bad-number]


[from-internal-additional]
include => from-internal-additional-custom
include => ext-queues
include => ext-findmefollow
include => fmgrps
include => ext-meetme
include => app-dialvm
include => app-vmmain
include => app-recordings
include => app-blacklist
include => app-miscapps-1
include => app-calltrace
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => ext-group
include => grps
include => app-daynight
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-speeddial
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-dnd-off
include => app-dnd-on
include => app-userlogonoff
include => app-pickup
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
exten => h,1,Hangup

; end of [from-internal-additional]


