Skip to content

Commit

Permalink
registrar: added server_id to pv attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrchance committed Nov 10, 2017
1 parent 2a80ed8 commit 616a89f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/registrar/doc/registrar_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/modules/registrar/regpv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 616a89f

Please sign in to comment.