Module: sip-router
Branch: master
Commit: deb2a87687f2ca04e7110e70d049bf8f47328bda
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=deb2a87…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Jan 20 11:26:00 2012 +0100
msrp: added $msrp(conid) - returns the internal id of TCP connection
---
modules/msrp/msrp_vars.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/modules/msrp/msrp_vars.c b/modules/msrp/msrp_vars.c
index 93e57e7..0debdc6 100644
--- a/modules/msrp/msrp_vars.c
+++ b/modules/msrp/msrp_vars.c
@@ -62,6 +62,8 @@ int pv_parse_msrp_name(pv_spec_t *sp, str *in)
case 5:
if(strncmp(in->s, "msgid", 5)==0)
sp->pvp.pvn.u.isname.name.n = 5;
+ else if(strncmp(in->s, "conid", 5)==0)
+ sp->pvp.pvn.u.isname.name.n = 21;
else goto error;
case 6:
if(strncmp(in->s, "method", 6)==0)
@@ -103,7 +105,7 @@ int pv_parse_msrp_name(pv_spec_t *sp, str *in)
else goto error;
break;
default:
- /* max is 20 */
+ /* max is 21 */
goto error;
}
sp->pvp.pvn.type = PV_NAME_INTSTR;
@@ -286,6 +288,10 @@ int pv_get_msrp(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
case 20:
return pv_get_strval(msg, param, res,
&mf->tcpinfo->rcv->bind_address->sock_str);
+ case 21:
+ if(mf->tcpinfo->con==NULL)
+ return pv_get_null(msg, param, res);
+ return pv_get_sintval(msg, param, res, mf->tcpinfo->con->id);
default:
return pv_get_null(msg, param, res);
}