Module: kamailio
Branch: master
Commit: 1fbca28c3a6e90ca478d152e116aca5e64780e9e
URL:
https://github.com/kamailio/kamailio/commit/1fbca28c3a6e90ca478d152e116aca5…
Author: Federico Cabiddu <fcabiddu(a)libon.com>
Committer: grumvalski <federico.cabiddu(a)gmail.com>
Date: 2016-11-30T18:23:46+01:00
sipcapture: perform ntohs on src and dst port when payload is not SIP
---
Modified: modules/sipcapture/sipcapture.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1fbca28c3a6e90ca478d152e116aca5…
Patch:
https://github.com/kamailio/kamailio/commit/1fbca28c3a6e90ca478d152e116aca5…
---
diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c
index 19ffbe6..84bc6ed 100644
--- a/modules/sipcapture/sipcapture.c
+++ b/modules/sipcapture/sipcapture.c
@@ -2372,11 +2372,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 */