<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Razvan</p>
    <p>will take a look and let you know.</p>
    <p>I tried with match_dialog() but then got some loop.</p>
    <p><br>
    </p>
    <p>tnx</p>
    <p>miha<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 07/09/2016 10:12, Răzvan Crainea
      wrote:<br>
    </div>
    <blockquote
      cite="mid:2d1b7147-223c-b336-142f-6e7878ebf7f7@opensips.org"
      type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <tt>Hi, Miha!<br>
        <br>
        It looks like loose_route() fails - did you try to look into the
        logs and see if it indicates something? Is the SBC_1 IP
        advertised in the Route header a listener of OpenSIPS?<br>
        <br>
        Also, if loose_route() fails, you should still try to match the
        PRACK against the dialog. So your scripting logic should look
        like this:<br>
        <br>
        if (has_totag()) {<br>
            if (loose_route() || match_dialog()) {<br>
                ...<br>
            }<br>
        }<br>
        <br>
        Let us know how that goes.<br>
        <br>
        Best regards,<br>
      </tt>
      <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
      <div class="moz-cite-prefix">On 09/07/2016 10:38 AM, Miha wrote:<br>
      </div>
      <blockquote
        cite="mid:5563d72c-49fe-bf36-2e34-f07143d68af6@softnet.si"
        type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <div class="moz-text-plain" wrap="true" graphical-quote="true"
          style="font-family: -moz-fixed; font-size: 14px;"
          lang="x-unicode">
          <pre wrap="">Hi

i have one issue and do not know how to solve it...

Initial invite:

<font size="-1">U SBC_2:5060 -&gt; SBC_1:5060
INVITE <a moz-do-not-send="true" class="moz-txt-link-freetext" href="sip:777774220000@SBC_1:5060;user=phone">sip:777774220000@SBC_1:5060;user=phone</a> SIP/2.0.
Via: SIP/2.0/UDP SBC_2:5060;branch=z9hG4bK57fa.67ccbb16.0.
From: &lt;sip:</font><font size="-1"><font size="-1">8888818100100</font>@PBX;user=phone&gt;;tag=<b>1875283502</b>.
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:777774220000@SBC_2;user=phone">&lt;sip:777774220000@SBC_2;user=phone&gt;</a>.
Call-ID: <b>fb9e258ae909d311a85a0090332e03ed@PBX.</b>
CSeq: 1193456 INVITE.
Contact: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:SBC_2;did=8d9.43418513">&lt;sip:SBC_2;did=8d9.43418513&gt;</a>.
Alert-Info: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="urn:alert:source:internal">&lt;urn:alert:source:internal&gt;</a>.
Allow: REGISTER,SUBSCRIBE,NOTIFY,INVITE,ACK,P

</font>
Seq....<font size="-1">

U PBX:5060 -&gt; SBC_2:5060
PRACK <a moz-do-not-send="true" class="moz-txt-link-freetext" href="sip:SBC_2;did=8d9.43418513">sip:SBC_2;did=8d9.43418513</a> SIP/2.0.
Via: SIP/2.0/UDP PBX:5060;branch=z9hG4bK-002AF6E3;rport.
From: &lt;sip:</font><font size="-1"><font size="-1">8888818100100</font>@PBX;user=phone&gt;;tag=<b>1875283502</b>.
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:777774220000@SBC_2;user=phone">&lt;sip:777774220000@SBC_2;user=phone&gt;</a>;tag=<b>FamBBcayZeKgF</b>.
Call-ID:<b> fb9e258ae909d311a85a0090332e03ed@PBX.</b>
CSeq: 1193457 PRACK.
Content-Length: 0.
Max-Forwards: 70.
RAck: 1601153264 1193456 INVITE.
.

</font><font size="+1">
</font><font size="-1"><font size="-1"><font size="+1">Seq....</font>

</font>U SBC_2:5060 -&gt; SBC_1:5060
PRACK <a moz-do-not-send="true" class="moz-txt-link-freetext" href="sip:777774220000@SBC_1:5060;transport=udp">sip:777774220000@SBC_1:5060;transport=udp</a> SIP/2.0.
Route: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:SBC_1;lr;ftag=1875283502;did=8d9.e2509d35">&lt;sip:SBC_1;lr;ftag=1875283502;did=8d9.e2509d35&gt;</a>.
Via: SIP/2.0/UDP SBC_2:5060;branch=z9hG4bK67fa.e6a41de2.0.
From: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:8888818100100@PBX;user=phone">&lt;sip:8888818100100@PBX;user=phone&gt;</a>;tag=<b>1875283502</b>.
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:777774220000@SBC_2;user=phone">&lt;sip:777774220000@SBC_2;user=phone&gt;</a>;tag=<b>FamBBcayZeKgF</b>.
Call-ID: <b>fb9e258ae909d311a85a0090332e03ed@PBX.</b>
CSeq: 1193457 PRACK.
Content-Length: 0.
Max-Forwards: 69.
RAck: 1601153264 1193456 INVITE.</font>

<font size="-1"><font size="-1"><font size="+1">Seq....</font></font></font>
<font size="-1">
U </font><font size="-1"><font size="-1">SBC_1</font>:5060 -&gt; </font><font size="-1"><font size="-1">SBC_2</font>:5060
SIP/2.0 404 Not here.
Via: SIP/2.0/UDP </font><font size="-1"><font size="-1"><font size="-1">SBC_2</font></font>:5060;branch=z9hG4bK67fa.e6a41de2.0.
From: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:0038618100100@212.103.141.2;user=phone">&lt;sip:</a></font><font size="-1"><a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:0038618100100@212.103.141.2;user=phone"><font size="-1">8888818100100</font>@PBX;user=phone&gt;</a>;tag=1875283502.
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:381114220000@213.253.120.74;user=phone">&lt;sip:</a></font><font size="-1"><a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:381114220000@213.253.120.74;user=phone"><font size="-1">777774220000</font>@</a></font><font size="-1"><a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:381114220000@213.253.120.74;user=phone"><font size="-1"><font size="-1">SBC_2</font></font>;user=phone&gt;</a>;tag=FamBBcayZeKgF.
Call-ID: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:fb9e258ae909d311a85a0090332e03ed@212.103.141.2">fb9e258ae909d311a85a0090332e03ed@PBX</a>.
CSeq: 1193457 PRACK.
Server: OpenSIPS (2.1.1 (x86_64/linux)).
Content-Length: 0.</font>

Why I am getting 404 from Opensips. is should be routed like seq request, right?





<font size="-1"> if (has_totag()) {
                # sequential requests within a dialog should
                # take the path determined by record-routing
                if (loose_route()) {
                        xlog("loose_route");
                        #if ($DLG_status!=NULL)
                        xlog("dlg_status");
                        if (!validate_dialog()){
                            fix_route_dialog();
                            xlog("fix_route_dialog");
                        }
                        if (is_method("BYE")) {
                                setflag(1); # do accounting ...
                                #setflag(ACC_FAILED); # ... even if the transaction fails
                        } else if (is_method("INVITE")) {
                                # even if in most of the cases is useless, do RR for
                                # re-INVITEs alos, as some buggy clients do change route set
                                # during the dialog.
                                record_route();
                                xlog("check_fraud");
                        }

                        # route it out to whatever destination was set by loose_route()
                        # in $du (destination URI).
                        route(relay);
                } else {

                        if ( is_method("ACK") ) {
                                if ( t_check_trans() ) {
                                        # non loose-route, but stateful ACK; must be an ACK after
                                        # a 487 or e.g. 404 from upstream server
                                        t_relay();
                                        exit;
                                } else {
                                        # ACK without matching transaction -&gt;
                                        # ignore and discard
                                        exit;
                                }
                        }
                        sl_send_reply("404","Not here");
                }
                exit;



tnx
miha
</font>  
</pre>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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>
      <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>