<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    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 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 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>
  </body>
</html>