解析 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:
Images 0 | ||
---|---|---|
No images to display in the gallery. |