diff options
author | David J. Pryke <david+extra.asterisk@pryke.us> | 2017-09-19 10:34:01 -0400 |
---|---|---|
committer | David J. Pryke <david+extra.asterisk@pryke.us> | 2017-09-19 12:24:33 -0500 |
commit | a5f1d58fe1a5fe14061afc879872ed033e089880 (patch) | |
tree | d33cee5a6fb702df35cb3b976f3a19a7e75720e6 /channels/sip | |
parent | 1199927fc09a57b90dd2426ae209666b3a838811 (diff) |
chan_sip: Expose read-only access to the full SIP INVITE Request-URI
Provide a way to get the contents of the the Request URI from the initial SIP
INVITE in dial plan function call. (In this case "${CHANNEL(ruri)}")
ASTERISK-27278
Reported by: David J. Pryke
Tested by: David J. Pryke
Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e
Diffstat (limited to 'channels/sip')
-rw-r--r-- | channels/sip/dialplan_functions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c index 59e841df4..36d4ea9e4 100644 --- a/channels/sip/dialplan_functions.c +++ b/channels/sip/dialplan_functions.c @@ -41,6 +41,9 @@ <enum name="uri"> <para>R/O Get the URI from the Contact: header.</para> </enum> + <enum name="ruri"> + <para>R/O Get the Request-URI from the INVITE header.</para> + </enum> <enum name="useragent"> <para>R/O Get the useragent.</para> </enum> @@ -162,6 +165,9 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p ast_copy_string(buf, p->from, buflen); } else if (!strcasecmp(args.param, "uri")) { ast_copy_string(buf, p->uri, buflen); + } else if (!strcasecmp(args.param, "ruri")) { + char *tmpruri = REQ_OFFSET_TO_STR(&p->initreq, rlpart2); + ast_copy_string(buf, tmpruri, buflen); } else if (!strcasecmp(args.param, "useragent")) { ast_copy_string(buf, p->useragent, buflen); } else if (!strcasecmp(args.param, "peername")) { |