Browse code

topoh: remove the Via cookie when skipping topoh via event route

- event route is now executed with parsed sip message to be sent out
- GH #2437

(cherry picked from commit 06a1d20fdcae42c8f2130c547c6c6cf5fb6dce26)
(cherry picked from commit b5176749605808af737aca00992f549152f9c38a)

Daniel-Constantin Mierla authored on 24/08/2020 08:22:52
Showing 1 changed files
... ...
@@ -421,10 +421,6 @@ int th_msg_sent(sr_event_param_t *evp)
421 421
 
422 422
 	obuf = (str*)evp->data;
423 423
 
424
-	if(th_execute_event_route(NULL, evp)==1) {
425
-		return 0;
426
-	}
427
-
428 424
 	memset(&msg, 0, sizeof(sip_msg_t));
429 425
 	msg.buf = obuf->s;
430 426
 	msg.len = obuf->len;
... ...
@@ -442,6 +438,11 @@ int th_msg_sent(sr_event_param_t *evp)
442 438
 	if(th_cookie_value.s[0]!='x') {
443 439
 		th_del_cookie(&msg);
444 440
 	}
441
+
442
+	if(th_execute_event_route(&msg, evp)==1) {
443
+		goto done;
444
+	}
445
+
445 446
 	if(msg.first_line.type==SIP_REQUEST) {
446 447
 		direction = (th_cookie_value.s[0]=='u')?1:0; /* upstream/downstram */
447 448
 		dialog = (get_to(&msg)->tag_value.len>0)?1:0;