<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Depending from case to case, the record-routing can be avoided,
    especially if you know the environment and only one server is used
    between two endpoints. At that moment you can store existing contact
    in htable and replace it with one having the server ip. You can
    eventually use uuid to generate the contact to be unique, but not a
    must.<br>
    <br>
    The logic would be:<br>
    <br>
    - call comes in, store $sht(x=>$ci::a1:contact) = contact uri<br>
    - store $sht(x=>$ci::a1:ftag) = From tag<br>
    - replace contact header with one using server ip and send out<br>
    - store new contact uri as $sht(x=>$ci::a2:contact)<br>
    - replies comes in, store $sht(x=>$ci::b1:contact) = contact uri<br>
    - replace contact header with another new one using server ip and
    send out<br>
    - store new contact uri as $sht(x=>$ci::b2:contact)<br>
    - when a request within dialog comes in, based on From tag and
    $sht(x=>$ci::a1:ftag), you detect the direction and based on that
    you set the appropriate r-uri using either
    $sht(x=>$ci::a1:contact) or $sht(x=>$ci::b1:contact) and
    replace the contact with a2/b2 variants<br>
    <br>
    Alternative to htable is to use database or other storage (e.g.,
    nosql like redis, mongo, ...).<br>
    <br>
    As a matter of fact, upcoming 4.4 includes the topos module which
    should do what you want here, but due to lack of time caused by some
    unexpected events, at this moment works properly only for MESSAGE
    requests. By the time of release I should have the time to fix the
    dialog routing as well.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 20/03/16 02:41, Matthew Harrold
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAC-Lcd_UA1JBD-sPaZEygVhC5bYoB=769nJ4t3+3-E=S6Ln2xg@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra">Thanks for your quick response.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">No, you
              can't remove those headers. They serve an essential
              purpose and the endpoints won't consider the requests or
              responses valid without them.<br>
            </blockquote>
            <div><br>
            </div>
            <div>It should be theoretically possible to remove some of
              the via and record-route headers, assuming the contact is
              also re-written. The end point's (phones) themselves do
              not need to be aware of anything downstream of the SIP
              server they're registered too. </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <br>
              See my blog post on this topic:<br>
              <br>
              <a moz-do-not-send="true"
href="http://blog.csrpswitch.com/sip-udp-fragmentation-and-kamailio-the-sip-header-diet/"
                rel="noreferrer" target="_blank">http://blog.csrpswitch.com/sip-udp-fragmentation-and-kamailio-the-sip-header-diet/</a></blockquote>
            <div><br>
            </div>
            <div>Thanks for the link!</div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
              <br>
              And you certainly can't hide topology this way.<br>
              <br>
              -- Alex
              <div>
                <div class="h5"><br>
                  <br>
                  On 03/19/2016 09:26 PM, Marrold wrote:<br>
                  <br>
                </div>
              </div>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div>
                  <div class="h5">
                    Hi,<br>
                    <br>
                    Is there any way to remove Via and Record-Route
                    headers from requests<br>
                    sent to an endpoint and update the contact header,
                    but have Kamailio<br>
                    statefully remember where the replies need to route?<br>
                    <br>
                    I imagine this would involve mangling the packets
                    slightly to behave<br>
                    similar to a B2BUA.<br>
                    <br>
                    My motivations, in order of priority -<br>
                    <br>
                    1) Reduce UDP packet size to avoid MTU limitations<br>
                    2) Improve interoperability, don't expect end points
                    to be able to<br>
                    properly parse / process many via / record-route
                    headers<br>
                    3) Hide topology.<br>
                    <br>
                    If someone could point me in the right direction in
                    terms of<br>
                    configuration or modules, that would be great.<br>
                    <br>
                    Thanks<br>
                    <br>
                    <br>
                  </div>
                </div>
                _______________________________________________<br>
                SIP Express Router (SER) and Kamailio (OpenSER) -
                sr-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:sr-users@lists.sip-router.org"
                  target="_blank">sr-users@lists.sip-router.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                  rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                <br>
              </blockquote>
              <br>
              <br>
              -- <br>
              Alex Balashov | Principal | Evariste Systems LLC<br>
              1447 Peachtree Street NE, Suite 700<br>
              Atlanta, GA 30309<br>
              United States<br>
              <br>
              Tel: <a moz-do-not-send="true"
                href="tel:%2B1-800-250-5920" value="+18002505920"
                target="_blank">+1-800-250-5920</a> (toll-free) / <a
                moz-do-not-send="true" href="tel:%2B1-678-954-0671"
                value="+16789540671" target="_blank">+1-678-954-0671</a>
              (direct)<br>
              Web: <a moz-do-not-send="true"
                href="http://www.evaristesys.com/" rel="noreferrer"
                target="_blank">http://www.evaristesys.com/</a>, <a
                moz-do-not-send="true" href="http://www.csrpswitch.com/"
                rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://www.csrpswitch.com/">http://www.csrpswitch.com/</a></a><br>
              <br>
              _______________________________________________<br>
              SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
              mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:sr-users@lists.sip-router.org"
                target="_blank">sr-users@lists.sip-router.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>