Blacklist-黑名單(FreePBX模組)

    內容表格
    1. 1. Dialplan 流程說明

    版本為 14:56, 20 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    Blacklist - 黑名單功能,這是 FreePBX 的功能模組之一,這可以用來阻擋特定的來電號碼(CID),以及啟用此功能後,預設也會將未顯示(unknown)的來電也做阻擋。

    使用重點:

    • 此功能的原始設計只會對來電號碼(CID)做檢查。
    • Blacklist 預設會有一筆紀錄 Number: blocked, Description: 1,這不可刪除,這是用來阻擋 CID 顯示 unknow/unavailable/空白 時。

    Dialplan 流程說明

    1. from-trunk ->
    2. from-pstn ->
    3. ext-did ->
    4. ext-did-0002 ->
    5. app-blacklist-check ->

     

    ext-did-0002:

    TIPs:

    必須先新增 Inbound Route,才會有此 context。

    [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:

    TIPs:

    必須安裝 Blacklist 模組,而且有新增至少一個電話號碼,才會有如下的內容,否則內容會是預設。

    [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] ==--;
    
    Powered by MindTouch Core