Module: kamailio
Branch: master
Commit: 6704c5117fa949ee610173ea5ac39a309c4dfe19
URL:
https://github.com/kamailio/kamailio/commit/6704c5117fa949ee610173ea5ac39a3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-04-06T20:45:06+02:00
siptrace: check trace_on value for core recv/send callbacks
- value was not tested, not considering the enable/disable control via rpc
---
Modified: src/modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6704c5117fa949ee610173ea5ac39a3…
Patch:
https://github.com/kamailio/kamailio/commit/6704c5117fa949ee610173ea5ac39a3…
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index f95df0e069..5238adbc4a 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -2014,6 +2014,10 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
if(evp->data == 0)
return -1;
+ if(trace_on_flag != NULL && *trace_on_flag==0) {
+ return 0;
+ }
+
nd = (sr_net_info_t *)evp->data;
if(nd->rcv == NULL || nd->data.s == NULL || nd->data.len <= 0)
return -1;
@@ -2063,6 +2067,10 @@ int siptrace_net_data_send(sr_event_param_t *evp)
if(evp->data == 0)
return -1;
+ if(trace_on_flag != NULL && *trace_on_flag==0) {
+ return 0;
+ }
+
nd = (sr_net_info_t *)evp->data;
if(nd->dst == NULL || nd->data.s == NULL || nd->data.len <= 0)
return -1;