Reputation: 63
Hello Craftsmen Asterisk, I have a problem I can not extract in the variable from SipHeader. I followed with dump I'm getting:
Diversion: <sip:[email protected]>;reason=unconditional
Diversion: "Anonymous"sip<:[email protected]>;reason=unknow;privacy=full;counter=1
I set in dialplan:
same => n,Set(diversion=${SIP_HEADER(Diversion))
recived:
sip:[email protected]>;reason=unconditional
but I also need the second row!
Diversion: "Anonymous"sip<:[email protected]>;reason=unknow;privacy=full;counter=1
Can someone help me?
Upvotes: 0
Views: 2211
Reputation: 15259
Maybe you should read help and use second param?
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
Upvotes: 2