Browse code

registrar: added server_id to pv attributes

Charles Chance authored on 10/11/2017 13:52:01
Showing 2 changed files
... ...
@@ -1598,7 +1598,11 @@ event_route[usrloc:contact-expired] {
1598 1598
 				<listitem>
1599 1599
 				<para><emphasis>conid</emphasis> - TCP socket internal connection ID ($null if UDP)
1600 1600
 				</para>
1601
-				</listitem>	  
1601
+				</listitem>
1602
+				<listitem>
1603
+				<para><emphasis>server_id</emphasis> - server_id value
1604
+				</para>
1605
+				</listitem>
1602 1606
 			</itemizedlist>
1603 1607
 			<para>
1604 1608
 				The pseudo-variable accepts positive index value to access
... ...
@@ -273,6 +273,9 @@ int pv_get_ulc(struct sip_msg *msg,  pv_param_t *param,
273 273
 			if (c->sock && (c->sock->proto == PROTO_TCP || c->sock->proto == PROTO_TLS || c->sock->proto == PROTO_WS || c->sock->proto == PROTO_WSS))
274 274
 				return pv_get_sintval(msg, param, res, c->tcpconn_id);
275 275
 		break;
276
+		case 22: /* server_id */
277
+			return pv_get_uintval(msg, param, res, c->server_id);
278
+		break;
276 279
 	}
277 280
 
278 281
 	return pv_get_null(msg, param, res);
... ...
@@ -400,6 +403,10 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in)
400 403
 				rp->attr = 20;
401 404
 			else goto error;
402 405
 		break;
406
+		case 9:
407
+			if(strncmp(pa.s, "server_id", 9)==0)
408
+				rp->attr = 22;
409
+		break;
403 410
 		case 10:
404 411
 			if(strncmp(pa.s, "user_agent", 10)==0)
405 412
 				rp->attr = 12;