<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi M</tt><tt>ayur,</tt><tt><br>
    </tt><tt><br>
    </tt><tt>The simplest way to debug this is by using the
      script_trace() func</tt><tt>tion - see:</tt><tt><br>
    </tt><tt>   
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43">http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43</a></tt><tt><br>
    </tt><tt><br>
    </tt><tt>Simply add in the very begging o</tt><tt>f your script:</tt><tt><br>
    </tt><tt>    </tt><tt>script_trace( 1, "$rm from $si,
      ruri=$ru/$du", "LB");</tt><tt><br>
    </tt>
    <pre>and make a call - see the execution trace through the script for your INVITE.

Regards,
</pre>
    <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>
OpenSIPS Summit 2018
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
    <div class="moz-cite-prefix">On 01/15/2018 07:23 PM, Mayur Koshal
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAEbxXW4dASOgaTnPA670sc7m=D54fxhzTCu2HR6a5yhZ9PehQ@mail.gmail.com">
      <div dir="ltr">Hi Bogdan,
        <div><br>
        </div>
        <div>Thanks for your time and looking into this.</div>
        <div><br>
        </div>
        <div>I am using the Load balancer script which is generated from
          the menuconfig as it is. The script was generated after I
          compiled and build opensips . Did not made much changes to it.</div>
        <div><br>
        </div>
        <div>Need to find out the reason why it is looping inside LB and
          not forwarding it to Proxy.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards</div>
        <div>Mayur</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div> </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Jan 15, 2018 at 10:43 PM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a
              href="mailto:bogdan@opensips.org" target="_blank"
              moz-do-not-send="true">bogdan@opensips.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi MAyur,<br>
            <br>
            Your trance does not show the INVITE being route outside the
            LB (.19). Even more there is a "Too many hops reply" back,
            suggesting that a loop is created on the LB and the INVITE
            is never sent to the destination (but keep re-routed back to
            LB).<br>
            <br>
            When you do t_relay() in your script, place before it an
            xlog to see the destinations:<br>
            xlog("sending out request to $ru/$du\n");<span class="im
              HOEnZb"><br>
              <br>
              Regards,<br>
              <br>
              Bogdan-Andrei Iancu<br>
              <br>
              OpenSIPS Founder and Developer<br>
                <a href="http://www.opensips-solutions.com"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a><br>
              OpenSIPS Summit 2018<br>
                <a
                href="http://www.opensips.org/events/Summit-2018Amsterdam"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips.org/events<wbr>/Summit-2018Amsterdam</a><br>
              <br>
            </span>
            <div class="HOEnZb">
              <div class="h5">
                On 01/12/2018 07:36 PM, Mayur Koshal wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  Hi Bogdan,<br>
                  <br>
                  Thanks for the Reply.<br>
                  <br>
                  Yes The opensips load balancer is able to reach
                  destinations which is<br>
                  configured in the load balancer table as I can see in
                  the wireshark<br>
                  logs and opensips logs of the SIP Proxy server.<br>
                  <br>
                  <br>
                  <br>
                  <br>
                  I have removed one SIP proxy in the table and the load
                  distribution<br>
                  table looks like :<br>
                  <br>
                  mysql> select * from load_balancer;<br>
                  | id | group_id | dst_uri                  | resources
                  | probe_mode |<br>
                  description |<br>
                  +----+----------+-------------<wbr>-------------+-----------+----<wbr>--------+-------------+<br>
                  |  2 |        1 | sip:<a
                    href="http://192.168.100.187:5060" rel="noreferrer"
                    target="_blank" moz-do-not-send="true">192.168.100.187:5060</a>
                  | sip=50    |          0 |<br>
                  serv1       |<br>
                  +----+----------+-------------<wbr>-------------+-----------+----<wbr>--------+-------------+<br>
                  <br>
                  <br>
                  Now I am using the setup with only one sip proxy to
                  make it simpler as :<br>
                  <br>
                  UAC(192.168.100.19:5065)......<wbr>.>Load_Balancer(192.168.100.19<wbr>:5060)......>Proxy(192.168.100<wbr>.187:5060)..........><br>
                    UAS(192.168.187:5070)<br>
                  <br>
                  <br>
                  I have added a user in Load Balancer:<br>
                  <br>
                  <a href="http://sip:bharti@192.168.100.187:5070"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.187:507<wbr>0</a><br>
                  <br>
                  <br>
                  <br>
                  Database changed<br>
                  mysql> select * from location;<br>
                  +-----+----------+--------+---<wbr>------------------------------<wbr>+----------+------+-----------<wbr>----------+------+------------<wbr>---------------------+------+-<wbr>--------------------+-------+-<wbr>-------+--------------------+-<wbr>-------+---------+------------<wbr>--+<br>
                  | id  | username | domain | contact                   
                       | received<br>
                  | path | expires             | q    | callid<br>
                  | cseq | last_modified       | flags | cflags |
                  user_agent         |<br>
                  socket | methods | sip_instance |<br>
                  +-----+----------+--------+---<wbr>------------------------------<wbr>+----------+------+-----------<wbr>----------+------+------------<wbr>---------------------+------+-<wbr>--------------------+-------+-<wbr>-------+--------------------+-<wbr>-------+---------+------------<wbr>--+<br>
                  | 272 | bharti   |        | <a
                    href="http://sip:bharti@192.168.100.187:5070"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.187:507<wbr>0</a>
                  | NULL<br>
                  | NULL | 1970-01-01 05:30:00 | 1.00 |
                  <a class="moz-txt-link-abbreviated" href="mailto:dfjrewr12386fd6-343@opensips.m">dfjrewr12386fd6-343@opensips.m</a><wbr>i<br>
                  |    1 | 1970-01-01 05:30:00 |     0 |      0 |
                  OpenSIPS MI Server |<br>
                  NULL   |    NULL | NULL         |<br>
                  +-----+----------+--------+---<wbr>------------------------------<wbr>+----------+------+-----------<wbr>----------+------+------------<wbr>---------------------+------+-<wbr>--------------------+-------+-<wbr>-------+--------------------+-<wbr>-------+---------+------------<wbr>--+<br>
                  1 row in set (0.01 sec)<br>
                  ------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>----------<br>
                  <br>
                  <br>
                  I am using commands in sipp:<br>
                  <br>
                  UAC ---./sipp -sn uac <a
                    href="http://192.168.100.19:5060" rel="noreferrer"
                    target="_blank" moz-do-not-send="true">192.168.100.19:5060</a>
                  -s bharti -i 192.168.100.19<br>
                  -p 5065 -m 10 -r 1 -rp 1000<br>
                  <br>
                  UAS -- ./sipp -sn uas <a
                    href="http://192.168.100.19:5060" rel="noreferrer"
                    target="_blank" moz-do-not-send="true">192.168.100.19:5060</a>
                  -i 192.168.100.187 -p 5070<br>
                  <br>
                  <br>
                  If I remove the load balancer and execute similar sipp
                  commands and<br>
                  run a single call, it is successfull.<br>
                  <br>
                  <br>
                  <br>
                  Logs at Load_Balancer:<br>
                  ------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-------------------------<br>
                  Jan 11 18:13:17 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[5375]:
                  Inside main route loop<br>
                  LoadBalance<br>
                  Jan 11 18:13:17 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[5376]:
                  Inside failure_route<br>
                  GW_FAILOVER<br>
                  Jan 11 18:13:17 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[5352]:
                  message repeated 2<br>
                  times: [ Inside main route loop LoadBalance]<br>
                  Jan 11 18:13:17 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[5352]:
                  Inside failure_route<br>
                  GW_FAILOVER<br>
                  Jan 11 18:13:17 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[5352]:
                  Inside main route loop<br>
                  LoadBalance<br>
                  ------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------------------<br>
                  <br>
                  Logs At OPensips Proxy :<br>
                  <br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16743]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16725]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16731]:
                  new branch at<br>
                  <a href="http://sip:bharti@192.168.100.19:5060"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.19:5060</a><br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16731]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16721]:
                  new branch at<br>
                  <a href="http://sip:bharti@192.168.100.19:5060"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.19:5060</a><br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16721]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16722]:
                  new branch at<br>
                  <a href="http://sip:bharti@192.168.100.19:5060"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.19:5060</a><br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16722]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16728]:
                  incoming reply<br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16737]:
                  new branch at<br>
                  <a href="http://sip:bharti@192.168.100.19:5060"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sip:bharti@192.168.100.19:5060</a><br>
                  Jan 11 18:13:18 stack-VirtualBox<br>
                  /usr/local/opensips_proxy/sbin<wbr>/opensips[16737]:
                  incoming reply<br>
                  ------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------<br>
                  <br>
                  Regards<br>
                  Mayur<br>
                  <br>
                  On Tue, Jan 9, 2018 at 7:59 PM, Bogdan-Andrei Iancu
                  <<a href="mailto:bogdan@opensips.org"
                    target="_blank" moz-do-not-send="true">bogdan@opensips.org</a>>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Hi,<br>
                    <br>
                    Are you sure the OpenSIPS LB is able to reach via
                    SIP the destinations you<br>
                    configured in the LB table ? Run a single call (with
                    sipp) and make a<br>
                    network capture to understand how the call is
                    routed.<br>
                    <br>
                    Regards,<br>
                    <br>
                    Bogdan-Andrei Iancu<br>
                    <br>
                    OpenSIPS Founder and Developer<br>
                       <a href="http://www.opensips-solutions.com"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://www.opensips-<wbr>solutions.com</a><br>
                    OpenSIPS Summit 2018<br>
                       <a
                      href="http://www.opensips.org/events/Summit-2018Amsterdam"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://www.opensips.org/event<wbr>s/Summit-2018Amsterdam</a><br>
                    <br>
                    <br>
                    On 01/08/2018 06:08 PM, Mayur Koshal wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      Reposting the setup part  as was not visible
                      clearly  in the previous<br>
                      mail.<br>
                      <br>
                      <br>
                      My setup is like :<br>
                      <br>
                      <br>
                                                                       
                          ---------><br>
                      Opensips Proxy 1 ---->  UAS 1<br>
                      <br>
                          UAC   -----> Load Balancer<br>
                                                                       
                          --------> Opensips<br>
                      Proxy 2 -----> UAS 2<br>
                      <br>
                      Regards<br>
                      Mayur<br>
                      <br>
                      On Mon, Jan 8, 2018 at 9:16 PM, Mayur Koshal <<a
                        href="mailto:mayurkoshal@gmail.com"
                        target="_blank" moz-do-not-send="true">mayurkoshal@gmail.com</a>><br>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        Hi Everyone,<br>
                        <br>
                        <br>
                        <br>
                        I have configured and build opensips as a Load
                        Balancer but am not<br>
                        able to make it work.<br>
                        <br>
                        Not able to figure out where the problem is ?<br>
                        <br>
                        Request your help in resolving the issue ..<br>
                        <br>
                        <br>
                        <br>
                        My setup is like :<br>
                        <br>
                        <br>
                                                                       
                              ---------><br>
                        Opensips Proxy 1 ---->  UAS 1<br>
                        <br>
                            UAC   -----> Load Balancer<br>
                                                                       
                              --------> Opensips<br>
                        Proxy 2 -----> UAS 2<br>
                        <br>
                        <br>
                        <br>
                            where  UAC             = 192.168.100.18<br>
                                  Load Balancer    = <a
                          href="http://192.168.100.18:5060"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.18:5060</a><br>
                                  OPensips Proxy 1 = <a
                          href="http://192.168.100.194:5060"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.194:5060</a><br>
                                  Opensips Proxy 2 = <a
                          href="http://192.168.100.187:5060"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.187:5060</a><br>
                                sipp UAS 1         = <a
                          href="http://192.168.100.194:5080"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.194:5080</a><br>
                                sipp UAS 2         = <a
                          href="http://192.168.100.187:5080"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.187:5080</a><br>
                        <br>
                        <br>
                        <br>
                        I use the below sipp command for<br>
                        <br>
                        Sipp UAC Command : ./sipp -sn uac -rsa <a
                          href="http://192.168.100.18:5060"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.18:5060</a><br>
                        <a href="http://192.168.100.194:5080"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.194:5080</a><br>
                        Sipp UAS1  Command : ./sipp -sn uas<br>
                        <br>
                        When I bypass the load balancer and use sipp to
                        test opensips proxy it<br>
                        works fine.<br>
                        <br>
                        When I run the Load Balancer I can see in the
                        wireshark logs as: ICMP<br>
                        590 Destination unreachable (Port unreachable).<br>
                        <br>
                        In the opensips logs it goes to the failure
                        route and displays message<br>
                        Failed trunk <a href="http://192.168.100.194/"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">192.168.100.194/</a><null>
                        detected.<br>
                        <br>
                        <br>
                        <br>
                        <br>
                        The load distribution table I am using is as
                        below :<br>
                        <br>
                        mysql> select * from load_balancer;<br>
                        <br>
                        +----+----------+-------------<wbr>--------+-----------+---------<wbr>---+-------------+<br>
                        | id | group_id | dst_uri             |
                        resources | probe_mode |<br>
                        description |<br>
                        <br>
                        +----+----------+-------------<wbr>--------+-----------+---------<wbr>---+-------------+<br>
                        |  1 |        1 | <a class="moz-txt-link-freetext" href="sip:192.168.100.194">sip:192.168.100.194</a> | sip=64 
                          |          0 | Server1<br>
                        |<br>
                        |  2 |        1 | <a class="moz-txt-link-freetext" href="sip:192.168.100.187">sip:192.168.100.187</a> | sip=64 
                          |          0 | Server2<br>
                        |<br>
                        <br>
                        +----+----------+-------------<wbr>--------+-----------+---------<wbr>---+-------------+<br>
                        2 rows in set (0.00 sec)<br>
                        <br>
                        <br>
                        The load balancer script, Proxy script, Load
                        balancer logs are below.<br>
                        <br>
                        <br>
                        Load Balancer Script :<br>
                        <br>
                        <br>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
                <br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>