Hi Bogdan,<br> <br>  Thanks for your reply. The answer to both your questions is yes. Sample of OK and ACK at the caller as follows: <br><br>#<br>U 2012/11/01 11:19:02.006375 X.X.X.206:5060 -&gt; X.X.X.23:5080<br>SIP/2.0 200 OK.<br>
<span style="color:rgb(51,51,255)">Record-Route: &lt;sip:X.X.X.8;lr&gt;, &lt;sip:X.X.X.206;lr;ftag=31168SIPpTag001;did=0ec.de85e9a&gt;.</span><br>Via: SIP/2.0/UDP X.X.X.23:5080;branch=z9hG4bK-31168-1-0.<br>From: sipp &lt;sip:sipp@X.X.X.23:5080&gt;;tag=31168SIPpTag001.<br>
To: sut &lt;sip:service@X.X.X.5:5070&gt;;tag=30500SIPpTag011.<br>Call-ID: 1-31168@X.X.X.23.<br>CSeq: 1 INVITE.<br>Contact: &lt;sip:X.X.X.5:5070;transport=UDP&gt;.<br>Content-Type: application/sdp.<br>Content-Length:   137.<br>
.<br>v=0.<br>o=user1 53655765 2353687637 IN IP4 X.X.X.5.<br>s=-.<br>c=IN IP4 X.X.X.5.<br>t=0 0.<br>m=audio 6000 RTP/AVP 0.<br>a=rtpmap:0 PCMU/8000.<br><br>#<br>U 2012/11/01 11:19:02.006514 X.X.X.23:5080 -&gt; X.X.X.206:5060<br>
ACK sip:X.X.X.5:5070;transport=UDP SIP/2.0.<br><span style="color:rgb(51,51,255)">Record-Route:  &lt;sip:X.X.X.206;lr;ftag=31168SIPpTag001;did=0ec.de85e9a&gt;,&lt;sip:X.X.X.8;lr&gt;.</span><br>Via: SIP/2.0/UDP X.X.X.23:5080;branch=z9hG4bK-31168-1-5.<br>
From: sipp &lt;sip:sipp@X.X.X.23:5080&gt;;tag=31168SIPpTag001.<br>To: sut &lt;sip:service@X.X.X.5:5070&gt;;tag=30500SIPpTag011.<br>Call-ID: 1-31168@X.X.X.23.<br>CSeq: 1 ACK.<br>Contact: sip:sipp@X.X.X.23:5080.<br>Max-Forwards: 70.<br>
Subject: Performance Test.<br>Content-Length: 0.<br>.<br><br>Thanks, <br>Nilanjan. <br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 10:29 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    <tt>Hi Nilanjan,<br>
      <br>
      Check in the trace if :<br>
      1) the 200 OK getting back to the caller has 2 RR headers (one
      from Proxy and one from LB).<br>
      <br>
      2) the ACK from caller (before LB) has 2 Route headers, one
      pointing to LB, next to Proxy.<br>
      <br>
      Regards,</tt><div class="im"><br>
    <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
    <br></div><div><div class="h5">
    On 11/09/2012 05:01 PM, Nilanjan Banerjee wrote:
    <blockquote type="cite">Hi Bogdan,<br>
      <br>
        Thanks a lot for your suggestion and sorry for the delay in
      getting back with this...I tried the following configuration as
      you have suggested for the Load Balancer and the Proxy: <br>
      <br>
      ______________<br>
      Load Balancer: <br>
      ______________<br>
      <br>
      route{<br>
              if (!mf_process_maxfwd_header(&quot;3&quot;)) {<br>
                      sl_send_reply(&quot;483&quot;,&quot;looping&quot;);<br>
                      exit;<br>
              }<br>
      <br>
              if (!has_totag()) {<br>
                      # initial request<br>
                      record_route();<br>
              } else {<br>
                      # sequential request -&gt; obey Route indication<br>
                      loose_route();<br>
                      t_relay();<br>
                      exit;<br>
              }<br>
      <br>
              # detect resources and do load balancing<br>
      <br>
               load_balance(&quot;1&quot;,&quot;sc&quot;);<br>
      <br>
              # LB function returns negative if no suitable destination
      (for requested resources) is found,<br>
              # or if all destinations are full<br>
              if ($retcode&lt;0) {<br>
                   sl_send_reply(&quot;500&quot;,&quot;Service full&quot;);<br>
                   exit;<br>
              }<br>
      <br>
              xlog(&quot;Selected destination is: $du\n&quot;);<br>
      <br>
              # send it out<br>
              if (!t_relay()) {<br>
                      sl_reply_error();<br>
              }<br>
      }<br>
      <br>
      ______<br>
      Proxy<br>
      ______<br>
      <br>
      route{<br>
      <br>
              if (!has_totag()) {<br>
                      # initial request<br>
                      record_route();<br>
              } else {<br>
                      # sequential request -&gt; obey Route indication<br>
                      loose_route();<br>
              }<br>
      <br>
              if (!t_relay()) {<br>
                   #   xlog(&quot;L_ERR&quot;,&quot;sl_reply_error\n&quot;);<br>
                      sl_reply_error();<br>
              }<br>
      <br>
      }<br>
      <br>
      However, I am still getting the same error - basically the ACK and
      the BYE messages are skipping the Proxy and the response to the
      BYE is sent to the Proxy. Here are the sample ACK and BYE for the
      following setup I am using:<br>
      <br>
      X.X.X.23:5080 --&gt; X.X.X.206:5060 --&gt; X.X.X.8:5060 --&gt;
      X.X.X.5:5070<br>
      (sipp UAC)       --&gt; (Load Balancer) --&gt;  (Proxy)        
      --&gt; (sipp UAS)<br>
      <br>
      #<br>
      U 2012/11/01 11:19:22.901990 X.X.X.206:5060 -&gt; X.X.X.5:5070<br>
      ACK <a>sip:X.X.X.5:5070;transport=UDP</a> SIP/2.0.<br>
      Record-Route: 
<a>&lt;sip:X.X.X.206;lr;ftag=31168SIPpTag005;did=9d.087b203&gt;</a>,<a>&lt;sip:X.X.X.8;lr&gt;</a>.<br>
      Via: SIP/2.0/UDP X.X.X.206;branch=z9hG4bK0112.20fe162.2.<br>
      Via: SIP/2.0/UDP X.X.X.23:5080;branch=z9hG4bK-31168-5-5.<br>
      From: sipp <a>&lt;sip:sipp@X.X.X.23:5080&gt;</a>;tag=31168SIPpTag005.<br>
      To: sut <a>&lt;sip:service@X.X.X.5:5070&gt;</a>;tag=30500SIPpTag015.<br>
      Call-ID: <a href="mailto:5-31168@X.X.X.23" target="_blank">5-31168@X.X.X.23</a>.<br>
      CSeq: 1 ACK.<br>
      Contact: <a>sip:sipp@X.X.X.23:5080</a>.<br>
      Max-Forwards: 69.<br>
      Subject: Performance Test.<br>
      Content-Length: 0.<br>
      .<br>
      <br>
      #<br>
      U 2012/11/01 11:19:22.934118 X.X.X.23:5080 -&gt; X.X.X.206:5060<br>
      BYE <a>sip:X.X.X.5:5070;transport=UDP</a> SIP/2.0.<br>
      Record-Route: 
<a>&lt;sip:X.X.X.206;lr;ftag=31168SIPpTag001;did=0ec.de85e9a&gt;</a>,<a>&lt;sip:X.X.X.8;lr&gt;</a>.<br>
      Via: SIP/2.0/UDP X.X.X.23:5080;branch=z9hG4bK-31168-1-7.<br>
      From: sipp <a>&lt;sip:sipp@X.X.X.23:5080&gt;</a>;tag=31168SIPpTag001.<br>
      To: sut <a>&lt;sip:service@X.X.X.5:5070&gt;</a>;tag=30500SIPpTag011.<br>
      Call-ID: <a href="mailto:1-31168@X.X.X.23" target="_blank">1-31168@X.X.X.23</a>.<br>
      CSeq: 2 BYE.<br>
      Contact: <a>sip:sipp@X.X.X.23:5080</a>.<br>
      Max-Forwards: 70.<br>
      Subject: Performance Test.<br>
      Content-Length: 0.<br>
      .<br>
      <br>
      Looks like the loose routing for the messages after the initial
      requests is not happening properly according to the Record-Route
      header. Not sure, if I am doing things right in the client side
      while introducing the Record-Route header - hence attaching the
      modified sipp uac and uas I am using. <br>
      <br>
      Would greatly appreciate your time and help if you could please
      throw some light into this matter. <br>
      <br>
      Thanks,<br>
      Nil.   <br>
      <br>
      <br>
      <div class="gmail_quote">On Thu, Oct 25, 2012 at 7:30 PM,
        Bogdan-Andrei Iancu <span dir="ltr">&lt;<a 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>Hi Nil,<br>
              <br>
              Seems the problem is in the proxy, where you do not do RR
              at all.<br>
              <br>
              Try <br>
              <br>
            </tt>____________<br>
            <br>
            Proxy:<br>
            ____________<br>
            <br>
            route{
            <div><br>
                      if (!has_totag()) {<br>
                              # initial request<br>
                              record_route();<br>
                      } else {<br>
                              # sequential request -&gt; obey Route
              indication<br>
                              loose_route();<br>
                      }<br>
              <br>
            </div>
            <div>         if (!t_relay()) {<br>
                           #   xlog(&quot;L_ERR&quot;,&quot;sl_reply_error\n&quot;);<br>
                              sl_reply_error();<br>
                      }<br>
              }<br>
              <br>
            </div>
            <div><tt><br>
                Regards,<br>
              </tt>
              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              <br>
            </div>
            <div>
              <div> On 10/22/2012 02:25 PM, Nilanjan Banerjee
                wrote:
                <blockquote type="cite">Thanks Bogdan for taking time to
                  respond to my post. I think you have guessed it right,
                  I am using the sample routing script given in the Load
                  Balancer (LB) tutorial and that is most likely sending
                  the ACK and BYE messages directly to Client 2
                  bypassing the Proxy. The routing code snippets I am
                  using at the LB and the Proxy are shown below. Could
                  you please tell me what&#39;s going wrong over here? I am
                  using record route support at both the clients.
                  Alternatively if you could please tell me what should
                  go in the routing blocks of the LB and the Proxy so
                  that all the messages go through the LB and the Proxy
                  then that will be of immense help too. <br>
                  <br>
                  Regards,<br>
                  Nil. <br>
                  <br>
                  ____________<br>
                  <br>
                  Load Balancer:<br>
                  ____________<br>
                  <br>
                  route{<br>
                          if (!mf_process_maxfwd_header(&quot;3&quot;)) {<br>
                                  sl_send_reply(&quot;483&quot;,&quot;looping&quot;);<br>
                                  exit;<br>
                          }<br>
                  <br>
                          if (!has_totag()) {<br>
                                  # initial request<br>
                                  record_route();<br>
                          } else {<br>
                                  # sequential request -&gt; obey Route
                  indication<br>
                                  loose_route();<br>
                                  t_relay();<br>
                                  exit;<br>
                          }<br>
                  <br>
                          # detect resources and do balancing<br>
                  <br>
                           load_balance(&quot;1&quot;,&quot;sc&quot;);<br>
                  <br>
                  <br>
                          # LB function returns negative if no suitable
                  destination (for requested resources) is found,<br>
                          # or if all destinations are full<br>
                          if ($retcode&lt;0) {<br>
                               sl_send_reply(&quot;500&quot;,&quot;Service full&quot;);<br>
                               exit;<br>
                          }<br>
                  <br>
                          xlog(&quot;Selected destination is: $du\n&quot;);<br>
                  <br>
                          # send it out<br>
                          if (!t_relay()) {<br>
                                  sl_reply_error();<br>
                          }<br>
                  }<br>
                  <br>
                  ____________<br>
                  <br>
                  Proxy:<br>
                  ____________<br>
                  <br>
                  route{<br>
                  record_route();<br>
                          if (!t_relay()) {<br>
                               #   xlog(&quot;L_ERR&quot;,&quot;sl_reply_error\n&quot;);<br>
                                  sl_reply_error();<br>
                          }<br>
                  }<br>
                  <br>
                  <br>
                  <div class="gmail_quote">On Sun, Oct 21, 2012 at 7:39
                    PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a 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>Hi
                          Nil,<br>
                          <br>
                          I wild guess is you are not correctly do
                          &quot;loose_route&quot; on the LB, so instead of
                          following the Route (to OpenSIPS Proxy), it
                          goes directly to end destination in RURI
                          (Client 2).<br>
                          <br>
                          Of course, I assume that all parties (LB +
                          Proxy) do record_route() for the call, right ?<br>
                          <br>
                          Regards,<br>
                        </tt>
                        <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                        <div>
                          <div> <br>
                            On 10/21/2012 10:09 AM, Nilanjan Banerjee
                            wrote: </div>
                        </div>
                        <blockquote type="cite">
                          <div>
                            <div>Hello,<br>
                              <br>
                                I am trying to build the following setup
                              using OpenSIPS load balancer and the proxy
                              functionality: <br>
                              <br>
                              Client 1 (sipp) &lt;----&gt; OpenSIPS Load
                              Balancer &lt;----&gt; OpenSIPS Proxy
                              &lt;----&gt; Client 2 (sipp)<br>
                              <br>
                              At the client ends I am using the
                              following commands:<br>
                              <br>
                              Client 1: sipp -sn uac -rsa [Load Balancer
                              Address] [Client 2 Address]<br>
                              <br>
                              Client 2: sipp -sn uas <br>
                              <br>
                              The Load Balancer is configured with a
                              destination as the OpenSIPS Proxy and the
                              Proxy is configured to simply forward the
                              SIP messages based on IP address (using
                              only forward(); in the routing block). <br>
                              <br>
                              Now everything (INVITE, OK and ACK
                              messages) works fine except the BYE
                              messages that are getting forwarded by the
                              Load Balancer directly to Client 2 unlike
                              the INVITE, OK and ACK messages that
                              traverse the Proxy. Client 2 however,
                              sends the OK to the BYE to the OpenSIPS
                              Proxy. Since the BYE messages do not
                              traverse the Proxy, the OK to the BYE
                              messages are getting retransmitted
                              repeatedly by Client 2 and the sessions
                              are not getting terminated properly. How
                              do I make the BYE messages to go through
                              the Proxy or the OK message sent directly
                              to the Load Balancer so that the
                              retransmissions do not happen and the
                              sessions get terminated properly?<br>
                              <br>
                              [NB: When the Load Balancer is taken out
                              of the loop and the Proxy configuration is
                              kept the same, all the SIP messages
                              traverses the Proxy and everything works
                              fine i.e., the BYE and the OKs to the BYEs
                              are handled properly and sessions get
                              terminated properly.]<br>
                              <br>
                              Would greatly appreciate any help in this
                              matter. Thanks in advance. <br>
                              <br>
                              Nil. </div>
                          </div>
                          <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a 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>
                </blockquote>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
  </div></div></div>

</blockquote></div><br>