;
[macro-stdexten] ; still working on issues
;
exten => s,1,GotoIf(${DB(CF/${ARG1})}?2:3) ;Gets Call Forward Number
exten => s,2,Dial(SIP/${DB(CF/${ARG1})}/n) ;Dials the Forwarding Number
;
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,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(${DB(ACRStatus=ACR/${ARG1})
exten => s,10,GotoIf(${ACRStatus}=YES?11:12) ;Get Anonymous Call Rejection Status
exten => s,11,Macro(no-callerid)
;
exten => s,12,Set(${DB(DNDStatus=DND/${ARG1}) ;Sets the variable for the Do not disturb responce
exten => s,13,GotoIf($DB({DNDStatus}=YES?18:14) ;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(${DB(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,Set(${DB(CBBStatus=CBB/${ARG1})
exten => s,119,GotoIf(${CBBStatus}=YES?120:121) ;Checks to see if call back busy is activated. then if activated it
exten => s,120,Macro(busy-callback) ;goes to the busy-call back macro below
;
exten => s,121,Voicemail(b${ARG1}) ;Goes to the Busy Voicemail
exten => s,122,Playback(vm-goodbye) ;Plays Voicemail Goodbye
exten => s,123,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
exten => i,n,Hangup
;
[macro-fastbusy] ; I use this to send people I dont want to deal with
exten => s,1,Answer
exten => s,2,Wait 1
exten => s,3,Playback(all-circuits-busy)
exten => s,4,Wait(30)
exten => s,5,Hangup
;
[macro-caller-id] ;Checks the status of inbound CallerID and directs the call.
exten => s,1,System(test "${CALLERIDNAME}" = "O")
exten => s,2,GotoIf($[${CALLERIDNUM} = O]?3:102)
exten => s,3,SetCallerIDName("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 with caller id
;
[macro-no-callerid] ; I use this to send people I dont want to deal with
exten => s,1,Answer
exten => s,n,Wait()
exten => s,n,Playback(no-callerid)
exten => s,n,Wait()
exten => s,n,Playback(vm-goodbye)
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,Background(pres-star-one-for-callback)
exten => s,n,DigitTimeout,5
exten => s,n,ResponseTimeout,1
;
exten => *1,1,Set(${DB(CALLBACK/${OLDEXTEN}=1)
exten => *1,2,Set(${DB(CALLBACK2/${OLDEXTEN}=${CALLERIDNUM})
;
exten => h,1,Set(${DB(CB=CALLBACK/${CALLERIDNUM})
exten => h,2,Set(${DB(CB2=CALLBACK2/${CALLERIDNUM})
exten => h,3,GotoIf,"$[X${CALLBACK} = "X"]?5:4"
exten => h,4,System(...create call file use CB and CB2)
exten => h,5,NOOP()
;