<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Guillaume,<br>
      <br>
      The incoming BYE is broken - the IP of your OpenSIPS can be found
      both in RURI and in the top Route header. As the IP is found in
      RURI makes OpenSIPS think that the previous hop was a strict
      router. and this leads to the infinite loop.<br>
      <br>
      Looking at it, I see the typical mistake of doing a
      fix_nated_contact() and overwriting the original contact URI in
      the 200 OK for INVITE (this contact is used as part of the routing
      set for routing back sequential requests like BYE)<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 15.11.2016 19:12, guillaume
      Montassier wrote:<br>
    </div>
    <blockquote cite="mid:582B41E9.7000008@openip.fr" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      Hello all,<br>
      <br>
      I'm working a project with multiples opensips (each handling a
      particular role).<br>
      So when an invite goes in our plateform, it crosse multiples
      openips and can even sometime go though a specific opensips
      multiples times.<br>
      My problem is: When the called send a BYE I have a strange
      behavior. One of my opensips which receive the BYE resend it to
      itself and suppress the wrong route (last route instead of the
      first route...).<br>
      <br>
      - For example this is the BYE message my opensips receive :<br>
      <br>
      2016/11/15 15:24:08.316573<b> 172.99.37.70:5060</b> -&gt; <b>172.99.37.52:5060</b><br>
      BYE sip:<b><a moz-do-not-send="true"
          class="moz-txt-link-abbreviated"
          href="mailto:test2-o36onlarnncrd@172.99.37.52:5060">test2-o36onlarnncrd@172.99.37.52:5060</a></b>;transport=udp
      SIP/2.0<br>
      Route: &lt;sip:<b>172.99.37.52</b>;lr;did=7bb.ca4be925&gt;       
                                      =&gt;<b>itself</b><br>
      Route: &lt;sip:<b>172.99.37.52:5061</b>;lr;ftag=as2d12af76;did=7bb.af095117&gt;   
                                          =&gt;<b>Next hope</b><br>
      Route: &lt;sip:172.99.37.70;lr;did=7bb.40f20381&gt;<br>
      Route:
      &lt;sip:172.99.37.59;lr;ftag=as2d12af76;did=7bb.70c3b743&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5062;lr;ftag=as2d12af76;did=7bb.bc13056&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5061;lr;ftag=as2d12af76;did=7bb.9f095117&gt;<br>
      Route: &lt;sip:172.99.37.52;lr;did=7bb.ba4be925&gt;<br>
      <br>
      <br>
      - This is what I should have as result (It remove itself from the
      Route header and send the BYE to the next hop (which is
      172.99.37.52:5061) ):<br>
      <br>
      2016/11/15 15:24:08.316573 <b>172.99.37.52:5060</b> -&gt; <b>172.99.37.52:5061</b>   
                                          =&gt;<b>Send to Next hope</b><br>
      BYE <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
        href="mailto:sip:test2-o36onlarnncrd@172.99.37.52:5060;transport=udp">sip:test2-o36onlarnncrd@172.99.37.52:5060;transport=udp</a>
      SIP/2.0<br>
      <b>Route</b>: &lt;sip:<b>172.99.37.52:5061</b>;lr;ftag=as2d12af76;did=7bb.af095117&gt;   
                                          =&gt;<b>Next hope is the first
        route header</b><br>
      Route: &lt;sip:<b>172.99.37.70</b>;lr;did=7bb.40f20381&gt;<br>
      Route:
      &lt;sip:172.99.37.59;lr;ftag=as2d12af76;did=7bb.70c3b743&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5062;lr;ftag=as2d12af76;did=7bb.bc13056&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5061;lr;ftag=as2d12af76;did=7bb.9f095117&gt;<br>
      Route: &lt;sip:172.99.37.52;lr;did=7bb.ba4be925&gt;<br>
      <br>
      <br>
      - This is what I have (send to itself and remove the wrong
      route...):<br>
      <br>
      2016/11/15 15:24:08.316573 <b>172.99.37.52:5060</b> -&gt; <b>172.99.37.52:5060</b>   
                                          =&gt;<b>send to itself</b><br>
      BYE<b> sip:172.99.37.52:5060</b>;transport=udp SIP/2.0           
                                  =&gt;<b>modify bye?</b><br>
      <b>Route</b>: &lt;sip:<b>172.99.37.52</b>;lr;did=7bb.ca4be925&gt;   
                                          =&gt;<b>don't supress the
        route header</b><br>
      Route:
      &lt;sip:172.99.37.52:5061;lr;ftag=as2d12af76;did=7bb.af095117&gt;<br>
      Route: &lt;sip:172.99.37.70;lr;did=7bb.40f20381&gt;<br>
      Route:
      &lt;sip:172.99.37.59;lr;ftag=as2d12af76;did=7bb.70c3b743&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5062;lr;ftag=as2d12af76;did=7bb.bc13056&gt;<br>
      Route:
      &lt;sip:172.99.37.52:5061;lr;ftag=as2d12af76;did=7bb.9f095117&gt;<br>
      =&gt;<b>The last route is suppress</b><br>
      <br>
      <div class="moz-signature"><br>
        I know that my first header route is the same than my last
        header route, and maybe this is why I have this beavior, but
        this seems really odd to me.<br>
        <br>
        Thank you all,<br>
        <br>
        /Guillaume<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>