Module: kamailio
Branch: 5.0
Commit: 620b326b35e3b836e816422dbf0a236185040db3
URL:
https://github.com/kamailio/kamailio/commit/620b326b35e3b836e816422dbf0a236…
Author: Charles Chance <charles.chance(a)sipcentric.com>
Committer: Charles Chance <charles.chance(a)sipcentric.com>
Date: 2017-12-14T09:41:19Z
registrar: added server_id to pv attributes
(cherry picked from commit 616a89f281bfe77c4d31719dc3d7bd27de5c6bac)
---
Modified: src/modules/registrar/doc/registrar_admin.xml
Modified: src/modules/registrar/regpv.c
---
Diff:
https://github.com/kamailio/kamailio/commit/620b326b35e3b836e816422dbf0a236…
Patch:
https://github.com/kamailio/kamailio/commit/620b326b35e3b836e816422dbf0a236…
---
diff --git a/src/modules/registrar/doc/registrar_admin.xml
b/src/modules/registrar/doc/registrar_admin.xml
index 98a21dccea..709f8a9484 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 8e9146b1ce..7edfd87275 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;