Module: kamailio Branch: 4.4 Commit: 6291792ecaee0bfb1855bf6ba4560e4d6af09f3e URL: https://github.com/kamailio/kamailio/commit/6291792ecaee0bfb1855bf6ba4560e4d...
Author: Federico Cabiddu fcabiddu@libon.com Committer: grumvalski federico.cabiddu@gmail.com Date: 2016-12-01T14:04:45+01:00
sipcapture: perform ntohs on src and dst port when payload is not SIP
(cherry picked from commit 1fbca28c3a6e90ca478d152e116aca5e64780e9e)
---
Modified: modules/sipcapture/sipcapture.c
---
Diff: https://github.com/kamailio/kamailio/commit/6291792ecaee0bfb1855bf6ba4560e4d... Patch: https://github.com/kamailio/kamailio/commit/6291792ecaee0bfb1855bf6ba4560e4d...
---
diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index 57f1c05..7b2f4b7 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -2285,11 +2285,11 @@ int receive_logging_json_msg(char * buf, unsigned int len, struct hep_generic_re /*source ip*/ sco.source_ip.s = ipstr_src; sco.source_ip.len = strlen(ipstr_src); - sco.source_port = hg->src_port->data; + sco.source_port = ntohs(hg->src_port->data);
sco.destination_ip.s = ipstr_dst; sco.destination_ip.len = strlen(ipstr_dst); - sco.destination_port = hg->dst_port->data; + sco.destination_port = ntohs(hg->dst_port->data);
if(heptime && heptime->tv_sec != 0) { sco.tmstamp = (unsigned long long)heptime->tv_sec*1000000+heptime->tv_usec; /* micro ts */