]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Expose read-only access to the full SIP INVITE Request-URI
authorDavid J. Pryke <david+extra.asterisk@pryke.us>
Tue, 19 Sep 2017 14:34:01 +0000 (10:34 -0400)
committerDavid J. Pryke <david+extra.asterisk@pryke.us>
Tue, 19 Sep 2017 17:23:24 +0000 (12:23 -0500)
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

channels/sip/dialplan_functions.c

index e74e57ecf376599d1ef96d1a2ce10e051c9e2c1a..b9004c8d6b599549fc2c18ee7c9784717f3da4be 100644 (file)
@@ -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>
@@ -164,6 +167,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")) {