[Asterisk-code-review] chan sip: Expose read-only access to the full SIP INVITE Req... (asterisk[master])

David J. Pryke asteriskteam at digium.com
Tue Sep 19 12:24:34 CDT 2017


David J. Pryke has uploaded this change for review. ( https://gerrit.asterisk.org/6543


Change subject: chan_sip: Expose read-only access to the full SIP INVITE Request-URI
......................................................................

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
---
M channels/sip/dialplan_functions.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/6543/1

diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c
index 59e841d..36d4ea9 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 @@
 		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")) {

-- 
To view, visit https://gerrit.asterisk.org/6543
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e
Gerrit-Change-Number: 6543
Gerrit-PatchSet: 1
Gerrit-Owner: David J. Pryke <david+extra.asterisk at pryke.us>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170919/0b8e6dbc/attachment.html>


More information about the asterisk-code-review mailing list