[sr-dev] git:master:d692cfa4: siptrace: remove useless code from siptrace_send

Henning Westerholt henningw at users.noreply.github.com
Tue Apr 9 21:26:06 CEST 2019


Module: kamailio
Branch: master
Commit: d692cfa43b200e9dd10b29e2b42d4092d7caba7b
URL: https://github.com/kamailio/kamailio/commit/d692cfa43b200e9dd10b29e2b42d4092d7caba7b

Author: iionita <ionut-razvan.ionita at 1and1.ro>
Committer: Henning Westerholt <henningw at users.noreply.github.com>
Date: 2019-04-09T21:25:53+02:00

siptrace: remove useless code from siptrace_send

This piece of code was preventing usage of siptrace parameter uri
if dup_uri was not set.

---

Modified: src/modules/siptrace/siptrace_send.c

---

Diff:  https://github.com/kamailio/kamailio/commit/d692cfa43b200e9dd10b29e2b42d4092d7caba7b.diff
Patch: https://github.com/kamailio/kamailio/commit/d692cfa43b200e9dd10b29e2b42d4092d7caba7b.patch

---

diff --git a/src/modules/siptrace/siptrace_send.c b/src/modules/siptrace/siptrace_send.c
index 6e7718b933..c8b2051385 100644
--- a/src/modules/siptrace/siptrace_send.c
+++ b/src/modules/siptrace/siptrace_send.c
@@ -266,12 +266,16 @@ int trace_send_duplicate(char *buf, int len, struct dest_info *dst2)
 	if(buf == NULL || len <= 0)
 		return -1;
 
-	if(dup_uri_str.s == 0 || dup_uri == NULL)
+	/* either modparam dup_uri or siptrace param dst2 */
+	if((dup_uri_str.s == 0 || dup_uri == NULL) && (dst2 == NULL)) {
+		LM_INFO("XXX: here s where we've got problems!\n");
 		return 0;
+	}
 
 	init_dest_info(&dst);
 
 	if(!dst2) {
+		LM_INFO("XXX: using default dup uri!\n");
 		/* create a temporary proxy from dst param */
 		dst.proto = PROTO_UDP;
 		p = mk_proxy(&dup_uri->host,
@@ -290,15 +294,6 @@ int trace_send_duplicate(char *buf, int len, struct dest_info *dst2)
 					dst.to.s.sa_family, dst.proto);
 			goto error;
 		}
-	} else {
-		/* create a temporary proxy to dup uri */
-		dst.proto = PROTO_UDP;
-		p = mk_proxy(&dup_uri->host,
-				(dup_uri->port_no) ? dup_uri->port_no : SIP_PORT, dst.proto);
-		if(p == 0) {
-			LM_ERR("bad host name in uri\n");
-			return -1;
-		}
 	}
 
 	if(msg_send((dst2) ? dst2 : &dst, buf, len) < 0) {




More information about the sr-dev mailing list