Browse Source

registrar: added server_id to pv attributes

(cherry picked from commit 616a89f281bfe77c4d31719dc3d7bd27de5c6bac)
Charles Chance 7 years ago
parent
commit
620b326b35
2 changed files with 12 additions and 1 deletions
  1. 5 1
      src/modules/registrar/doc/registrar_admin.xml
  2. 7 0
      src/modules/registrar/regpv.c

+ 5 - 1
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

+ 7 - 0
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;