Asterisk SipHeader Diversion

时间:2018-05-03 15:05:10

标签: asterisk sip dialplan

Hello Craftsmen Asterisk, 我有一个问题,我无法从SipHeader中提取变量。 我跟着转储我得到了:

  

Diversion: <sip:+4917645615686@public-vip.cisco.de>;reason=unconditional

     

Diversion: "Anonymous"sip<:Anonymous@47.23.21.9>;reason=unknow;privacy=full;counter=1

我在拨号方案中设置:

  

same => n,Set(diversion=${SIP_HEADER(Diversion))

recived:

  

SIP:+4917645615686@public-vip.cisco.de> ;;原因=无条件

但我还需要第二行!

  

Diversion: "Anonymous"sip<:Anonymous@47.23.21.9>;reason=unknow;privacy=full;counter=1

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

也许你应该阅读帮助并使用第二个参数?

pro-sip*CLI> core show function SIP_HEADER 

  -= Info about function 'SIP_HEADER' =- 

[Synopsis]
Gets the specified SIP header from an incoming INVITE message. 

[Description]
Since there are several headers (such as Via) which can occur multiple times,
SIP_HEADER takes an optional second argument to specify which header with that
name to retrieve. Headers start at offset '1'.
Please observe that contents of the SDP (an attachment to the SIP request)
can't be accessed with this function.

[Syntax]
SIP_HEADER(name[,number])

[Arguments]
number
    If not specified, defaults to '1'.

[See Also]
Not available