[sr-dev] git:master:fbe6d3bd: registrar: add path value to xavp_rcd

Victor Seva linuxmaniac at torreviejawireless.org
Thu Dec 5 19:44:12 CET 2019


Module: kamailio
Branch: master
Commit: fbe6d3bd02cfeddb40a60142971760363f1eee75
URL: https://github.com/kamailio/kamailio/commit/fbe6d3bd02cfeddb40a60142971760363f1eee75

Author: Andreas Granig <agranig at sipwise.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2019-12-05T19:44:04+01:00

registrar: add path value to xavp_rcd

---

Modified: src/modules/registrar/doc/registrar_admin.xml
Modified: src/modules/registrar/lookup.c

---

Diff:  https://github.com/kamailio/kamailio/commit/fbe6d3bd02cfeddb40a60142971760363f1eee75.diff
Patch: https://github.com/kamailio/kamailio/commit/fbe6d3bd02cfeddb40a60142971760363f1eee75.patch

---

diff --git a/src/modules/registrar/doc/registrar_admin.xml b/src/modules/registrar/doc/registrar_admin.xml
index 67e13e09e3..e8b1a75716 100644
--- a/src/modules/registrar/doc/registrar_admin.xml
+++ b/src/modules/registrar/doc/registrar_admin.xml
@@ -771,6 +771,11 @@ request_route {
 				<emphasis>received</emphasis> - the record's received value.
 			</para>
 		</listitem>
+		<listitem>
+			<para>
+				<emphasis>path</emphasis> - the record's path value.
+			</para>
+		</listitem>
 		</itemizedlist>
 		<para>
 			For example. if this parameter is set to 'ulrcd', then values are set in:
@@ -785,6 +790,9 @@ request_route {
 		<listitem>
 			<para><emphasis>$xavp(ulrcd[0]=>received)</emphasis></para>
 		</listitem>
+		<listitem>
+			<para><emphasis>$xavp(ulrcd[0]=>path)</emphasis></para>
+		</listitem>
 		</itemizedlist>
 		<para>
 		<emphasis>
diff --git a/src/modules/registrar/lookup.c b/src/modules/registrar/lookup.c
index 682eb7bace..eeffaf6e87 100644
--- a/src/modules/registrar/lookup.c
+++ b/src/modules/registrar/lookup.c
@@ -160,6 +160,7 @@ int xavp_rcd_helper(ucontact_t* ptr)
 	str xname_received = { "received", 8};
 	str xname_contact = { "contact", 7};
 	str xname_expires = {"expires", 7};
+	str xname_path = {"path", 4};
 	sr_xval_t xval;
 
 	if(ptr==NULL) return -1;
@@ -190,6 +191,13 @@ int xavp_rcd_helper(ucontact_t* ptr)
 	xval.v.i = (int) (ptr->expires - time(0));
 	xavp_add_value(&xname_expires, &xval, xavp);
 
+	if(ptr->path.len > 0) {
+		memset(&xval, 0, sizeof(sr_xval_t));
+		xval.type = SR_XTYPE_STR;
+		xval.v.s = ptr->path;
+		xavp_add_value(&xname_path, &xval, xavp);
+	}
+
 	if(list==NULL) {
 		/* no reg_xavp_rcd xavp in root list - add it */
 		xval.type = SR_XTYPE_XAVP;




More information about the sr-dev mailing list