<div dir="ltr">Hi,<div><br></div><div>I'm having some problems when using topology hiding. In my scenario an INVITE comes in to the opensips (SBC) instance from another opensips instance (Proxy). It is routed to a callee which eventually answers with a 200OK. The 200 OK is routed through the SBC to the Proxy which answers back with an ACK. This ACK is absorbed by the SBC which (by looking at the logs) attempts to send this ACK to the private IP of the callee instead of the the NAT IP which was originally used for the incoming INVITE.</div><div><br></div><div>From the logs I see that right before I attempt to do 'topology_hiding_match()' the 'ruri=public_IP' and after the method is called the ruri switches to 'ruri=private_IP'.</div><div><br></div><div>Attached is a trace, the problematic ACK is message number 53. Below is a partial opensips.cfg file I am using with opensips 2.1:</div><div><br></div><div><br></div><div><div><font color="#666666"># ----- NATHELPER -----</font></div><div><font color="#666666">loadmodule "nathelper.so"</font></div><div><font color="#666666">modparam("nathelper", "received_avp", "$avp(42)")</font></div><div><font color="#666666"><br></font></div><div><font color="#666666"># ----- DIALOG -----</font></div><div><font color="#666666">loadmodule "dialog.so"</font></div><div><font color="#666666">modparam("dialog", "db_mode", 0)</font></div><div><font color="#666666">modparam("dialog", "dlg_match_mode", 1)</font></div><div><font color="#666666">modparam("dialog", "profiles_no_value", "inboundcalls")</font></div><div><font color="#666666"><br></font></div><div><font color="#666666"><br></font></div><div><font color="#666666"># ----- TOPOLOGY_HIDING -----</font></div><div><font color="#666666">loadmodule "topology_hiding.so"</font></div><div><font color="#666666">modparam("topology_hiding", "force_dialog", 1)</font></div><div><font color="#666666">modparam("topology_hiding", "th_callid_passwd", "*********")</font></div><div><font color="#666666">modparam("topology_hiding", "th_contact_encode_passwd", "*****")</font></div><div><font color="#666666">modparam("topology_hiding", "th_callid_prefix", "****")</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">route {</font></div><div><font color="#666666">  route(nat_checks);</font></div><div><font color="#666666">  route(topology_check);</font></div><div><font color="#666666">  .</font></div><div><font color="#666666">  .</font></div><div><font color="#666666">  .</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  create_dialog();</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  record_route();</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  if (!has_totag() && is_method("INVITE")) {</font></div><div><font color="#666666">    topology_hiding("U");</font></div><div><font color="#666666">  }</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  .</font></div><div><font color="#666666">  .</font></div><div><font color="#666666">  .</font></div><div><font color="#666666">}</font></div><div><font color="#666666"><br></font></div><div><font color="#666666"><br></font></div><div><font color="#666666">route[topology_check] {</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  force_rport();</font></div><div><font color="#666666">  xlog("L_INFO", "[REQUEST $ci] current  ruri: $ruri");</font></div><div><font color="#666666">  if (has_totag()) {</font></div><div><font color="#666666">    if (topology_hiding_match()) {</font></div><div><font color="#666666">        xlog("L_INFO", "[REQUEST $ci] $rm topology_check successful match reinvite TH_callee_callid: $TH_callee_callid ruri: $ruri");</font></div><div><font color="#666666">        route(relay);</font></div><div><font color="#666666">    } else {</font></div><div><font color="#666666">      xlog("L_INFO", "[REQUEST $ci] $rm topology_check Did not match this request to a topology hiding dialog.");</font></div><div><font color="#666666">      if ( is_method("ACK") ) {</font></div><div><font color="#666666">        if ( t_check_trans() ) {</font></div><div><font color="#666666">          xlog("L_INFO", "[REQUEST $ci] $rm within a transaction relaying");</font></div><div><font color="#666666">          route(relay);</font></div><div><font color="#666666">        } else {</font></div><div><font color="#666666">          xlog("L_INFO", "[REQUEST $ci] $rm not within a transaction exiting");</font></div><div><font color="#666666">          exit;</font></div><div><font color="#666666">        }</font></div><div><font color="#666666">      }</font></div><div><font color="#666666">      xlog("L_INFO", "[REQUEST $ci] $rm sending 404 Not Found");</font></div><div><font color="#666666">      send_reply("404","Not Found");</font></div><div><font color="#666666">      exit;</font></div><div><font color="#666666">    }</font></div><div><font color="#666666">  }</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">}</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">route[nat_checks] {</font></div><div><font color="#666666"><br></font></div><div><font color="#666666">  if (nat_uac_test("1")) {</font></div><div><font color="#666666">    xlog("L_INFO", "[REQUEST $ci] $rm fix_nated_contact()");</font></div><div><font color="#666666">    fix_nated_contact();</font></div><div><font color="#666666">  }</font></div><div><font color="#666666">}</font></div><div><font color="#666666">.</font></div><div><font color="#666666">.</font></div><div><font color="#666666">.</font></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>