blob: b15a30741989cdf7761f7e23526ebeb9bc3a7ece [file] [log] [blame]
;
; How to use
;
; There are two ways to use this. I use both because I have a private line
; which rings through every time and a public line which only allows whitelisted
; callers. The private line does
;
; exten => s,n,Macro(call-screen,s,next)
; exten => s,n(next),...
;
; The fully screened line plays a house welcome message to un-whitelisted
; callers and makes them press 0 to actually ring the phone,
;
; exten => s,n,Macro(call-screen,0,1)
; exten => s,n,Background(welcome-messge)
; exten => s,n,WaitExten(5)
; exten => s,n,VoiceMail
; exten => 0,1,...
;
[hangup-on-caller]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Background(privacy-you-are-blacklisted)
exten => s,n,Background(if-this-is-not-correct)
exten => s,n,Background(vm-leavemsg)
exten => s,n,WaitExten(5)
exten => s,n,Hangup
exten => 5,1,Background(vm-intro)
exten => 5,n,VoiceMail(103,s)
;
[macro-call-screen]
;
; Screen callers on both blacklist and whitelist. Just go to hangup
; context if they're on whitelist. Go to arg1,arg2 if they're whitelisted
;
exten => s,1,GotoIf(${DB(blacklist/${CALLERID(num)})}?hangup-on-caller,s,1)
exten => s,n,Set(VAL=${DB(whitelist/${CALLERID(num)})})
exten => s,n,GotoIf($[!${EXISTS(${VAL})}]?return)
exten => s,n,Set(CALLERID(name)=${VAL})
exten => s,n,GotoIf($[!${EXISTS(${ARG1})}]?return)
exten => s,n,Goto(${MACRO_CONTEXT},${ARG1},${ARG2})
exten => s,n(return),MacroExit