<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix"><tt>Hi Kaan,<br>
        <br>
        When you do parallel forking (sending same request to two
        destinations), only one negative reply (from the two branches)
        is sent back to caller (to .11 in your case). You get the 401
        reply on both .3 and .5 branches and OpenSIPS picks one to be
        sent to caller .11 (in SIP only one SIP negative reply per
        request is allowed).<br>
        <br>
        So, from SIP perspective it works ok, but my impression is you
        want something else.<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>
      On 13.10.2014 23:01, Kaan Dandin wrote:<br>
    </div>
    <blockquote
      cite="mid:1413230483.7897.YahooMailNeo@web121502.mail.ne1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:16px">
        <div class="" style="">Hi Bogdan,</div>
        <div class="" style=""><br class="" style="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;">Thanks for the response. I
          have edited the script as you have mentioned but I  have the
          same problem: </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;">401 message going to .3  is
          not passed by .141(opensips lb)</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;"><br class="" style="">
        </div>
        <div class="" style="background-color: transparent;">       
          else if (is_method("REGISTER")) {</div>
        <div class="" style="background-color: transparent;">           
              xlog("xlog_initialregister");</div>
        <div class="" style="background-color: transparent;">           
              if($si=="192.168.2.11") {</div>
        <div class="" style="background-color: transparent;">           
              <span style="background-color: transparent;" class="">$du
            = "sip:192.168.2.3:4060";</span></div>
        <div class="" style="background-color: transparent;">           
              append_branch();</div>
        <div class="" style="background-color: transparent;">           
              $du = "sip:192.168.2.5:4060";</div>
        <div class="" style="background-color: transparent;">           
              t_relay();</div>
        <div class="" style="background-color: transparent;">         
            <span style="background-color: transparent;" class="">   
            exit;</span></div>
        <div class="" style="background-color: transparent;">           
              }</div>
        <div class="" style="background-color: transparent;">        if
          (!t_relay()) {</div>
        <div class="" style="background-color: transparent;">           
              xlog("xlog_route1error");</div>
        <div class="" style="background-color: transparent;">           
              sl_reply_error();</div>
        <div class="" style="background-color: transparent;">        };</div>
        <div class="" style=""><br class="" style="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;"><br class="" style="">
        </div>
        <div class="" style="background-color: transparent;">No.    
          Time        Source                Destination          
          Protocol Info</div>
        <div class="" style="background-color: transparent;">     57
          13.772015   192.168.2.11          192.168.2.141         SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     58
          13.774094   192.168.2.141         192.168.2.5           SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     59
          13.774097   192.168.2.141         192.168.2.3           SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     60
          13.890456   192.168.2.3           192.168.2.141         SIP  
             Status: 401 Unauthorized - Challenging the UE    (0
          bindings)</div>
        <div class="" style="background-color: transparent;">     61
          14.046746   192.168.2.5           192.168.2.141         SIP  
             Status: 401 Unauthorized - Challenging the UE    (0
          bindings)</div>
        <div class="" style="background-color: transparent;">     62
          14.047052   192.168.2.141         192.168.2.11          SIP  
             Status: 401 Unauthorized - Challenging the UE    (0
          bindings)</div>
        <div class="" style="background-color: transparent;">     63
          14.047538   192.168.2.11          192.168.2.141         SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     64
          14.047887   192.168.2.141         192.168.2.5           SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     65
          14.047947   192.168.2.141         192.168.2.3           SIP  
             Request: REGISTER sip:open-ims.test</div>
        <div class="" style="background-color: transparent;">     66
          14.084120   192.168.2.3           192.168.2.141         SIP  
             Status: 401 Unauthorized - Challenging the UE    (0
          bindings)</div>
        <div class="" style="background-color: transparent;">     67
          14.112597   192.168.2.5           192.168.2.141         SIP  
             Status: 200 OK - SAR succesful and registrar saved    (1
          bindings)</div>
        <div class="" style="background-color: transparent;">     68
          14.112755   192.168.2.141         192.168.2.11          SIP  
             Status: 200 OK - SAR succesful and registrar saved    (1
          bindings)</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;"><br class="" style="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;"><br>
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;"><br>
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: xlog method:
          [REGISTER] totag: [&lt;null&gt;] sipid: [192.168.2.11]
          messageid:  [1] callid:  [<a class="moz-txt-link-abbreviated" href="mailto:1-3096@192.168.2.11">1-3096@192.168.2.11</a>] callsequence:
          [2]</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: DBG:uri:has_totag: no
          totag</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: xlog_initialregister</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:core:comp_scriptvar: str 20 : 192.168.2.11</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: DBG:tm:t_newtran:
          transaction on entrance=0xffffffffffffffff</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:core:parse_headers: flags=ffffffffffffffff</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:core:get_hdr_field: content_length=0</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:core:get_hdr_field: found end of header</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:core:parse_headers: flags=78</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:tm:t_lookup_request: start searching: hash=23653, isACK=0</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: DBG:tm:matching_3261:
          RFC3261 transaction matching failed</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:tm:t_lookup_request: no transaction found</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:tm:run_reqin_callbacks: trans=0x7fc6d2b0d9e8, callback
          type 1, id 1 entered</div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]:
          DBG:tm:run_reqin_callbacks: trans=0x7fc6d2b0d9e8, callback
          type 1, id 0 entered</div>
        <div class="" style=""><span class="" style=""></span></div>
        <div class="" style="">Oct 13 12:42:21 ubuntu
          /usr/local/opensips/sbin/opensips[4626]: DBG:core:_shm_resize:
          resize(0) called</div>
        <div class="" style=""><br class="" style="">
        </div>
        <div class="" style=""><br class="" style="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;">Kind regardsi</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
          Arial, 'Lucida Grande', sans-serif; font-style: normal;
          background-color: transparent;">Kaan</div>
        <div style="font-family: HelveticaNeue, Helvetica Neue,
          Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"
          class="">
          <div style="font-family: HelveticaNeue, Helvetica Neue,
            Helvetica, Arial, Lucida Grande, sans-serif; font-size:
            16px;" class="">
            <div dir="ltr" class="" style="">
              <hr class="" style="" size="1"> <font class="" style=""
                size="2" face="Arial"> <b class="" style=""><span
                    style="font-weight:bold;" class="">From:</span></b>
                Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org">&lt;bogdan@opensips.org&gt;</a><br
                  class="" style="">
                <b class="" style=""><span style="font-weight: bold;"
                    class="">To:</span></b> Kaan Dandin
                <a class="moz-txt-link-rfc2396E" href="mailto:kaandandin@yahoo.com">&lt;kaandandin@yahoo.com&gt;</a>; OpenSIPS users mailling
                list <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org">&lt;users@lists.opensips.org&gt;</a> <br class=""
                  style="">
                <b class="" style=""><span style="font-weight: bold;"
                    class="">Cc:</span></b> Gunes Kurt
                <a class="moz-txt-link-rfc2396E" href="mailto:gkurt@itu.edu.tr">&lt;gkurt@itu.edu.tr&gt;</a>; "Ibrahim Hokelek,
                (BİLGEM-UEKAE)" <a class="moz-txt-link-rfc2396E" href="mailto:ibrahim.hokelek@tubitak.gov.tr">&lt;ibrahim.hokelek@tubitak.gov.tr&gt;</a> <br
                  class="" style="">
                <b class="" style=""><span style="font-weight: bold;"
                    class="">Sent:</span></b> Monday, October 13, 2014
                8:05 PM<br class="" style="">
                <b class="" style=""><span style="font-weight: bold;"
                    class="">Subject:</span></b> Re: YNT: Re: YNT: Re:
                YNT: Re: [OpenSIPS-Users] RFC3261 transaction matching
                failed error for the second 401 Unauthorized -
                Challenging the UE<br class="" style="">
              </font> </div>
            <div class="" style=""><br class="" style="">
              <div id="yiv0192417079" class="" style="">
                <div class="" style="">
                  <div class="" style=""><tt class="" style="">Hi Kaan,</tt><tt
                      class="" style=""><br class="" style=""
                        clear="none">
                    </tt><tt class="" style=""><br class="" style=""
                        clear="none">
                    </tt><tt class="" style="">That is completely wrong
                      as you break the transaction logic. The correct
                      way of doing par</tt><tt class="" style="">allel
                      forking is :</tt><tt class="" style=""><br
                        class="" style="" clear="none">
                    </tt><tt class="" style="">    </tt><tt class=""
                      style=""><br class="" style="" clear="none">
                    </tt><tt class="" style="">  if($si=="192.168.2.11")
                      {</tt><tt class="" style=""><br class="" style=""
                        clear="none">
                    </tt><tt class="" style="">    $du = "sip:</tt><tt
                      class="" style=""><span class=""
                        style="background-color:transparent;">192.168.2.3:4060";<br
                          class="" style="" clear="none">
                            append_branch();  # add first destination
                        with the above value<br class="" style=""
                          clear="none">
                            $du = </span></tt><tt class="" style="">"sip:</tt><span
                      class="" style="background-color:transparent;"><tt
                        class="" style="">192.168.2.5:4060";</tt><tt
                        class="" style=""><br class="" style=""
                          clear="none">
                      </tt><tt class="" style="">    t_relay();</tt><tt
                        class="" style=""><br class="" style=""
                          clear="none">
                      </tt><tt class="" style="">  }</tt><tt class=""
                        style=""><br class="" style="" clear="none">
                      </tt><tt class="" style=""><br class="" style=""
                          clear="none">
                      </tt><tt class="" style="">Regards,</tt><br
                        class="" style="" clear="none">
                    </span>
                    <pre class="" style="">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" rel="nofollow" shape="rect" class="" target="_blank" href="http://www.opensips-solutions.com/" style="">http://www.opensips-solutions.com</a></pre>
                  </div>
                </div>
              </div>
              <br class="" style="">
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>