AGI:解析 SIP Header

    內容表格
    沒有標頭

    解析 SIP Header 的 Diversion 欄位內容

    Dialplan:

    [my-sip-header-filter]
    exten => s,1,NoOp( Incoming calls from internet )
    exten => s,n,NoOp(SIP_HEADER From field: ${SIP_HEADER(From,1)})
    exten => s,n,NoOp(SIP_HEADER To field: ${SIP_HEADER(To,1)})
    ; for debug only
    exten => s,n,GotoIf($[${LEN(${SIP_HEADER(Diversion,1)})} > 0]?next:next)
    ;exten => s,n,GotoIf($[${LEN(${SIP_HEADER(Diversion,1)})} > 0]?next)
    exten => s,n,NoOp(SIP_HEADER Diversion field: <Data Not Found>)
    exten => s,n,Hangup
    exten => s,n(next),NoOp(SIP_HEADER Diversion field: ${SIP_HEADER(Diversion,1)})
    exten => s,n,Set(STR=${SIP_HEADER(Diversion,1)})
    exten => s,n,NoOp(STR: ${STR})
    exten => s,n,AGI(get_diverter.php,${STR})
    exten => s,n,NoOp(Diverter: ${DIVERTER})
    exten => s,n,Hangup
    

    get_diverter.php:

    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core