Blacklist - 黑名單功能,這是 FreePBX 的功能模組之一,這可以用來阻擋特定的來電號碼(CID),以及啟用此功能後,預設也會將未顯示(unknown)的來電也做阻擋。
注意:此功能的原始設計只會對來電號碼(CID)做檢查。
ext-did-0002:
[ext-did-0002] include => ext-did-0002-custom exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}) exten => 0702500268,1,Set(__FROM_DID=${EXTEN}) exten => 0702500268,n,Gosub(app-blacklist-check,s,1()) <===== exten => 0702500268,n,Set(CDR(did)=${FROM_DID}) exten => 0702500268,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)})) exten => 0702500268,n,Set(__CALLINGPRES_SV=${CALLERPRES()}) exten => 0702500268,n,Set(CALLERPRES()=allowed_not_screened) exten => 0702500268,n(dest-ext),Goto(ext-featurecodes,*43,1) ;--== end of [ext-did-0002] ==--;
app-blacklist-check:
[app-blacklist-check] include => app-blacklist-check-custom exten => s,1,GotoIf($["${CALLERID(number)}" = "Unknown"]?check-blocked) <==== exten => s,n,GotoIf($["${CALLERID(number)}" = "Unavailable"]?check-blocked) <==== exten => s,n,GotoIf($["foo${CALLERID(number)}" = "foo"]?check-blocked:check) <==== exten => s,n(check-blocked),GotoIf($["${DB(blacklist/blocked)}" = "1"]?blacklisted) <==== exten => s,n(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] ==--;