Browse code

siptrace: remove useless code from siptrace_send

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

iionita authored on 04/04/2019 15:28:16 • Henning Westerholt committed on 09/04/2019 19:25:53
Showing 1 changed files
... ...
@@ -266,12 +266,16 @@ int trace_send_duplicate(char *buf, int len, struct dest_info *dst2)
266 266
 	if(buf == NULL || len <= 0)
267 267
 		return -1;
268 268
 
269
-	if(dup_uri_str.s == 0 || dup_uri == NULL)
269
+	/* either modparam dup_uri or siptrace param dst2 */
270
+	if((dup_uri_str.s == 0 || dup_uri == NULL) && (dst2 == NULL)) {
271
+		LM_INFO("XXX: here s where we've got problems!\n");
270 272
 		return 0;
273
+	}
271 274
 
272 275
 	init_dest_info(&dst);
273 276
 
274 277
 	if(!dst2) {
278
+		LM_INFO("XXX: using default dup uri!\n");
275 279
 		/* create a temporary proxy from dst param */
276 280
 		dst.proto = PROTO_UDP;
277 281
 		p = mk_proxy(&dup_uri->host,
... ...
@@ -290,15 +294,6 @@ int trace_send_duplicate(char *buf, int len, struct dest_info *dst2)
290 294
 					dst.to.s.sa_family, dst.proto);
291 295
 			goto error;
292 296
 		}
293
-	} else {
294
-		/* create a temporary proxy to dup uri */
295
-		dst.proto = PROTO_UDP;
296
-		p = mk_proxy(&dup_uri->host,
297
-				(dup_uri->port_no) ? dup_uri->port_no : SIP_PORT, dst.proto);
298
-		if(p == 0) {
299
-			LM_ERR("bad host name in uri\n");
300
-			return -1;
301
-		}
302 297
 	}
303 298
 
304 299
 	if(msg_send((dst2) ? dst2 : &dst, buf, len) < 0) {