Skip to content

PJSIP_HEADER_PARAM()

Synopsis

Get or set header/URI parameters on a PJSIP channel.

Description

PJSIP_HEADER_PARAM allows you to read or set parameters in a SIP header on a PJSIP channel.

Both URI parameters and header parameters can be read and set using this function. URI parameters appear in the URI (inside the <> in the header) while header parameters appear afterwards.

Note

If you call PJSIP_HEADER_PARAM 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_HEADER_PARAM in a pre-dial handler.

Example: Set URI parameter in From header on outbound channel
[handler]
exten => addheader,1,Set(PJSIP_HEADER_PARAM(From,uri,isup-oli)=27)
same => n,Return()
[somecontext]
exten => 1,1,Dial(PJSIP/${EXTEN},,b(handler^addheader^1))
Example: Read URI parameter in From header on inbound channel
same => n,Set(value=${PJSIP_HEADER_PARAM(From,uri,isup-oli)})

Syntax

PJSIP_HEADER_PARAM(header_name,parameter_type,parameter_name)
Arguments
  • header_name - Header in which parameter should be read or set.
    Currently, the only supported header is 'From'.

  • parameter_type - The type of parameter to get or set.
    Default is header parameter.

    • header - Header parameter.

    • uri - URI parameter.

  • parameter_name - Name of parameter.

Generated Version

This documentation was generated from Asterisk branch 22 using version GIT