<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <tt>It seems the PATH value is properly processed by the
      next_branch() function - it is simply pushed into the message, but
      it is not used to extract the next destination.<br>
      <br>
      I made a small fix - see the attached patch - please apply it and
      let me know if it did the trick for you.<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>
    <br>
    On 06/11/2012 03:45 PM, Gomtesh Jain wrote:
    <blockquote
cite="mid:CAFMhgabUX+OFaXz=Wj50-Md68JbrdJg66Un9Yoms4vUV900CxQ@mail.gmail.com"
      type="cite">
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: &nbsp;ERROR RESPONSE MATCHED &nbsp;method
        (INVITE) r-uri (&lt;null&gt;) :callID
        ZjUwZTkzMWI5ZjRjNDNjNDc1MGRhZDVmZjM3ZmY0YmQ. :CSeq 1</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_headers: via
        found, flags=22</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:<b>next_branches</b>:
        Msg information
&lt;<a class="moz-txt-link-freetext" href="sip:855_1_7agentsURI@122.177.144.180:2043;transport=TCP,sip:50.16.212.126:8060;lr">sip:855_1_7agentsURI@122.177.144.180:2043;transport=TCP,sip:50.16.212.126:8060;lr</a>,<a class="moz-txt-link-rfc2396E" href="sip:50.16.212.126:8060;lr">&lt;sip:50.16.212.126:8060;lr&gt;</a>,-1,0&gt;</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_headers:
        parse_headers: this is the second via</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: &nbsp;ON FAILURE BLOCK &nbsp;method
        (INVITE) r-uri (&lt;null&gt;) :callID
        ZjUwZTkzMWI5ZjRjNDNjNDc1MGRhZDVmZjM3ZmY0YmQ. :CSeq 1</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_to_param:
        tag=7963038936cb090485262a576bc5dd22-8eae</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:check_ip_address:
        params 122.177.144.180, 192.168.3.128, 0</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_to: end of
        header reached, state=29</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:parse_headers:
        flags=80</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_to:
        display={"855_1_7agentsURI"}, ruri={<a moz-do-not-send="true"
          href="http://sip:855_1_7agentsURI@management.3clogic.com:5506">sip:855_1_7agentsURI@management.3clogic.com:5506</a>}</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: &nbsp;IN ROUTE BLOCK method (INVITE)
        r-uri (&lt;null&gt;) :callID
        ZjUwZTkzMWI5ZjRjNDNjNDc1MGRhZDVmZjM3ZmY0YmQ.</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:get_hdr_field:
        &lt;To&gt; [112]; uri=[<a moz-do-not-send="true"
          href="http://sip:855_1_7agentsURI@management.3clogic.com:5506">sip:855_1_7agentsURI@management.3clogic.com:5506</a>]</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:mk_proxy: doing DNS
        lookup...</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:get_hdr_field: to body
        ["855_1_7agentsURI"&lt;<a moz-do-not-send="true"
          href="http://sip:855_1_7agentsURI@management.3clogic.com:5506">sip:855_1_7agentsURI@management.3clogic.com:5506</a>&gt;]</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:get_send_socket:
        force_send_socket of different proto (2)!</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:get_hdr_field: cseq
        &lt;CSeq&gt;: &lt;1&gt; &lt;INVITE&gt;</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:parse_headers:
        flags=2000</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18490]: DBG:core:parse_headers: flags=8</div>
      <div>Jun &nbsp;8 11:40:03 ip-10-122-214-174
        /usr/local/sbin/opensips[18488]: DBG:core:tcp_send: no open tcp
        connection found, opening new one</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Thanx,</div>
      <div>Gomtesh</div>
      <div><br>
      </div>
      <br>
      <div class="gmail_quote">On Mon, Jun 11, 2012 at 5:53 PM,
        Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:bogdan@opensips.org"
            target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div bgcolor="#ffffff" text="#000000"> <tt>I see.....Seems
              ok.<br>
              <br>
              could you post the logs from next_branches() - it outputs
              similar logs about the data pushed back into message.<br>
              <br>
              Regards,<br>
            </tt>
            <div class="im">
              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              <br>
            </div>
            <div>
              <div class="h5"> On 06/11/2012 03:07 PM, Gomtesh Jain
                wrote:
                <blockquote type="cite">
                  <div><br>
                  </div>
                  <div>Hi Bogdan,</div>
                  <div>&nbsp; &nbsp; &nbsp; When I do&nbsp;serialize_branches(1) after look
                    up , I can see both the contacts in logs with proper
                    PATH values (<b><a moz-do-not-send="true"
                        href="http://50.16.212.126:8060" target="_blank">50.16.212.126:8060</a></b>).</div>
                  <div>But It process 1st contact properly but after
                    next_branches() it does not process 2nd branch
                    properly . It does not add&nbsp;<b>50.16.212.126:8060;lr
                    </b>as route.</div>
                  <div><br>
                  </div>
                  <div>
                    <div>Jun &nbsp;8 11:39:55 ip-10-122-214-174
                      /usr/local/sbin/opensips[18491]: DBG:core:<b>serialize_branches:

                        Msg information
                        &lt;<a moz-do-not-send="true">sip:855_1_7agentsURI@115.252.66.182:3912;transport=TCP,sip:50.16.212.126:8060;lr</a>,<a
                          moz-do-not-send="true">&lt;sip:50.16.212.126:8060;lr&gt;</a>,-1,0&gt;</b></div>
                    <div>Jun &nbsp;8 11:39:55 ip-10-122-214-174
                      /usr/local/sbin/opensips[18490]:
                      DBG:core:parse_headers: via found, flags=2</div>
                    <div>Jun &nbsp;8 11:39:55 ip-10-122-214-174
                      /usr/local/sbin/opensips[18491]: DBG:core:<b>serialize_branches:

                        Branch information
                        &lt;<a moz-do-not-send="true">sip:855_1_7agentsURI@122.177.144.180:2043;transport=TCP,sip:50.16.212.126:8060;lr</a>,<a
                          moz-do-not-send="true">&lt;sip:50.16.212.126:8060;lr&gt;</a>,-1,0&gt;</b></div>
                    <div>Jun &nbsp;8 11:39:55 ip-10-122-214-174
                      /usr/local/sbin/opensips[18490]:
                      DBG:core:parse_headers: this is the first via</div>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  Thanx,
                  <div>Gomtesh<br>
                    <br>
                    <div class="gmail_quote">On Mon, Jun 11, 2012 at
                      3:34 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                          moz-do-not-send="true"
                          href="mailto:bogdan@opensips.org"
                          target="_blank">bogdan@opensips.org</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin: 0pt
                        0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                        204, 204); padding-left: 1ex;">
                        <div bgcolor="#ffffff" text="#000000"> Hi
                          Gomtesh,<br>
                          <br>
                          Do your saved contacts contain a PATH field at
                          all ? check with "opensipsctl ul show" to see
                          if the path was stored in usrloc cache.<br>
                          <br>
                          Maybe your problem is not at "lookup" time,
                          but rather at "save" time.<br>
                          <br>
                          Regards,<br>
                          Bogdan<br>
                          <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                          <div>
                            <div> <br>
                              On 06/11/2012 10:56 AM, Gomtesh Jain
                              wrote:<br>
                            </div>
                          </div>
                          <blockquote type="cite">
                            <div>
                              <div>
                                <div class="gmail_quote">Hi ,
                                  <div>&nbsp; &nbsp;I am using opensips 1.6 . I am
                                    facing an issue here . It seems In
                                    faliure route when I do
                                    next_branches() it does not set
                                    value of "path" (from lookup) as
                                    distination/route . Which results ,
                                    opensips try to send message
                                    directly to UA .&nbsp;</div>
                                  <div>&nbsp;&nbsp;</div>
                                  <div>Here I give N/w diagram&nbsp;</div>
                                  <div><br>
                                  </div>
                                  <div>&nbsp;
                                    UA1(115.X.X.X)-------[PROXY]--------|
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |</div>
                                  <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |
                                    Registrar/Opensips &nbsp; |</div>
                                  <div>&nbsp; UA2
                                    (122.x.x.x)--------[PROXY]-------| &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>The issue I am facing is ...</div>
                                  <div>1. On any INVITE to Opensips
                                    after lookup Opensips sends invite
                                    to Proxy&nbsp;</div>
                                  <div>2. On any faliure response in
                                    "Faiure Route"</div>
                                  <div>3. When I do next_branches() it
                                    tries to send INVITE directly to
                                    122.X.X.X .</div>
                                  <div><br>
                                  </div>
                                  <div>-----------------HERE I GIVE
                                    PIECE OF
                                    Opnesips.cfg--------------------</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp;xlog("L_NOTICE",
                                      "SERIALIZE BRANCHES ($rm) r-uri
                                      ($ru) : Contact : $ct &nbsp;:callID $ci
                                      : CSeq $cs \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if
                                      (!serialize_branches(1)){</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      sl_send_reply("500","Unable to
                                      load contacts");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      exit;</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      xlog("L_NOTICE", "PREPARE FIRST
                                      BRANCH ($rm) r-uri ($ru) : Contact
                                      : $ct &nbsp;:callID $ci : CSeq $cs
                                      \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      if (next_branches()){</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      &nbsp; &nbsp; xlog("L_NOTICE", "NEXT BRANCH
                                      After Seri :callID $ci : CSeq $cs
                                      \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      &nbsp; &nbsp; &nbsp; &nbsp; t_on_failure("1");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      }</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      #else{</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      # &nbsp; &nbsp; &nbsp; sl_send_reply("504","Not
                                      found ");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      # &nbsp; &nbsp; &nbsp; exit;</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      #}</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      append_hf("P-hint: lcr
                                      applied\r\n");</div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      append_hf("P-hint: usrloc
                                      applied\r\n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; };</div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; route(1);</div>
                                    <div>}</div>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div>route[1] {</div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; if (nat_uac_test("7"))
                                      {</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      fix_nated_contact();</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; };</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; # send it out now; use
                                      stateful forwarding as it works
                                      reliably</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; # even for UDP2TCP</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; xlog("L_NOTICE", " IN
                                      ROUTE BLOCK method ($rm) r-uri
                                      ($rs) :callID $ci \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; if (!t_relay()) {</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      sl_reply_error();</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; };</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; t_on_reply("1");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
                                    <div>}</div>
                                    <div><br>
                                    </div>
                                    <div>onreply_route[1]{</div>
                                    <div>&nbsp; xlog("L_NOTICE", " ON REPLY
                                      BLOCK &nbsp;method ($rm) r-uri ($rs)
                                      :callID $ci :CSeq $cs \n");</div>
                                    <div>}</div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>failure_route[1] {</div>
                                    <div>&nbsp; &nbsp;if (
                                      t_check_status("404|477|408|486|50[234]")){</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      xlog("L_NOTICE", " ERROR RESPONSE
                                      MATCHED &nbsp;method ($rm) r-uri ($rs)
                                      :callID $ci :CSeq $cs \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (next_branches())</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      xlog("L_NOTICE", " ON FAILURE
                                      BLOCK &nbsp;method ($rm) r-uri ($rs)
                                      :callID $ci :CSeq $cs \n");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                      t_on_failure("1");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; route(1);</div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
                                    <div><br>
                                    </div>
                                    <div>&nbsp; &nbsp; }</div>
                                    <div>}</div>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>-----------------------------------------------------------------------------</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>I attach the log of the call in
                                    debug=9 mode.</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>Please have a look at this if
                                    anyone can help me .</div>
                                  <div><br>
                                  </div>
                                  <div>Thanx,</div>
                                  <div>Gomtesh</div>
                                  <div><br>
                                  </div>
                                </div>
                                <br>
                              </div>
                            </div>
                            <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                          </blockquote>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
  </body>
</html>