Skip to end of metadata
Go to start of metadata

PJSIP_RESPONSE_HEADER()

Synopsis

Gets headers of 200 response from an outbound PJSIP channel.

Description

PJSIP_RESPONSE_HEADER allows you to read specific SIP headers of 200 response from the outbound PJSIP channel.

Examples:

Example: Set 'somevar' to the value of the 'From' header
Example: Set 'via2' to the value of the 2nd 'Via' header
Example: Set 'xhdr' to the value of the 1sx X-header

Note

Icon

If you call PJSIP_RESPONSE_HEADER in a normal dialplan context you'll be operating on the caller's (incoming) channel which may not be what you want. To operate on the callee's (outgoing) channel call PJSIP_RESPONSE_HEADER in a pre-connect handler.

Example: Usage on pre-connect handler

Syntax

PJSIP_RESPONSE_HEADER(action,name[,number])
Arguments
  • action
    • read - Returns instance number of response header name.
  • name - The name of the response header. A {} can be appended to the name to iterate over all response headers *beginning with name.
  • number - If there's more than 1 header with the same name, this specifies which header to read. If not specified, defaults to 1 meaning the first matching header.

See Also

Import Version

This documentation was imported from Asterisk Version GIT-19-a692e79

  • No labels