Module: kamailio Branch: 5.3 Commit: 0f733090f69f88a153040e0051057bfd3a9a8404 URL: https://github.com/kamailio/kamailio/commit/0f733090f69f88a153040e0051057bfd...
Author: Henning Westerholt hw@skalatan.de Committer: Henning Westerholt hw@skalatan.de Date: 2020-06-05T10:29:48Z
siptrace: fix regression introduced from 4e9a760123c for siptrace(), sip_trace_mode()
- fix regression introduced from 4e9a760123c for siptrace(), sip_trace_mode() - it was not working properly without destination uri in non-HEP mode
(cherry picked from commit 21338195e74b09ccca29d6479e698417ed34cd42)
---
Modified: src/modules/siptrace/siptrace.c
---
Diff: https://github.com/kamailio/kamailio/commit/0f733090f69f88a153040e0051057bfd... Patch: https://github.com/kamailio/kamailio/commit/0f733090f69f88a153040e0051057bfd...
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c index e49946e525..161986d2cf 100644 --- a/src/modules/siptrace/siptrace.c +++ b/src/modules/siptrace/siptrace.c @@ -534,7 +534,8 @@ static int sip_trace_store(siptrace_data_t *sto, dest_info_t *dst, trace_send_hep_duplicate( &sto->body, &sto->fromip, &sto->toip, dst, correlation_id_str); } else { - if(dst) { + /* sip_trace_mode() will not set a destination, uses duplicate_uri */ + if(dst || trace_to_database == 0) { trace_send_duplicate(sto->body.s, sto->body.len, dst); } } @@ -996,10 +997,13 @@ static int w_sip_trace3(sip_msg_t *msg, char *dest, char *correlation_id, char * dest_info_t dest_info; enum siptrace_type_t trace_type;
- if (dest) { - if(fixup_get_svalue(msg, (gparam_t *)dest, &dup_uri_param_str) != 0) { - LM_ERR("unable to parse the dest URI string\n"); - return -1; + /* to support tracing to database without destination parameter - old mode */ + if (dest || trace_to_database == 0) { + if (dest) { + if(fixup_get_svalue(msg, (gparam_t *)dest, &dup_uri_param_str) != 0) { + LM_ERR("unable to parse the dest URI string\n"); + return -1; + } }
if (dup_uri_param_str.s == 0 || (is_null_pv(dup_uri_param_str))) {