Module: kamailio
Branch: master
Commit: 4f960122142c845862ad140e85827a1c530bc22e
URL:
https://github.com/kamailio/kamailio/commit/4f960122142c845862ad140e85827a1…
Author: David Villasmil <david.villasmil.work(a)gmail.com>
Committer: David Villasmil <david.villasmil.work(a)gmail.com>
Date: 2017-02-15T16:42:03Z
sipcapture: added $hep(dst_ip) variable
- expose hep(dst_ip) to get hep's message destination IP
---
Modified: src/modules/sipcapture/sipcapture.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4f960122142c845862ad140e85827a1…
Patch:
https://github.com/kamailio/kamailio/commit/4f960122142c845862ad140e85827a1…
---
diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index efc53d1..5d5227c 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -2773,6 +2773,7 @@ static int pv_parse_hep_name (pv_spec_p sp, str *in)
case 6:
{
if(!strncmp(in->s, "src_ip", 6)) sp->pvp.pvn.u.isname.name.n = 2;
+ else if(!strncmp(in->s, "dst_ip", 6)) sp->pvp.pvn.u.isname.name.n =
3;
else goto error;
}
case 7:
@@ -2813,6 +2814,10 @@ static int pv_get_hep(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
sizeof(sc_buf_ip)-1);
sc_buf_ip[sc_buf_ip_len]=0;
return pv_get_strlval(msg, param, res, sc_buf_ip, sc_buf_ip_len);
+ case 3:
+ sc_buf_ip_len=ip_addr2sbuf(&msg->rcv.dst_ip, sc_buf_ip, sizeof(sc_buf_ip)-1);
+ sc_buf_ip[sc_buf_ip_len]=0;
+ return pv_get_strlval(msg, param, res, sc_buf_ip, sc_buf_ip_len);
default:
return hepv3_get_chunk(msg, msg->buf, msg->len,
param->pvn.u.isname.name.n, param, res);
}