Module: kamailio
Branch: master
Commit: c840fa6eb19b4b5d316e36ce534f4d481805ee0b
URL:
https://github.com/kamailio/kamailio/commit/c840fa6eb19b4b5d316e36ce534f4d4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-05-02T15:02:55+02:00
siptrace: skip non-sip traffic for db storage using core callbacks
---
Modified: src/modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c840fa6eb19b4b5d316e36ce534f4d4…
Patch:
https://github.com/kamailio/kamailio/commit/c840fa6eb19b4b5d316e36ce534f4d4…
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 5b4c064bec..6cc3471fcf 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -2077,6 +2077,24 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
goto afterdb;
}
+ if(tmsg.first_line.type==SIP_REQUEST) {
+ if(!IS_SIP(&tmsg)) {
+ LM_DBG("non sip request message\n");
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+ } else if(tmsg.first_line.type==SIP_REPLY) {
+ if(!IS_SIP_REPLY(&tmsg)) {
+ LM_DBG("non sip reply message\n");
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+ } else {
+ LM_DBG("unknown sip message type %d\n", tmsg.first_line.type);
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+
if(sip_trace_msg_attrs(&tmsg, &sto) < 0) {
free_sip_msg(&tmsg);
goto afterdb;
@@ -2179,6 +2197,24 @@ int siptrace_net_data_send(sr_event_param_t *evp)
goto afterdb;
}
+ if(tmsg.first_line.type==SIP_REQUEST) {
+ if(!IS_SIP(&tmsg)) {
+ LM_DBG("non sip request message\n");
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+ } else if(tmsg.first_line.type==SIP_REPLY) {
+ if(!IS_SIP_REPLY(&tmsg)) {
+ LM_DBG("non sip reply message\n");
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+ } else {
+ LM_DBG("unknown sip message type %d\n", tmsg.first_line.type);
+ free_sip_msg(&tmsg);
+ goto afterdb;
+ }
+
if(sip_trace_msg_attrs(&tmsg, &sto) < 0) {
free_sip_msg(&tmsg);
goto afterdb;