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:
exten => 1,1,Set(somevar=${PJSIP_RESPONSE_HEADER(read,From)})
exten => 1,1,Set(via2=${PJSIP_RESPONSE_HEADER(read,Via,2)})
exten => 1,1,Set(xhdr=${PJSIP_RESPONSE_HEADER(read,X-*,1)})
Note
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.
[handler]
exten => readheader,1,NoOp(PJSIP_RESPONSE_HEADER(read,X-MyHeader))
[somecontext]
exten => 1,1,Dial(PJSIP/${EXTEN},,U(handler^readheader^1))
Syntax¶
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¶
Generated Version¶
This documentation was generated from Asterisk branch 18 using version GIT