Module: kamailio
Branch: master
Commit: 459ccabe9e3975dd5a90135ab96f3cccdf4ffdbe
URL:
https://github.com/kamailio/kamailio/commit/459ccabe9e3975dd5a90135ab96f3cc…
Author: Bastian Triller <bastian.triller(a)gmail.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-02-21T17:18:21+01:00
sipcapture: fix inaccessible HEP chunks
Chunk types 1 , 2 and 3 were not accessible.
$hep(...) pseudovariable didn't return HEP chunks of type:
* 1 (IP protocol family) returned HEP version
(accessible via $hep(version))
* 2 (IP protocol ID) returned HEP message source IP
* 3 (IPv4 source address) returned HEP message destination IP
This removes keys src_ip and dst_ip. Use $si resp. $Ri instead.
---
Modified: src/modules/sipcapture/sipcapture.c
---
Diff:
https://github.com/kamailio/kamailio/commit/459ccabe9e3975dd5a90135ab96f3cc…
Patch:
https://github.com/kamailio/kamailio/commit/459ccabe9e3975dd5a90135ab96f3cc…
---
diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index 10e9d90e4d..5da37cbde7 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -3043,14 +3043,6 @@ static int pv_parse_hep_name(pv_spec_p sp, str *in)
else
goto error;
} break;
- 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;
- } break;
case 7: {
if(!strncmp(in->s, "version", 7))
sp->pvp.pvn.u.isname.name.n = 0;
@@ -3073,27 +3065,12 @@ static int pv_parse_hep_name(pv_spec_p sp, str *in)
static int pv_get_hep(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
{
- static char sc_buf_ip[IP_ADDR_MAX_STR_SIZE + 12];
- int sc_buf_ip_len;
-
if(param == NULL)
return -1;
switch(param->pvn.u.isname.name.n) {
case 0:
return pv_get_uintval(msg, param, res, hep_version(msg));
- case 1:
- return pv_get_uintval(msg, param, res, hep_version(msg));
- case 2:
- sc_buf_ip_len = ip_addr2sbuf(
- &msg->rcv.src_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);
- 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);