From 722af98e2692aac35c9e8f96b56b2309618ae55a Mon Sep 17 00:00:00 2001 From: Luis Azedo Date: Thu, 6 May 2021 14:48:10 +0100 Subject: [PATCH] relocating some parts * ensure REMOVE_RESERVED_HEADERS is called for internal replies * NAT_MANAGE is relocated to ensure its called with failures --- kamailio/default.cfg | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 6d31094..7c2ba8e 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -434,6 +434,7 @@ route[HANDLE_IN_DIALOG_REQUESTS] #!ifdef NAT_TRAVERSAL_ROLE if (handle_ruri_alias() != 1 && is_method("ACK") ) { # ACK is forwarded statelessly + xlog("L_INFO", "$ci|default|forward ack statelessly\n"); route(NAT_MANAGE); } #!endif @@ -485,6 +486,7 @@ route[HANDLE_IN_DIALOG_REQUESTS] #!ifdef NAT_TRAVERSAL_ROLE if(!isdsturiset()) { if (handle_ruri_alias() == 1) { + xlog("L_INFO", "$ci|default|message had a to-tag but can't be loose routed, routing with alias\n"); t_relay(); exit; }; @@ -717,6 +719,10 @@ onreply_route[INTERNAL_REPLY] xlog("L_INFO", "$ci|default|internal reply $T_reply_code $T_reply_reason\n"); } + #!ifdef NAT_TRAVERSAL_ROLE + route(NAT_MANAGE); + #!endif + routes("INTERNAL_REPLY_"); if($rs == 100) { @@ -729,10 +735,6 @@ onreply_route[INTERNAL_REPLY] } } - #!ifdef NAT_TRAVERSAL_ROLE - route(NAT_MANAGE); - #!endif - #!ifdef ACL_ROLE setflag(FLAG_IS_REPLY); route(ACL_CHECK); @@ -748,6 +750,8 @@ onreply_route[INTERNAL_REPLY] setflag(FLAG_SESSION_PROGRESS); } + route(REMOVE_RESERVED_HEADERS); + } failure_route[INTERNAL_FAULT] @@ -755,6 +759,10 @@ failure_route[INTERNAL_FAULT] # this branch handles failures (>=300) to our media servers, # which we can sometimes overcome by routing to another server + #!ifdef NAT_TRAVERSAL_ROLE + route(NAT_MANAGE); + #!endif + routes("INTERNAL_FAULT_"); # if the failure cause was due to the transaction being