PJSIP_HEADER_PARAM(header_name,parameter_type,parameter_name)
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.
``` title="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))
``` title="Read URI parameter in From header on inbound channel"
same => n,Set(value=${PJSIP_HEADER_PARAM(From,uri,isup-oli)})
header_namerequired - Header in which parameter should be read or set.parameter_typerequired - The type of parameter to get or set.header- Header parameter.uri- URI parameter.
parameter_namerequired - Name of parameter.
User Notes
No notes yet. Be the first to contribute a tip or example.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.