<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>topos does not add any Record-Route, that's the idea, to have the
      INVITE look like being initiated by Kamailio. Replies come back
      based on Via and requests within dialog based on Contact.</p>
    <p>The Record-Route has nothing to do with replies routing anyhow.
      It is all about Via.</p>
    <p>Is Kamailio behind nat/firewall?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 08.09.21 21:41, Angelo Sipper wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALWKM23moRhjuDHnGYMnrjOD6P=4YxD1mGr07STw6tivQN-B8Q@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>We have the following setup on Kamailio 5.3.7
          (x86_64/linux) and I am trying to use topos module on
          Kamailio2 in order to hide our topology but, mostly to reduce
          the invite size as most of the times we have fragmentation on
          invites from Kamailio1 as Kamailio1 it adds 2 record-routes
          and two via as it handles TLS from one side and UDP on the
          other side and we have found no wat to avoid all this info
          even with topos enabled on Kamailio1 there is no change on
          this.</div>
        <div><br>
        </div>
        <div>UA (OverTLS) -> Kamailio1 (Over UDP)-> Kamailio2
          (Over UDP)-> Provider</div>
        <div>UA :<a href="http://50.50.50.50:5065/" target="_blank"
            moz-do-not-send="true">50.50.50.50:5065</a> (TLS)</div>
        <div>Kamailio1: <a href="http://170.170.170.210:5061/"
            target="_blank" moz-do-not-send="true">170.170.170.210:5061</a> (TLS),<a
            href="http://170.170.170.210:5060/" target="_blank"
            moz-do-not-send="true">170.170.170.210:5060</a> (UDP)</div>
        <div>Kamailio2: <a href="http://170.170.170.170:5060/"
            target="_blank" moz-do-not-send="true">170.170.170.170:5060</a> (UDP)</div>
        <div>Provider: <a href="http://200.200.200.193:5060/"
            target="_blank" moz-do-not-send="true">200.200.200.193:5060</a> (UDP)<br>
        </div>
        <div><br>
        </div>
        <div>Kamailio1 does not run topos. </div>
        <div><br>
        </div>
        <div>Kamailio2 does run topos and rr with bellow settings:</div>
        <div># ------ topos ------<br>
          modparam("topos", "db_url", DBURL)<br>
          modparam("topos", "mask_callid", 0)<br>
          modparam("topos", "sanity_checks", 0)<br>
          modparam("topos", "branch_expire", 130) # 3 Min<br>
          modparam("topos", "dialog_expire", 10800) # 3 Hours<br>
          modparam("topos", "clean_interval", 60)<br>
          modparam("topos", "event_mode", 3)<br>
          modparam("topos", "contact_host", " <a
            href="http://sbc181.myserver.com/" target="_blank"
            moz-do-not-send="true">sbc181.myserver.com</a>")<br>
          <br>
        </div>
        <div># ----- rr params -----<br>
          # set next param to 1 to add value to ;lr param (helps with
          some UAs)<br>
          modparam("rr", "enable_full_lr", 0)<br>
          modparam("rr", "ignore_sips", 1)<br>
          # 0 = do not append from tag to the RR, 0 = append from tag to
          the RR<br>
          modparam("rr", "append_fromtag", 0)<br>
          # dual RR 0 = No, 1 = Yes when needed 2 = Always<br>
          modparam("rr", "enable_double_rr", 0)<br>
        </div>
        <div><br>
        </div>
        <div>The problem is that on the invite from Kamailio2 to
          provider, topos adds only VIA kai new contact. No record route
          at all. So the provider sends multiple 200 ok SDPs to wrong
          IPs. If I disable topos module on kamailio2 everything works
          fine except that we have huge invite as another VIA and
          another record route is added having now three of each and
          fragmentation is present.</div>
        <div><br>
        </div>
        <div><b>Invite from Kamailio1 to Kamailio2</b></div>
        <div>-------------------------------------------------</div>
        <div>2021/09/08 21:41:57.698823 <a
            href="http://170.170.170.210:5060/" target="_blank"
            moz-do-not-send="true">170.170.170.210:5060</a> -> <a
            href="http://170.170.170.181:5060/" target="_blank"
            moz-do-not-send="true">170.170.170.181:5060</a></div>
        <div>INVITE <a
            href="http://sip:1234567890@sip.myserver.com:5060/"
            target="_blank" moz-do-not-send="true">sip:1234567890@sip.myserver.com:5060</a> SIP/2.0<br>
          Record-Route:
<a class="moz-txt-link-rfc2396E" href="sip:170.170.170.210;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes"><sip:170.170.170.210;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes></a></div>
        <div>Record-Route:
<a class="moz-txt-link-rfc2396E" href="sip:170.170.170.210:5061;transport=tls;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes"><sip:170.170.170.210:5061;transport=tls;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes></a></div>
        <div>Via: SIP/2.0/UDP
170.170.170.210;branch=z9hG4bKd703.e095cdba1da1a4b1599119c9135b7838.0;i=8eb41</div>
        <div>Via: SIP/2.0/TLS
50.50.50.50:5065;received=50.50.50.50;rport=31090;branch=z9hG4bKPj9196e5f9-977c-4a53-a4c0-c0ab82b095da;alias<br>
          From: 987654321 <sip: <a
            href="mailto:987654321@sip.myserver.com" target="_blank"
            moz-do-not-send="true">987654321@sip.myserver.com</a>>;tag=1b973153-4034-4480-89d3-c47b411bd81e</div>
        <div>To: <sip: <a href="mailto:1234567890@sip.myserver.com"
            target="_blank" moz-do-not-send="true">1234567890@sip.myserver.com</a>><br>
          Contact:
<a class="moz-txt-link-rfc2396E" href="sip:customer1@50.50.50.50:5065;transport=TLS;alias=50.50.50.50~31090~3"><sip:customer1@50.50.50.50:5065;transport=TLS;alias=50.50.50.50~31090~3></a><br>
          Call-ID: cd64414e-77d5-45b4-a52d-74ec7fb5c7ef<br>
          CSeq: 15776 INVITE<br>
          Supported: 100rel, timer, replaces, norefersub<br>
          Session-Expires: 1800<br>
          Min-SE: 90<br>
          Max-Forwards: 69<br>
          Content-Type: application/sdp<br>
          Content-Length:   231<br>
          P-Asserted-Identity: <sip: <a
            href="mailto:987654321@sip.myserver.com" target="_blank"
            moz-do-not-send="true">987654321@sip.myserver.com</a>><br>
          <br>
          v=0<br>
          o=- 391641952 391641952 IN IP4 170.170.170.216</div>
        <div>s=Asterisk<br>
          c=IN IP4 170.170.170.216<br>
          t=0 0<br>
          m=audio 29478 RTP/AVP 8 0 18<br>
          a=rtpmap:8 PCMA/8000<br>
          a=rtpmap:0 PCMU/8000<br>
          a=rtpmap:18 G729/8000<br>
          a=sendrecv<br>
          a=rtcp:29479<br>
          a=ptime:20<br>
        </div>
        <div><br>
        </div>
        <div>
          <div><b>Invite from Kamailio2 to Provider</b></div>
          <div>-------------------------------------------------</div>
          2021/09/08 21:41:57.715881 <a
            href="http://170.170.170.181:5060/" target="_blank"
            moz-do-not-send="true">170.170.170.181:5060</a> -> <a
            href="http://200.200.200.193:5060/" target="_blank"
            moz-do-not-send="true">200.200.200.193:5060</a></div>
        <div>INVITE sip: <a
            href="http://1234567890@sbc181.myserver.com:5060/"
            target="_blank" moz-do-not-send="true">1234567890@sbc181.myserver.com:5060</a> SIP/2.0<br>
          Via: SIP/2.0/UDP
          170.170.170.181;branch=z9hG4bKd703.d45db1fd910c43c5e7c4f8711a5fca92.0</div>
        <div>From:  987654321 <sip: <a
            href="mailto:987654321@sip.myserver.com" target="_blank"
            moz-do-not-send="true">987654321@sip.myserver.com</a>>;tag=1b973153-4034-4480-89d3-c47b411bd81e<br>
          To: <<a href="mailto:sip%3A1234567890@sip.myserver.com"
            target="_blank" moz-do-not-send="true">sip:1234567890@sip.myserver.com</a>></div>
        <div>Call-ID: cd64414e-77d5-45b4-a52d-74ec7fb5c7ef<br>
          CSeq: 15776 INVITE<br>
          Supported: 100rel, timer, replaces, norefersub<br>
          Session-Expires: 1800<br>
          Min-SE: 90<br>
          Max-Forwards: 68<br>
          Content-Type: application/sdp<br>
          Content-Length:   231<br>
          P-Asserted-Identity: <sip: <a
            href="mailto:987654321@sip.myserver.com" target="_blank"
            moz-do-not-send="true">987654321@sip.myserver.com</a>><br>
          Contact: <<a
            href="mailto:sip%3Abtpsh-c9-613903ef-21d75-1@sbc181.myserver.com"
            target="_blank" moz-do-not-send="true">sip:btpsh-c9-613903ef-21d75-1@sbc181.myserver.com</a>><br>
          <br>
          v=0<br>
          o=- 391641952 391641952 IN IP4 170.170.170.184</div>
        <div>s=Asterisk<br>
          c=IN IP4 170.170.170.184<br>
          t=0 0<br>
          m=audio 11450 RTP/AVP 8 0 18<br>
          a=rtpmap:8 PCMA/8000<br>
          a=rtpmap:0 PCMU/8000<br>
          a=rtpmap:18 G729/8000<br>
          a=sendrecv<br>
          a=rtcp:11451<br>
          a=ptime:20<br>
        </div>
        <div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
        <div><b>Bellow you can see the flow</b></div>
        <div>----------------------------------------</div>
        <div>           <a href="http://170.170.170.210:5060/"
            target="_blank" moz-do-not-send="true">170.170.170.210:5060</a> 
                   <a href="http://170.170.170.170:5060/"
            target="_blank" moz-do-not-send="true">170.170.170.170:5060</a> 
                   <a href="http://200.200.200.193:5060/"
            target="_blank" moz-do-not-send="true">200.200.200.193:5060</a> 
                                                  </div>
        <div>          qqqqqqqqqqwqqqqqqqqq        
           qqqqqqqqqqwqqqqqqqqq          qqqqqqqqqqwqqqqqqqqq           
                             <br>
            21:41:57.698823   x        INVITE (SDP)         x          
                            x                                           
                 <br>
                  +0.003788   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x        
                              x                                      <br>
            21:41:57.702611   x  100 trying -- your call is x          
                            x                                           
                <br>
                  +0.013270   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x        
                              x                                     <br>
            21:41:57.715881   x                             x      
           INVITE (SDP)         x                                       
                    <br>
                  +0.018529   x                             x
          qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             
                 <br>
            21:41:57.734410   x                             x        
          100 Trying          x                                         
                    <br>
                  +0.804083   x                             x
          <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             
                <br>
            21:41:58.538493   x                             x  183
          Session Progress (SDP) x                                     
           <br>
                  +0.014557   x                             x
          <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             
                <br>
            21:41:58.553050   x  183 Session Progress (SDP) x          
                            x                                       <br>
                  +0.483907   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x        
                              x                                    <br>
            21:41:59.036957   x                             x  183
          Session Progress (SDP) x                                     
           <br>
                  +0.012009   x                             x
          <<<qqqqqqqqqqqqqqqqqqqqqqqq x                       
                     <br>
            21:41:59.048966   x  183 Session Progress (SDP) x          
                            x                                      <br>
                  +0.988036   x <<<qqqqqqqqqqqqqqqqqqqqqqqq x  
                                    x                                   <br>
            21:42:00.037002   x                             x  183
          Session Progress (SDP) x                                      <br>
                  +0.010960   x                             x
          <<<qqqqqqqqqqqqqqqqqqqqqqqq x                       
                     <br>
            21:42:00.047962   x  183 Session Progress (SDP) x          
                            x                                      <br>
                  +1.989085   x <<<qqqqqqqqqqqqqqqqqqqqqqqq x  
                                    x                                   <br>
            21:42:02.037047   x                             x  183
          Session Progress (SDP) x                                      <br>
                  +0.010947   x                             x
          <<<qqqqqqqqqqqqqqqqqqqqqqqq x                       
                     <br>
            21:42:02.047994   x  183 Session Progress (SDP) x          
                            x                                      <br>
                  +3.989064   x <<<qqqqqqqqqqqqqqqqqqqqqqqq x  
                                    x                                   <br>
            21:42:06.037058   x                             x  183
          Session Progress (SDP) x                                      <br>
                  +0.008860   x                             x
          <<<qqqqqqqqqqqqqqqqqqqqqqqq x                       
                     <br>
            21:42:06.045918   x  183 Session Progress (SDP) x          
                            x                                      <br>
                  +1.178240   x <<<qqqqqqqqqqqqqqqqqqqqqqqq x  
                                    x                                   <br>
            21:42:07.224158   x           CANCEL            x          
                            x                                           
                <br>
                  +0.002725   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x        
                              x                                   <br>
            21:42:07.226883   x                             x          
          CANCEL            x                                           
                <br>
                  +0.000372   x                             x
          qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             
               <br>
            21:42:07.227255   x        200 canceling        x          
                            x                                           
               <br>
                  +0.016902   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x        
                              x                                   <br>
            21:42:07.244157   x                             x          
          200 OK            x                                           
                  <br>
                  +0.004590   x                             x
          <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             
               <br>
            21:42:07.248747   x                             x   487
          Request Terminated    x                                       
           <br>
                  +0.003547   x                             x
          <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             
           <br>
            21:42:07.252294   x                             x          
            ACK             x                                           
                <br>
                  +0.003737   x                             x
          qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             
           <br>
            21:42:07.256031   x   487 Request Terminated    x          
                            x                                     <br>
                  +0.001161   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x        
                              x                               <br>
            21:42:07.257192   x             ACK             x          
                            x                                           
                <br>
                              x qqqqqqqqqqqqqqqqqqqqqqqqqq> x        <br>
        </div>
        <div><br>
        </div>
        <div>TCP is out of question from the provider.<br>
        </div>
        <div>Any help to use topos or any other module to reduce the
          size of our invites to avoid fragmentation will be much
          appreciated!</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Angelo</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>