<!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>ah...so you have preloaded Route - try to take a look at the
      opensips default script to see how the loose_route() function is
      used in normal sequential routing (when you have a TO tag) and in
      a preloaded initial request.<br>
      <br>
      Also I recommend you these short webinars:<br>
      &nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/Webinars#toc12">http://www.opensips.org/Resources/Webinars#toc12</a><br>
      &nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/Webinars#toc9">http://www.opensips.org/Resources/Webinars#toc9</a><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 08/16/2012 08:58 PM, Gomtesh Jain wrote:
    <blockquote
cite="mid:CAFMhgaaGcFhEAf+nRh4dqhdD5L013A7wxo7RNtGDpXMVVZM7cA@mail.gmail.com"
      type="cite">Hi Bogdan,<br>
      &nbsp;&nbsp;&nbsp; I put some more log messages...and found that if there are 2
      routes in INVITE&nbsp; It execute <br>
      <br>
      <font size="1">if (loose_route()) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "HERE OPENSIP CONF Loose Route
        method ($rm) \n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</font><br>
      piece of script and exit.<br>
      <br>
      while In case of 1 route this piece of script&nbsp; does not execute.<br>
      <br>
      Here I give you part of script ....<br>
      <br>
      <br>
      <font size="1">route{<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "HERE OPENSIP CONF STARTS method
        ($rm) \n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header("10")) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("483","Too Many Hops");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (msg:len &gt;=&nbsp; 2048 ) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("513", "Message too big");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nat_uac_test("1")) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix_nated_contact();<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # subsequent messages withing a dialog should take the<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # path determined by record-routing<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (loose_route()) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "HERE OPENSIP CONF Loose Route
        method ($rm) \n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!((to_uri=~"@<a moz-do-not-send="true"
          href="http://208.109.191.123">208.109.191.123</a>")||(to_uri=~"@.+<a
          moz-do-not-send="true" href="http://3clogic.com">3clogic.com</a>")||(src_ip==50.16.212.126)))<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("403", "Relaying not allowed");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that's<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # particularly good if upstream and downstream entities<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # use different transport protocol<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!method=="REGISTER")<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "Before Add Record Route TCP
        OPENSIPS \n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route();<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "Add Record Route TCP OPENSIPS
        \n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
        <br>
        <br>
        Thanx,<br>
        Gomtesh<br>
      </font><br>
      <div class="gmail_quote">On Thu, Aug 16, 2012 at 7:37 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>Well, that means
              your script execution does not get there....try to place
              more xlogs in the beginning of the script to see what's
              the exec path in there.<br>
              <br>
              Regards,<br>
              Bogdan<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 08/16/2012 01:58 PM, Gomtesh Jain
                wrote:
                <blockquote type="cite">Hi Bogdan,<br>
                  &nbsp;&nbsp;&nbsp; I put 2 log messages before and after record_route
                  to make sure it gets executed.<br>
                  But I dont's see those messages in log&nbsp; 1st scenario
                  (2 route headers) while I can see both the message in
                  log in 2nd scenario (1 route header).<br>
                  <br>
                  Here I give INVITE messages in 1st scenario...<br>
                  <br>
                  <font size="1"><br>
                  </font><font><font size="1">INVITE <a
                        moz-do-not-send="true"
                        href="http://sip:aa1@management.3clogic.com:5506"
                        target="_blank">sip:aa1@management.3clogic.com:5506</a>
                      SIP/2.0<br>
                      Via: SIP/2.0/TCP
192.168.3.134:1323;rport;branch=z9hG4bKPj564512b7c47d4f1c91bf69b2616eea18<br>
                      Max-Forwards: 70<br>
                      From: <a moz-do-not-send="true">sip:aa1@management.3clogic.com:5506;tag=9fa0b4f78ee640dba4c6e0522c9c63a8</a><br>
                      To: <a moz-do-not-send="true"
                        href="http://sip:aa1@management.3clogic.com:5506"
                        target="_blank">sip:aa1@management.3clogic.com:5506</a><br>
                      Contact: <a moz-do-not-send="true">&lt;sip:aa1@192.168.3.134:1321;transport=TCP;ob&gt;</a><br>
                      Call-ID: 8ba1014b656e4cdc968bcf4a9c92ae66<br>
                      CSeq: 3514 INVITE<br>
                      <b>Route: <a moz-do-not-send="true">&lt;sip:23.20.79.160:7060;transport=TCP;lr&gt;</a><br>
                        Route: <a moz-do-not-send="true">&lt;sip:208.109.191.105:8060;lr&gt;</a></b><br>
                      Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE,
                      SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS<br>
                      Supported: replaces, 100rel, timer, norefersub<br>
                      Session-Expires: 300<br>
                      Min-SE: 90<br>
                      User-Agent: WebAstra<br>
                      X-Info:
                      normal;;P=;L=;S=Out;A=aa1;CI=;CS=1;PI=1;CP=1<br>
                      Content-Type: application/sdp<br>
                      Content-Length:&nbsp;&nbsp; 259</font><br>
                  </font><br>
                  TCP Proxy fwds ...<br>
                  <font size="1"><br>
                    INVITE <a moz-do-not-send="true"
                      href="http://sip:aa1@management.3clogic.com:5506"
                      target="_blank">sip:aa1@management.3clogic.com:5506</a>
                    SIP/2.0<br>
                    Via: SIP/2.0/UDP
                    23.20.79.160:7060;branch=z9hG4bK9618.b76ba1d3.0;i=fe<br>
                    Via: SIP/2.0/TCP
192.168.3.134:1323;received=115.252.66.182;rport=1323;branch=z9hG4bKPj564512b7c47d4f1c91bf69b2616eea18<br>
                    Max-Forwards: 69<br>
                    From: <a moz-do-not-send="true">sip:aa1@management.3clogic.com:5506;tag=9fa0b4f78ee640dba4c6e0522c9c63a8</a><br>
                    To: <a moz-do-not-send="true"
                      href="http://sip:aa1@management.3clogic.com:5506"
                      target="_blank">sip:aa1@management.3clogic.com:5506</a><br>
                    Contact: <a moz-do-not-send="true">&lt;sip:aa1@115.252.66.182:1323;transport=TCP;ob&gt;</a><br>
                    Call-ID: 8ba1014b656e4cdc968bcf4a9c92ae66<br>
                    CSeq: 3514 INVITE<br>
                    Route: <a moz-do-not-send="true">&lt;sip:208.109.191.105:8060;lr&gt;</a><br>
                    Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE,
                    SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS<br>
                    Supported: replaces, 100rel, timer, norefersub<br>
                    Session-Expires: 300<br>
                    Min-SE: 90<br>
                    User-Agent: WebAstra<br>
                    X-Info: normal;;P=;L=;S=Out;A=aa1;CI=;CS=1;PI=1;CP=1<br>
                    Content-Type: application/sdp<br>
                    Content-Length:&nbsp;&nbsp; 25</font><br>
                  <br>
                  <br>
                  Thanx,<br>
                  Gomtesh<br>
                  <br>
                  <br>
                  <div class="gmail_quote">On Thu, Aug 16, 2012 at 4:05
                    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>You
                          say you do record_route(), but no RR header is
                          added to the request ? this is a bit hard to
                          believe ....are you sure your script ends to
                          the RR function ?<br>
                          <br>
                          Regards,<br>
                        </tt>
                        <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 08/16/2012 01:23 PM, Gomtesh Jain wrote:
                            <blockquote type="cite">Hi Bogdan,<br>
                              &nbsp;&nbsp; I am doing ...<br>
                              <br>
                              &nbsp;if (!method=="REGISTER")<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "Before Add
                              Record Route TCP OPENSIPS \n");<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route();<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "Add Record
                              Route TCP OPENSIPS \n");<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                              <br>
                              in my config .<br>
                              <br>
                              <br>
                              But in 1st scenario it does not add record
                              route .So UA1 tries to send ACK directly
                              to "Other proxy". Which is wrong.<br>
                              <br>
                              <br>
                              &nbsp;While it adds record route in 2nd
                              scenario and all signalling works fine.<br>
                              <br>
                              <br>
                              Thanx,<br>
                              Gomtesh<br>
                              <br>
                              <br>
                              <br>
                              <br>
                              <div class="gmail_quote">On Thu, Aug 16,
                                2012 at 3:43 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;">Hi Gomtesh,
                                  <div><br>
                                    <br>
                                    On 08/14/2012 04:10 PM, Gomtesh Jain
                                    wrote:<br>
                                    <blockquote class="gmail_quote"
                                      style="margin: 0pt 0pt 0pt 0.8ex;
                                      border-left: 1px solid rgb(204,
                                      204, 204); padding-left: 1ex;">
                                      Hi,<br>
                                      <br>
                                      &nbsp; I am running opensips 1.6 as TCP
                                      proxy. I am facing problem when I
                                      use multiple proxy in my N/w.<br>
                                      <br>
                                      &nbsp; UA1------&gt; TCP proxy(opensips
                                      1.6)-------&gt;Other
                                      Proxy--------&gt; UA2<br>
                                      <br>
                                      UA1 adds 2 Route headers in
                                      INVITE.<br>
                                      In this scenario TCP proxy does
                                      not add Record Route in INVITE.<br>
                                    </blockquote>
                                  </div>
                                  How comes ?? don;t you do
                                  record_route() on the opensips ??
                                  <div><br>
                                    <br>
                                    <blockquote class="gmail_quote"
                                      style="margin: 0pt 0pt 0pt 0.8ex;
                                      border-left: 1px solid rgb(204,
                                      204, 204); padding-left: 1ex;"> <br>
                                      <br>
                                      <br>
                                      UA1------&gt; TCP proxy(opensips
                                      1.6)------------&gt; UA2<br>
                                      <br>
                                      UA1 add only 1 Route header.<br>
                                      In this scenario It works fine
                                      with the same conf.<br>
                                    </blockquote>
                                  </div>
                                  What "fine" means ? It means opensips
                                  adds on route &nbsp;? or ?<br>
                                  <br>
                                  Regards,<br>
                                  Bogdan<br>
                                </blockquote>
                              </div>
                              <br>
                            </blockquote>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </blockquote>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
  </body>
</html>