<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Stas,<br>
      <br>
      If the ACK git the loose_route() / match_dialog(), then the state
      will move to 4. <br>
      <br>
      You may also use the $DLG_lifetime when handling the re-INVITE -
      if it is less than 5 seconds, drop the re-INVITE :)<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 02/06/2017 09:46 PM, Stas Kobzar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMYcjoo95K9uQZk3V6E+iqWKj-tfv6ajiRYi76irFi2vZBdYnQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello Bogdan,
        <div><br>
        </div>
        <div>In my case, ACK for previous INVITE has already been
          received by OpenSIPS, but not sent yet. </div>
        <div>In this case, will the variable $DLG_status still equals 3
          ?</div>
        <div><br>
        </div>
        <div>Thanks</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sun, Feb 5, 2017 at 11:15 AM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:bogdan@opensips.org"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:bogdan@opensips.org">bogdan@opensips.org</a></a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Stas,<br>
                <br>
                Such races may happen at application level or even at
                network level (when using UDP) - so if you have 2
                packets very close as time, they may swap. That is SIP
                :)<br>
                <br>
                The full guilt is in the UAC device, IMHO - it should
                let some time gap between the ACK and re-INVITE, to
                eliminate any possible races.<br>
                <br>
                Now, what you can do is to use the dialog module and to
                check the dialog state when receiving the re-invite. If
                $DLG_status is </tt><tt><span
                  class="m_-8994335413096070854emphasis"><em>3</em></span>
                (Confirmed by a final reply but no ACK received yet),
                drop with no reply the re-INVITEs (to force a later
                retransmission) :<br>
                    <a moz-do-not-send="true"
                  class="m_-8994335413096070854moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/2.2.x/dialog.html#id297400"
                  target="_blank">http://www.opensips.org/html/<wbr>docs/modules/2.2.x/dialog.<wbr>html#id297400</a><br>
                <br>
                Regards,<br>
              </tt>
              <pre class="m_-8994335413096070854moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="m_-8994335413096070854moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre><span class="">
    <div class="m_-8994335413096070854moz-cite-prefix">On 02/02/2017 10:31 PM, Stas Kobzar
      wrote:

    </div>
    </span><blockquote type="cite"><div><div class="h5">
      <div dir="ltr"><font face="monospace, monospace">Hello List,</font>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">My call flow has initial
            INVITE and re-INVITE to update RTP IP/port.</font></div>
        <div><font face="monospace, monospace">Usually everything works
            well, but sometimes OpenSIPS come up with following example:</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">UA                
            OpenSIPS          PSTN GW</font></div>
        <div><font face="monospace, monospace">------------------------------<wbr>-------------</font></div>
        <div><font face="monospace, monospace">INV(CSeq: 100) ----->
            | ---> INV(CSeq: 100)</font></div>
        <div><font face="monospace, monospace"><---- 200 OK        
             | <--- 200 OK</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">(UA sends ACK then new
            INVITE)</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">ACK(CSeq: 100) ----->
            |</font></div>
        <div><font face="monospace, monospace">reINV(Cseq: 101) --->
            |</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">(OpenSIPS relays first
            INVITE then ACK)</font></div>
        <div><font face="monospace, monospace">                      |
            ---> reINV(CSeq: 101)</font></div>
        <div><font face="monospace, monospace">                      |
            --->   ACK(CSeq: 100)</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">When PSTN gateway
            receives re-INVITE before ACK for previous INVITE</font></div>
        <div><font face="monospace, monospace">it responds 500 with
            Retry-After header. </font></div>
        <div><font face="monospace, monospace">This is correct behaviour
            which conforms to the RFC 3261 section 14.2</font></div>
        <div><font face="monospace, monospace">

          </font></div>
        <div><font face="monospace, monospace">My question is:

          </font></div>
        <div><font face="monospace, monospace">Is it possible to assure
            order of received and relayed messages within the same SIP
            session? Is there any configuration parameter?</font></div>
        <div><font face="monospace, monospace">      

          </font></div>
        <div>
          <div><font face="monospace, monospace">Thank you,</font></div>
          -- 

          <div class="m_-8994335413096070854gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr"><span>
                              <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,112,192);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Stas Kobzar</span></p>
                              <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12px;font-family:Arial;color:rgb(166,166,166);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Developeur VoIP / VoIP Developer</span></p>
                              <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

                              </p>
                            </span>
                            <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,112,192);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Modulis­.ca Inc.</span></p>
                            <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"># Bureau / Office: <a moz-do-not-send="true" href="tel:%28514%29%20284-2020" value="+15142842020" target="_blank">514-284-2020 x 246</a></span></p>
                            <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Email</span><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">: </span><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><a moz-do-not-send="true" href="http://firstname.lastname" style="text-decoration:none" target="_blank">s</a>tas.kobzar</span><a moz-do-not-send="true" style="text-decoration:none"><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">@modulis.ca</span></a></p>
                            <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> </span></p>
                            <p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><a moz-do-not-send="true" href="https://www.modulis.com/" style="text-decoration:none" target="_blank">https://www.modulis.com</a></span></p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      

      <fieldset class="m_-8994335413096070854mimeAttachmentHeader"></fieldset>
      

      </div></div><span class=""><pre>______________________________<wbr>_________________
Users mailing list
<a moz-do-not-send="true" class="m_-8994335413096070854moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="m_-8994335413096070854moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
    </span></blockquote>
    

  </div>

</blockquote></div>

<div>
</div>-- 
<div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,112,192);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Stas Kobzar</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12px;font-family:Arial;color:rgb(166,166,166);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Developeur VoIP / VoIP Developer</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">
</p></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,112,192);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Modulis­.ca Inc.</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"># Bureau / Office: 514-284-2020 x 246</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Email</span><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">: </span><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><a moz-do-not-send="true" href="http://firstname.lastname" style="text-decoration:none" target="_blank">s</a>tas.kobzar</span><a moz-do-not-send="true" style="text-decoration:none"><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">@modulis.ca</span></a></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> </span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><a moz-do-not-send="true" href="https://www.modulis.com/" style="text-decoration:none" target="_blank">https://www.modulis.com</a></span></p></div></div></div></div></div></div></div></div></div>
</div>



</blockquote>
</body></html>