C.48. SIP_HEADER()

SIP_HEADER(headername[,number])
Retrieves the specified SIP header. You are not likely to need this unless you have a thorough understanding of the SIP protocol. Because some headers appear more than once in a SIP packet, you can specify which instance of the header you want to see with number.
; Query the TO header:
exten => 123,1,Set(DN=${SIP_HEADER(TO):5})
exten => 123,2,Set(DN=${CUT(DN,@,1)})

Note

Internal help for this application in Asterisk 1.4:
  -= Info about function 'SIP_HEADER' =- 

[Syntax]
SIP_HEADER(<name>[,<number>])

[Synopsis]
Gets the specified SIP header

[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.
diff output to internal help in Asterisk 1.2:
-- not available in Version 1.2 --