0

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:+4917645615686@public-vip.cisco.de>;reason=unconditional

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

I set in dialplan:

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

recived:

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

but I also need the second row!

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

Can someone help me?

Community
  • 1
  • 1
Andrei
  • 63
  • 10

1 Answers1

2

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
arheops
  • 15,544
  • 1
  • 21
  • 27