Skip to content

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'.

This function does not access headers from the REFER message if the call was transferred. To obtain the REFER headers, set the dialplan variable GET_TRANSFERRER_DATA to the prefix of the headers of the REFER message that you need to access; for example, 'X-' to get all headers starting with 'X-'. The variable must be set before a call to the application that starts the channel that may eventually transfer back into the dialplan, and must be inherited by that channel, so prefix it with the '_' or '__' when setting (or set it in the pre-dial handler executed on the new channel). To get all headers of the REFER message, set the value to ''. Headers are returned in the form of a dialplan hash TRANSFER_DATA, and can be accessed with the functions *HASHKEYS(TRANSFER_DATA)** and, e. g., HASH(TRANSFER_DATA,X-That-Special-Header).

Please also note that contents of the SDP (an attachment to the SIP request) can't be accessed with this function.

Syntax

SIP_HEADER(name,number)
Arguments
  • name

  • number - If not specified, defaults to '1'.

See Also

Generated Version

This documentation was generated from Asterisk branch 18 using version GIT