;--------------------------------------------------------------------
; Start - Internal Extension Dialing config / Macro
;--------------------------------------------------------------------
; 1000 - 9999 Internal SIP/IAX/MGCP/H323/SCCP/SKINNY/ECT USER EXTEN
;---------------------------------------------------------------------------
[all-exten]
;Extensions with Voicemail
exten => NXXX,1,Macro(stdexten,${EXTEN},${VM_DELAY})
;
; Extensions with no voicemail
;exten => ,1,Macro(stdexten,${EXTEN},${NO_VM_TIMEOUT})
;---------------------------------------------------------------------------
;
[macro-stdexten]
;
exten => s,1,GotoIf(${DB(CF/${ARG1})}?2:3) ;Gets Call Forward Number
exten => s,2,Dial(SIP/${DB(CF/${ARG1})}/n) ;Dials the Forward Number
;
exten => s,3,Set(${DB(SCFE/${ARG1})=${CALLERIDNUM}) ;Sets the nmbr that if they call in it gets forwarded to another nmbr/exten
exten => s,4,GotoIf(${DB(SCFE/${ARG1})}?5:6) ;Get Selective Call Forward Number
exten => s,5,Dial(SIP/${DB(SCFN/${ARG1})}/n) ;Selective Call Forward
;
exten => s,6,Set(${DB(SCRN/${ARG1})=${CALLERIDNUM}) ;Reads the Database for for nmbrs it should not allow threw.
exten => s,7,GotoIf(${DB(SCRN/${ARG1})}?8:9) ;Get Selective Call Rejection Status
exten => s,8,Hangup ;Sends Rejected calls to a all extensions are busy macro.
;
exten => s,9,Set(ACRStatus=ACR/${ARG1})
exten => s,10,GotoIf(${DB(ACR/${ARG1})}?11:12) ;Get Anonymous Call Rejection Status
exten => s,11,Macro(no-callerid)
;
exten => s,12,Set(DNDStatus=DND/${ARG1}) ;Sets the variable for the Do not disturb responce
exten => s,13,GotoIf(${DNDStatus}=YES?119:13) ;Checks the Database for the status/ responce
;
exten => s,14,Set(${DB(LASTCALL/${ARG1})=${CALLERIDNUM}) ;Places Current caller ID into the Database
exten => s,15,Dial(SIP/${ARG1}|${ARG2}|r) ;Dials the extension and waits for the time out
;
exten => s,16,GotoIf(${DB(CFNA/${ARG1})}?16:17) ;Call Forwarding On No Answer
exten => s,17,Dial(SIP/${DB(CFNA/${ARG1})}/n) ;Dials the No Answer forward Number
exten => s,18,Set(VMStatus=VM/${ARG1}) ; Checks to see if user has voice mail active or disabled.
exten => s,19,GotoIf(${VMStatus}=YES?20:118) ; If active it goes to voice mail. If not active it goes to busy- call checking macro.
exten => s,20,Voicemail(u${ARG1}) ;Goes to the unavaible Voicemail
exten => s,21,Playback(vm-goodbye) ;Plays Voicemail Goodbye
exten => s,22,Hangup ;Does a hard hangup
;
exten => s,116,GotoIf(${DB(CFB/${ARG1})}?117:118) ;Gets the Call Forwading On Busy status/number
exten => s,117,Dial(Local/${DB(CFB/${ARG1})}/n) ;Dials the CallForwarding nmber/exten
;
exten => s,118,GotoIf(${DB(CBB/${ARG1})}?119:120) ;Checks to see if call back busy is activated. then if activated it
exten => s,119,Macro(busy-callback) ;goes to the busy-call back macro below
;
exten => s,120,Voicemail(b${ARG1}) ;Goes to the Busy Voicemail
exten => s,121,Playback(vm-goodbye) ;Plays Voicemail Goodbye
exten => s,122,Hangup ;Does a hard hangup
;If extension does not exist it gives tritone + number unassigned message to unasigned numbers
exten => i,1,Answer
exten => i,n,Playback(the-number-u-dialed,noanswer)
exten => i,n,SayDigits(${ARG1})
exten => i,n,Playback(not-yet-assigned,noanswer)
exten => i,n,Busy
;
[macro-caller-id]
exten => s,1,System(test "${CALLERIDNAME}" = "O")
exten => s,2,GotoIf($[${CALLERIDNUM} = O]?3:102)
exten => s,3,SetCaller("No Caller ID")
exten => s,4,Macro(no-callerid,s,1) ;Sends Callers with no id to no-callerid macro below.
exten => s,102,Macro(stdexten,s,12) ; landing point
;
[macro-no-callerid] ; I use this to send people I dont want to deal with
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(no-callerid)
exten => s,n,Wait(1)
exten => s,n,Congestion
exten => s,n,Hangup
;
[macro-busy-callback]
exten => s,1,Answer
exten => s,n,Wait()
exten => s,n,Background(exten-busy-callback)
exten => s,n,DigitTimeout,5
exten => s,n,ResponseTimeout,1
;
exten => 1,1,
;
;--------------------------------------------------------------------
; End - Interl Dialing config / Macro
;--------------------------------------------------------------------