[sr-dev] git:master:616a89f2: registrar: added server_id to pv attributes

Charles Chance charles.chance at sipcentric.com
Sun Nov 12 12:02:01 CET 2017


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

Author: Charles Chance <charles.chance at sipcentric.com>
Committer: Charles Chance <charles.chance at sipcentric.com>
Date: 2017-11-10T13:52:01Z

registrar: added server_id to  pv attributes

---

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

---

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

---

diff --git a/src/modules/registrar/doc/registrar_admin.xml b/src/modules/registrar/doc/registrar_admin.xml
index 00b68018b8..6db4de5aed 100644
--- a/src/modules/registrar/doc/registrar_admin.xml
+++ b/src/modules/registrar/doc/registrar_admin.xml
@@ -1598,7 +1598,11 @@ event_route[usrloc:contact-expired] {
 				<listitem>
 				<para><emphasis>conid</emphasis> - TCP socket internal connection ID ($null if UDP)
 				</para>
-				</listitem>	  
+				</listitem>
+				<listitem>
+				<para><emphasis>server_id</emphasis> - server_id value
+				</para>
+				</listitem>
 			</itemizedlist>
 			<para>
 				The pseudo-variable accepts positive index value to access
diff --git a/src/modules/registrar/regpv.c b/src/modules/registrar/regpv.c
index e90625cdc4..b6fad8856f 100644
--- a/src/modules/registrar/regpv.c
+++ b/src/modules/registrar/regpv.c
@@ -273,6 +273,9 @@ int pv_get_ulc(struct sip_msg *msg,  pv_param_t *param,
 			if (c->sock && (c->sock->proto == PROTO_TCP || c->sock->proto == PROTO_TLS || c->sock->proto == PROTO_WS || c->sock->proto == PROTO_WSS))
 				return pv_get_sintval(msg, param, res, c->tcpconn_id);
 		break;
+		case 22: /* server_id */
+			return pv_get_uintval(msg, param, res, c->server_id);
+		break;
 	}
 
 	return pv_get_null(msg, param, res);
@@ -400,6 +403,10 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in)
 				rp->attr = 20;
 			else goto error;
 		break;
+		case 9:
+			if(strncmp(pa.s, "server_id", 9)==0)
+				rp->attr = 22;
+		break;
 		case 10:
 			if(strncmp(pa.s, "user_agent", 10)==0)
 				rp->attr = 12;




More information about the sr-dev mailing list