<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>I looked a bit a the code of the nat_traversal module and it
      takes the Expires values from SIP replies, when REGISTER is
      forwarded (it has to be with tm t_relay()), but at that moment it
      compares the contacts with the headers in request (taken from
      transaction structure) via string comparison and in case of
      mismatch, they are ignored.</p>
    <p>So, when you change the contacts during REGISTER request
      processing, then you get different values in the replies.</p>
    <p>The solution is to not touch the contact at all, but use Path
      (see path module) when routing out REGISTERs, then call
      loose_route() for initial requests as well.</p>
    <p>An alternative is to try to use the keepalive module instead of
      nat_traversal, maybe it gives what you need.</p>
    <p>And the last one, in master branch I pushed 2 commits (one to
      core and one to nat_traversal module) to add an option to match
      the contact URI by comparing type, user, host, port and proto. You
      can try with master branch by setting contact_match=1 for
      nat_traversal param and see if works.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 04.04.20 03:05, Daniel W. Graham
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BC336E97-A7F4-4637-93FA-24D3EF86C078@exchange.intra.cmsinter.net">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
      <div class="WordSection1">
        <p class="MsoNormal">Register time is not detected when
          add_contact_alias() is enabled:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">With add_contact_alias() :<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Apr  3 20:45:01 host
          /usr/local/sbin/kamailio[28022]: DEBUG: {2 2 REGISTER
          103104ZDUxMzk3ZTg4OTM4ZGFhM2M1NmI3ZjBjYTQ3NWM1NWI}
          nat_traversal [nat_traversal.c:963]: get_register_expire():
          maximum expire for all contacts: 0<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Without add_contact_alias():<o:p></o:p></p>
        <p class="MsoNormal">Apr  3 20:56:52 edgedev
          /usr/local/sbin/kamailio[28104]: DEBUG: {2 2 REGISTER
          103104ZmRiZTI0Y2NkNjUxNDRiYzg5Njc1MzI1NjRkZTM3MTI}
          nat_traversal [nat_traversal.c:963]: get_register_expire():
          maximum expire for all contacts: 300<o:p></o:p></p>
        <p class="MsoNormal">-dan<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal"><b><span
                style="font-size:12.0pt;color:black">From: </span></b><span
              style="font-size:12.0pt;color:black"><a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">"miconda@gmail.com"</a>
              <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
              <b>Reply-To: </b><a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">"miconda@gmail.com"</a>
              <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
              <b>Date: </b>Friday, April 3, 2020 at 4:03 PM<br>
              <b>To: </b>Daniel Graham <a class="moz-txt-link-rfc2396E" href="mailto:dan@cmsinter.net"><dan@cmsinter.net></a>,
              "Kamailio (SER) - Users Mailing List"
              <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a><br>
              <b>Subject: </b>Re: [SR-Users] nathelper without usrloc<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <p>OK, so there were some messages I still missed in the middle
          of the discussion...<o:p></o:p></p>
        <p>Can you get all log messages with debug=3 when the keepalive
          is attempted to be sent?<o:p></o:p></p>
        <p>Cheers,<br>
          Daniel<o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 03.04.20 21:51, Daniel W. Graham
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">I resolved all of the routing issues.
            Only issue I’ve got now is nat_keepalive not working when
            used with set/add_contact_alias().<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <div>
            <p class="MsoNormal">-dan<o:p></o:p></p>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
                  style="font-size:12.0pt;color:black">From: </span></b><span
                style="font-size:12.0pt;color:black"><a
                  href="mailto:miconda@gmail.com" moz-do-not-send="true">"miconda@gmail.com"</a>
                <a href="mailto:miconda@gmail.com"
                  moz-do-not-send="true"><miconda@gmail.com></a><br>
                <b>Reply-To: </b><a href="mailto:miconda@gmail.com"
                  moz-do-not-send="true">"miconda@gmail.com"</a> <a
                  href="mailto:miconda@gmail.com" moz-do-not-send="true">
                  <miconda@gmail.com></a><br>
                <b>Date: </b>Friday, April 3, 2020 at 1:43 PM<br>
                <b>To: </b>Daniel Graham <a
                  href="mailto:dan@cmsinter.net" moz-do-not-send="true"><dan@cmsinter.net></a>,
                "Kamailio (SER) - Users Mailing List"
                <a href="mailto:sr-users@lists.kamailio.org"
                  moz-do-not-send="true"><sr-users@lists.kamailio.org></a><br>
                <b>Subject: </b>Re: [SR-Users] nathelper without usrloc</span><o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"> <o:p></o:p></p>
          </div>
          <p>Somehow I thought that the keepalive is not working and you
            look for fixing it. Now I read the full thread and actually
            the routing of requests within dialog doesn't work.<o:p></o:p></p>
          <p>Can you send a pcap with such a call taken on Kamailio
            system? ACK and BYE should be routed based on Contact of
            INVITE/200ok and record-route headers, no longer related to
            REGISTER (only initial INVITE should rely on registration
            data).<o:p></o:p></p>
          <p>Cheers,<br>
            Daniel<o:p></o:p></p>
          <div>
            <p class="MsoNormal">On 02.04.20 22:11, Daniel W. Graham
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">Same behavior with add_contact_alias()<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <div>
              <p class="MsoNormal">-dan<o:p></o:p></p>
            </div>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b><span
                    style="font-size:12.0pt;color:black">From: </span></b><span
                  style="font-size:12.0pt;color:black"><a
                    href="mailto:miconda@gmail.com"
                    moz-do-not-send="true">"miconda@gmail.com"</a>
                  <a href="mailto:miconda@gmail.com"
                    moz-do-not-send="true"><miconda@gmail.com></a><br>
                  <b>Reply-To: </b><a href="mailto:miconda@gmail.com"
                    moz-do-not-send="true">"miconda@gmail.com"</a> <a
                    href="mailto:miconda@gmail.com"
                    moz-do-not-send="true">
                    <miconda@gmail.com></a><br>
                  <b>Date: </b>Thursday, April 2, 2020 at 2:59 PM<br>
                  <b>To: </b>"Kamailio (SER) - Users Mailing List" <a
                    href="mailto:sr-users@lists.kamailio.org"
                    moz-do-not-send="true">
                    <sr-users@lists.kamailio.org></a>, Daniel
                  Graham <a href="mailto:dan@cmsinter.net"
                    moz-do-not-send="true">
                    <dan@cmsinter.net></a><br>
                  <b>Subject: </b>Re: [SR-Users] nathelper without
                  usrloc</span><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <p>Hello,<o:p></o:p></p>
            <p>can you try with add_contact_alias() instead of
              set_contact_alias()? The second one updates the contact
              URI in a way that is visible for the couple of local
              modules immediately, typically needed when having
              dialog/presence module in that instance (still no changes
              to the header itself, it uses some internal mechanism to
              signal contact value should be taken from a special
              field). The first one uses the lumps system that makes the
              changes over the contact URI not visible immediately
              (unless msg_apply_changes() is used).<o:p></o:p></p>
            <p>Maybe nat_keepalive() needs the original contact URI, not
              the one updated by set_contact_alias().<o:p></o:p></p>
            <p>Cheers,<br>
              Daniel<o:p></o:p></p>
            <div>
              <p class="MsoNormal">On 02.04.20 18:45, Daniel W. Graham
                wrote:<o:p></o:p></p>
            </div>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <p class="MsoNormal">I was able to fix all issues, but
                have one partially lingering.<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">For register only, if I apply:
                set_contact_alias() with nat_keepalive(), keepalives are
                not sent. Removing set_contact_alias() fixes this.
                <o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">I *shouldn’t need this if the pbx was
                saving received and rport params as a result of
                add_path_received().<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">Can anyone explain why these two
                functions conflict?<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">Test scenario -<o:p></o:p></p>
              <p class="MsoNormal"># Doesn’t result in register
                keepalive –<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">route[NATDETECT] {<o:p></o:p></p>
              <p class="MsoNormal">    force_rport();<br>
                    set_contact_alias();  # removal of this enables
                keepalive<br>
                    nat_keepalive();<br>
                    return;<br>
                }<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">I’ve tested this with and without
                calls to handle_ruri_alias() elsewhere in cfg script
                with same result.<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">-dan<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <div style="border:none;border-top:solid #B5C4DF
                1.0pt;padding:3.0pt 0in 0in 0in">
                <p class="MsoNormal"><b><span
                      style="font-size:12.0pt;color:black">From: </span></b><span
                    style="font-size:12.0pt;color:black">sr-users
                    <a href="mailto:sr-users-bounces@lists.kamailio.org"
                      moz-do-not-send="true"><sr-users-bounces@lists.kamailio.org></a>
                    on behalf of Sergiu Pojoga
                    <a href="mailto:pojogas@gmail.com"
                      moz-do-not-send="true"><pojogas@gmail.com></a><br>
                    <b>Reply-To: </b>"Kamailio (SER) - Users Mailing
                    List" <a href="mailto:sr-users@lists.kamailio.org"
                      moz-do-not-send="true">
                      <sr-users@lists.kamailio.org></a><br>
                    <b>Date: </b>Wednesday, April 1, 2020 at 8:58 AM<br>
                    <b>To: </b>"Kamailio (SER) - Users Mailing List" <a
                      href="mailto:sr-users@lists.kamailio.org"
                      moz-do-not-send="true">
                      <sr-users@lists.kamailio.org></a><br>
                    <b>Subject: </b>Re: [SR-Users] nathelper without
                    usrloc</span><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Nothing else comes to mind based on
                  info provided. May be you can send some sip traffic
                  captures and elaborate?
                  <o:p></o:p></p>
                <div>
                  <p class="MsoNormal"> <o:p></o:p></p>
                </div>
                <div>
                  <p class="MsoNormal">Regards,<o:p></o:p></p>
                </div>
                <div>
                  <p class="MsoNormal">--Sergiu <o:p></o:p></p>
                </div>
              </div>
              <p class="MsoNormal"> <o:p></o:p></p>
              <div>
                <div>
                  <p class="MsoNormal">On Tue, Mar 31, 2020 at 10:29 PM
                    Daniel W. Graham <<a
                      href="mailto:dan@cmsinter.net"
                      moz-do-not-send="true">dan@cmsinter.net</a>>
                    wrote:<o:p></o:p></p>
                </div>
                <blockquote style="border:none;border-left:solid #CCCCCC
                  1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
                  <div>
                    <p class="MsoNormal">Thanks, yeah I had already
                      changed that, but registration works with either.
                      I’m not asking for a solution, just looking for
                      suggestions on anything that needs attention, so I
                      appreciate your pointers. 
                      <o:p></o:p></p>
                    <div>
                      <p class="MsoNormal"> <o:p></o:p></p>
                    </div>
                    <div>
                      <p class="MsoNormal" style="margin-bottom:12.0pt">-dan<o:p></o:p></p>
                      <div>
                        <div>
                          <p class="MsoNormal">On Mar 31, 2020, at 8:55
                            PM, Sergiu Pojoga <<a
                              href="mailto:pojogas@gmail.com"
                              target="_blank" moz-do-not-send="true">pojogas@gmail.com</a>>
                            wrote:<o:p></o:p></p>
                        </div>
                      </div>
                      <div>
                        <blockquote
                          style="margin-top:5.0pt;margin-bottom:5.0pt">
                          <p class="MsoNormal"> <o:p></o:p></p>
                        </blockquote>
                      </div>
                      <blockquote
                        style="margin-top:5.0pt;margin-bottom:5.0pt">
                        <div>
                          <div>
                            <p class="MsoNormal">Oh and almost forgot -
                              try <b>add_path_received()</b> instead
                              of add_path()<o:p></o:p></p>
                            <div>
                              <p class="MsoNormal"> <o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal">Good luck!<o:p></o:p></p>
                            </div>
                          </div>
                          <p class="MsoNormal"> <o:p></o:p></p>
                          <div>
                            <div>
                              <p class="MsoNormal">On Tue, Mar 31, 2020
                                at 8:48 PM Sergiu Pojoga <<a
                                  href="mailto:pojogas@gmail.com"
                                  target="_blank" moz-do-not-send="true">pojogas@gmail.com</a>>
                                wrote:<o:p></o:p></p>
                            </div>
                            <blockquote
                              style="border:none;border-left:solid
                              #CCCCCC 1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
                              <div>
                                <p class="MsoNormal">A lot of things may
                                  not be 'right' here, unfortunately
                                  your question is too broad to answer
                                  and too little info, the topology is
                                  indeed non-default and I doubt someone
                                  will present you with a final solution
                                  (there's business support, if you're
                                  looking for that). <o:p></o:p></p>
                                <div>
                                  <p class="MsoNormal"> <o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">Otherwise, if I
                                    were to just throw a guess: <o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">-
                                    try fix_nated_register() (instead of
                                    set_contact_alias) just for Register
                                    method on the way to the registrar<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">- in the
                                    Registrar, make sure the Contact's
                                    Path address is correct<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"> <o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">Cheers,<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">--Sergiu<o:p></o:p></p>
                                </div>
                              </div>
                              <p class="MsoNormal"> <o:p></o:p></p>
                              <div>
                                <div>
                                  <p class="MsoNormal">On Tue, Mar 31,
                                    2020 at 7:34 PM Daniel W. Graham
                                    <<a
                                      href="mailto:dan@cmsinter.net"
                                      target="_blank"
                                      moz-do-not-send="true">dan@cmsinter.net</a>>
                                    wrote:<o:p></o:p></p>
                                </div>
                                <blockquote
                                  style="border:none;border-left:solid
                                  #CCCCCC 1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
                                  <p class="MsoNormal">It did help, I
                                    read that a couple times already but
                                    something is still not right, and
                                    its only because of the decoupling
                                    of the registrar. I need to do more
                                    debugging and see if Im loosing the
                                    flag value. Hoping something sticks
                                    out that someone sees and can point
                                    me in the right direction. <br>
                                    <br>
                                    -dan<br>
                                    <br>
                                    On Mar 31, 2020, at 7:15 PM, Alex
                                    Balashov <<a
                                      href="mailto:abalashov@evaristesys.com"
                                      target="_blank"
                                      moz-do-not-send="true">abalashov@evaristesys.com</a>>
                                    wrote:<br>
                                    > <br>
                                    > Daniel,<br>
                                    > <br>
                                    > Might this article be of aid?<br>
                                    > <br>
                                    > <a
href="http://www.evaristesys.com/blog/server-side-nat-traversal-with-kamailio-the-definitive-guide/"
                                      target="_blank"
                                      moz-do-not-send="true">
http://www.evaristesys.com/blog/server-side-nat-traversal-with-kamailio-the-definitive-guide/</a><br>
                                    > <br>
                                    > -- Alex<br>
                                    > <br>
                                    >> On Tue, Mar 31, 2020 at
                                    11:12:23PM +0000, Daniel W. Graham
                                    wrote:<br>
                                    >> <br>
                                    >> It does but doesn't work as
                                    well as kamailio, and since the
                                    proxy is the entry point.<br>
                                    >> <br>
                                    >> The biggest issue here isnt
                                    the keepalive, as I did have that
                                    working. The main issue is the
                                    routing of messages, utilizing
                                    set_contact_alias and
                                    handle_ruri_alias, as Ive been
                                    unable to get ack and bye messages
                                    to make it past the proxy. I’m
                                    assuming these functions are not
                                    being used at the right locations or
                                    I need to rely on another mechanism
                                    to accomplish it. I also question my
                                    use of the PBX flag and the
                                    natmanage logic.<br>
                                    >> <br>
                                    >> -dan<br>
                                    >> <br>
                                    >> On Mar 31, 2020, at 7:01
                                    PM, Sergiu Pojoga <<a
                                      href="mailto:pojogas@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true">pojogas@gmail.com</a>>
                                    wrote:<br>
                                    >> <br>
                                    >> <br>
                                    >> Hi Daniel,<br>
                                    >> <br>
                                    >> From what you are
                                    describing, my understanding is that
                                    the Registrar is the PBX, kamailio
                                    is acting as an edge proxy. If so,
                                    doesn't the PBX/registrar have NAT
                                    traversal/keepalive mechanisms of
                                    its own?<br>
                                    >> <br>
                                    >> Regards,<br>
                                    >> --Sergiu<br>
                                    >> <br>
                                    >> On Tue, Mar 31, 2020 at
                                    1:55 PM Daniel W. Graham <<a
                                      href="mailto:dan@cmsinter.net"
                                      target="_blank"
                                      moz-do-not-send="true">dan@cmsinter.net</a><mailto:<a
                                      href="mailto:dan@cmsinter.net"
                                      target="_blank"
                                      moz-do-not-send="true">dan@cmsinter.net</a>>>
                                    wrote:<br>
                                    >> I’ve been missing with this
                                    for a while and seem to be missing
                                    something. Any suggestions on what
                                    is missing here?<br>
                                    >> <br>
                                    >> Trying to use
                                    set_contact_alias() and
                                    handle_ruri_alias() from nathelper
                                    module and nat_keepalive from
                                    nat_traversal module, without
                                    registrar.<br>
                                    >> <br>
                                    >> I had register keepalive
                                    working, that has since broke. When
                                    register keepalive was working, I
                                    was able to place call in either
                                    direction but ACK and BYE was not
                                    being routed past kamailio.<br>
                                    >> <br>
                                    >> Registrations are forwarded
                                    to the PBX using add_path() and is
                                    working.<br>
                                    >> <br>
                                    >> Also not included below is
                                    the routing to the PBX, that is just
                                    setting $du and t_relay, and is also
                                    working.<br>
                                    >> <br>
                                    >> Topology is: UA1 -> NAT
                                    -> kamailio -> PBX -> UA2<br>
                                    >> <br>
                                    >> Using default config file
                                    as the example, modified with above
                                    changes. I also removed RTP config
                                    as that is a non-issue.<br>
                                    >> <br>
                                    >> request_route {<br>
                                    >>    ……<br>
                                    >>    # FLAG MESSAGES FROM PBX<br>
                                    >>        setflag(FLT_PBX);<br>
                                    >>    route(NATDETECT);<br>
                                    >>    ……<br>
                                    >> <br>
                                    >> route[NATDETECT] {<br>
                                    >>            if
                                    (nat_uac_test("19")) {<br>
                                    >> force_rport();<br>
                                    >>                       
                                    set_contact_alias();<br>
                                    >>                       
                                    nat_keepalive();<br>
                                    >>            }<br>
                                    >>            return;<br>
                                    >> }<br>
                                    >> <br>
                                    >> route[WITHINDLG] {<br>
                                    >>            if
                                    (!has_totag()) return;<br>
                                    >>                        if
                                    (loose_route()) {<br>
                                    >>                           
                                            route(DLGURI);<br>
                                    >>                        }
                                    else if ( is_method("ACK") ) {<br>
                                    >>                           
                                            route(NATMANAGE);<br>
                                    >>                        }
                                    else if ( is_method("NOTIFY") ) {<br>
                                    >>                           
                                            record_route();<br>
                                    >>                        }<br>
                                    >>            route(RELAY);<br>
                                    >>            exit;<br>
                                    >>            }<br>
                                    >> <br>
                                    >>            if
                                    (is_method("SUBSCRIBE") &&
                                    uri == myself) {<br>
                                    >>                       
                                    route(PRESENCE);<br>
                                    >>                       
                                    exit;<br>
                                    >>            }<br>
                                    >>            if (
                                    is_method("ACK") ) {<br>
                                    >>                        if (
                                    t_check_trans() ) {<br>
                                    >>                           
                                            route(RELAY);<br>
                                    >>                           
                                            exit;<br>
                                    >>                        }
                                    else {<br>
                                    >>                           
                                            exit;<br>
                                    >>                        }<br>
                                    >>            }<br>
                                    >>           
                                    sl_send_reply("404","Not here");<br>
                                    >>            exit;<br>
                                    >> }<br>
                                    >> <br>
                                    >> route[NATMANAGE] {<br>
                                    >>       
                                    if(isflagset(FLT_PBX)) {<br>
                                    >>           
                                    handle_ruri_alias();<br>
                                    >>    }<br>
                                    >>    if(!isflagset(FLT_PBX))
                                    {<br>
                                    >>        set_contact_alias();<br>
                                    >>    }       return;<br>
                                    >> }<br>
                                    >> <br>
                                    >> route[DLGURI] {<br>
                                    >>           
                                    if(!isdsturiset()) {<br>
                                    >>                       
                                    handle_ruri_alias();<br>
                                    >>            }<br>
                                    >>            return;<br>
                                    >> }<br>
                                    >> <br>
                                    >> branch_route[MANAGE_BRANCH]
                                    {<br>
                                    >>           
                                    route(NATMANAGE);<br>
                                    >> }<br>
                                    >> <br>
                                    >> onreply_route[MANAGE_REPLY]
                                    {<br>
                                    >>           
                                    if(status=~"[12][0-9][0-9]") {<br>
                                    >>                       
                                    route(NATMANAGE);<br>
                                    >>            }<br>
                                    >> }<br>
                                    >>
                                    failure_route[MANAGE_FAILURE] {<br>
                                    >>           
                                    route(NATMANAGE);<br>
                                    >> <br>
                                    >>            if
                                    (t_is_canceled()) exit;<br>
                                    >> <br>
                                    >> <br>
                                    >> -dan<br>
                                    >> <br>
                                    >>
                                    _______________________________________________<br>
                                    >> Kamailio (SER) - Users
                                    Mailing List<br>
                                    >> <a
                                      href="mailto:sr-users@lists.kamailio.org"
                                      target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a><mailto:<a
href="mailto:sr-users@lists.kamailio.org" target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a>><br>
                                    >> <a
                                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                      target="_blank"
                                      moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                                    >>
                                    _______________________________________________<br>
                                    >> Kamailio (SER) - Users
                                    Mailing List<br>
                                    >> <a
                                      href="mailto:sr-users@lists.kamailio.org"
                                      target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                                    >> <a
                                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                      target="_blank"
                                      moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                                    > <br>
                                    >>
                                    _______________________________________________<br>
                                    >> Kamailio (SER) - Users
                                    Mailing List<br>
                                    >> <a
                                      href="mailto:sr-users@lists.kamailio.org"
                                      target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                                    >> <a
                                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                      target="_blank"
                                      moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                                    > <br>
                                    > <br>
                                    > -- <br>
                                    > Alex Balashov | Principal |
                                    Evariste Systems LLC<br>
                                    > <br>
                                    > Tel: +1-706-510-6800 /
                                    +1-800-250-5920 (toll-free)<br>
                                    > Web: <a
                                      href="http://www.evaristesys.com/"
                                      target="_blank"
                                      moz-do-not-send="true">http://www.evaristesys.com/</a>,
                                    <a href="http://www.csrpswitch.com/"
                                      target="_blank"
                                      moz-do-not-send="true">http://www.csrpswitch.com/</a><br>
                                    > <br>
                                    >
                                    _______________________________________________<br>
                                    > Kamailio (SER) - Users Mailing
                                    List<br>
                                    > <a
                                      href="mailto:sr-users@lists.kamailio.org"
                                      target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                                    > <a
                                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                      target="_blank"
                                      moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
_______________________________________________<br>
                                    Kamailio (SER) - Users Mailing List<br>
                                    <a
                                      href="mailto:sr-users@lists.kamailio.org"
                                      target="_blank"
                                      moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                                    <a
                                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                      target="_blank"
                                      moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
                                </blockquote>
                              </div>
                            </blockquote>
                          </div>
                          <p class="MsoNormal">_______________________________________________<br>
                            Kamailio (SER) - Users Mailing List<br>
                            <a href="mailto:sr-users@lists.kamailio.org"
                              target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                            <a
                              href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                              target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                  <p class="MsoNormal">_______________________________________________<br>
                    Kamailio (SER) - Users Mailing List<br>
                    <a href="mailto:sr-users@lists.kamailio.org"
                      target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                    <a
                      href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                      target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
                </blockquote>
              </div>
              <p class="MsoNormal"><br>
                <br>
                <br>
                <br>
                <o:p></o:p></p>
              <pre>_______________________________________________<o:p></o:p></pre>
              <pre>Kamailio (SER) - Users Mailing List<o:p></o:p></pre>
              <pre><a href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">sr-users@lists.kamailio.org</a><o:p></o:p></pre>
              <pre><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
            </blockquote>
            <pre>-- <o:p></o:p></pre>
            <pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a><o:p></o:p></pre>
            <pre><a href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
          </blockquote>
          <pre>-- <o:p></o:p></pre>
          <pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a><o:p></o:p></pre>
          <pre><a href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
        </blockquote>
        <pre>-- <o:p></o:p></pre>
        <pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a><o:p></o:p></pre>
        <pre><a href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
      </div>
    </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>