[OpenSIPS-Users] Not able to make Load Balancer work

Mayur Koshal mayurkoshal at gmail.com
Wed Mar 7 12:12:55 EST 2018


Hi Bogdan,

Sorry for the delayed reply.

I resumed to look into this issue after a break and I confirmed that the
invite request is going back and forth between the load balancer and the
proxy. Just to revisit the setup as the IP's got changed :

UAC(192.168.100.21:5065)-------LB (192.168.100.21:5060)------SIP Proxy
(192.168.100.17:5060)------------UAS(192.168.100.17:5080)

sipp commands used :

./sipp -sf uac_mod.xml 192.168.100.21:5060 -s archana -i 192.168.100.21 -p
5065 -r 1 -rp 1000 -m 10

./sipp -sf uas_mod_orig.xml -rsa 192.168.100.21:5060 -i 192.168.100.17 -p
5080

where I have registered user archana in the SIP proxy server .


The problem looks like not a loop within the load balancer but the fact
that the proxy returns the INVITE back to the load balancer instead of
sending it to the server (UAS ).

The LB, when handling the INVITE, properly routes it to the proxy but does
not change the request-uri. The proxy then routes the INVITE according to
the unchanged request-uri which means that it sends it back to the LB.

when I hardcoded the request uri in the Proxy script to the UAS uri I can
see the invite request reaching the UAS.

In the LB script as well as proxy script I could see the record routing of
initial request (INVITE).(Not sure if record routing changes the uri for
initial request as it does for sequential request)

There is some issue in the script either in LB or Proxy which I am not able
to figure out.

Request your help for the same.



The LB and Proxy script snnipets as below :

Load Balancer Script  :
----------------------------------------

route{

    if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit; }

if (has_totag()) {

              # sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
                      # validate the sequential request against dialog
if ( $DLG_status!=NULL && !validate_dialog() ) {
xlog("In-Dialog $rm from $si (callid=$ci) is not valid according to
dialog\n");
## exit;
}
if (is_method("BYE")) {
setflag(ACC_DO); # do accounting ...
setflag(ACC_FAILED); # ... even if the transaction fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
# during the dialog.
                            record_route();
}

# route it out to whatever destination was set by loose_route()
# in $du (destination URI).
route(RELAY);
} else {
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK; must be an ACK after
# a 487 or e.g. 404 from upstream server
                                  t_relay();
exit;
} else {
# ACK without matching transaction ->
# ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}

#### INITIAL REQUESTS

# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans())
t_relay();
exit;
} else if (!is_method("INVITE")) {
send_reply("405","Method Not Allowed");
exit;
}

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

t_check_trans();

# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}

record_route();

setflag(ACC_DO); # do accounting

if ( !load_balance("1","sip")) {

               xlog("\n");
send_reply("500","No Destination available");
exit;
}

      t_on_failure("GW_FAILOVER");

route(RELAY);
}


route[RELAY] {
if (!t_relay()) {
sl_reply_error();
};
exit;
}


failure_route[GW_FAILOVER] {
      if (t_was_cancelled()) {
exit;
}

# failure detection with redirect to next available trunk
if (t_check_status("(408)|([56][0-9][0-9])")) {
xlog("Failed trunk $rd/$du detected \n");

if ( load_balance("1","sip") ) {
t_on_failure("GW_FAILOVER");
t_relay();
exit;
}
send_reply("500","All GW are down");
}
}


local_route {
if (is_method("BYE") && $DLG_dir=="UPSTREAM") {
acc_log_request("200 Dialog Timeout");
}
}


*************************************************

Proxy Script :
----------------



route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

if (has_totag()) {

# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {

      if (is_method("BYE")) {
setflag(1); # do accounting ...
setflag(3); # ... even if the transaction fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
# during the dialog.
                              record_route();
}


# route it out to whatever destination was set by loose_route()
# in $du (destination URI).
                        route(1);
} else {
                      if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK; must be an ACK after
# a 487 or e.g. 404 from upstream server

                                       t_relay();
exit;
} else {
# ACK without matching transaction ->
# ignore and discard
                                      exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}

# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}


        xlog("Outside has to tag  \n");
t_check_trans();


# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}

# record routing
if (!is_method("REGISTER|MESSAGE")){
          record_route();
         }

# account only INVITEs
if (is_method("INVITE")) {

        setflag(1); # do accounting
}

if (!uri==myself) {
append_hf("P-hint: outbound\r\n");
            * $ru = "sip:archana at 192.168.100.17:5080
<http://sip:archana@192.168.100.17:5080>";   # Hard coding*
     route(1);
}

# requests for my domain
if (is_method("PUBLISH|SUBSCRIBE"))
{
sl_send_reply("503", "Service Unavailable");
exit;
}

if (is_method("REGISTER"))
{
# authenticate the REGISTER requests
if (!save("location"))
sl_reply_error();

exit;
}

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}





# do lookup with method filtering
if (!lookup("location","m")) {
if (!db_does_uri_exist()) {
send_reply("420","Bad Extension");
exit;
}
t_newtran();
t_reply("404", "Not Found");
exit;
}


# when routing via usrloc, log the missed calls also
setflag(2);
      route(1);
}


route[1] {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {

t_on_branch("2");
t_on_reply("2");
t_on_failure("1");
}


if (!t_relay()) {
send_reply("500","Internal Error");
};
exit;
}




branch_route[2] {
xlog("new branch at $ru\n");

}


onreply_route[2] {
xlog("incoming reply\n");
}


failure_route[1] {
if (t_was_cancelled()) {
exit;
}

# uncomment the following lines if you want to block client
# redirect based on 3xx replies.
##if (t_check_status("3[0-9][0-9]")) {
##t_reply("404","Not found");
## exit;
##}

}


Regards
Mayur




On Tue, Jan 16, 2018 at 6:55 PM, Mayur Koshal <mayurkoshal at gmail.com> wrote:

> Hi Bogdan ,
>
>
> I will try the script_trace and make a call.
>
> Meanwhile I had put xlogs in the load balancer script to see the
> destination and RURI.
>
> The destination is coming as NULL when I try to make a call using sipp.
> Also error message is seen in the LB logs when the call is executed  :
>
>  ERROR:core:print_rr_body: too many RR
>  ERROR:dialog:get_routing_info: failed to print route records
>
>
> The logs and LB script route snippet is as below :
>
>
>
> Logs_LB :
> ------------------------------------------------------------
> ------------------------------------------------------------
> -------------------------------------------------------------------
>  stack-VirtualBox /usr/local/opensips_proxy/sbin/opensips[20729]: DEst
> and RURI after record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]: Inside main route loop
> LoadBalance
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]: Destination available
> before initial req are sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]: DEst and RURI before
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]: DEst and RURI after
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]:
> ERROR:core:print_rr_body: too many RR
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20722]:
> ERROR:dialog:get_routing_info: failed to print route records
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]: Inside main route loop
> LoadBalance
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]: Destination available
> before initial req are sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]: DEst and RURI before
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]: DEst and RURI after
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]:
> ERROR:core:print_rr_body: too many RR
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20721]:
> ERROR:dialog:get_routing_info: failed to print route records
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]: Inside main route loop
> LoadBalance
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]: Destination available
> before initial req are sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]: DEst and RURI before
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]: DEst and RURI after
> record route sip:Mayur at 192.168.100.19:5060/<null>
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]:
> ERROR:core:print_rr_body: too many RR
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20718]:
> ERROR:dialog:get_routing_info: failed to print route records
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20739]: Inside failure_route
> GW_FAILOVER
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20728]: Inside main route loop
> LoadBalance
> Jan 16 16:35:41 stack-VirtualBox
> /usr/local/opensips_proxy/sbin/opensips[20728]: Inside else of loose
> route
> ------------------------------------------------------------
> -----------------------------------------------------------
>
> Load Balancer Script :
>
> ####### Routing Logic ########
>
> # main request routing logic
>
> route{
>
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> exit;
> }
>
>
>       xlog("Inside main route loop LoadBalance\n");
>
> if (has_totag()) {
> # sequential request withing a dialog should
> # take the path determined by record-routing
> if (loose_route()) {
>                           xlog("Inside loose_route loop LoadBalance\n");
> # validate the sequential request against dialog
> if ( $DLG_status!=NULL && !validate_dialog() ) {
> xlog("In-Dialog $rm from $si (callid=$ci) is not valid according to
> dialog\n");
> ## exit;
> }
> if (is_method("BYE")) {
> setflag(1); # do accounting ...
> setflag(3); # ... even if the transaction fails
> } else if (is_method("INVITE")) {
> # even if in most of the cases is useless, do RR for
> # re-INVITEs alos, as some buggy clients do change route set
> # during the dialog.
>                            xlog("Inside else if is_method INVITE loop
> LoadBalance\n");
> record_route();
> }
>
> # route it out to whatever destination was set by loose_route()
> # in $du (destination URI).
> route(RELAY);
> } else {
>                     xlog("Inside else of loose route \n");
> if ( is_method("ACK") ) {
> if ( t_check_trans() ) {
> # non loose-route, but stateful ACK; must be an ACK after
> # a 487 or e.g. 404 from upstream server
>                                         xlog("Inside ACK $ru/$du \n");
> t_relay();
> exit;
> } else {
> # ACK without matching transaction ->
> # ignore and discard
> exit;
> }
> }
> sl_send_reply("404","Not here");
> }
> exit;
> }
>
>         xlog("Destination available before initial req are $ru/$du \n");
> #### INITIAL REQUESTS
>
> # CANCEL processing
> if (is_method("CANCEL")) {
> if (t_check_trans())
>                     xlog("Inside CANCEL $ru/$du \n");
> t_relay();
> exit;
> } else if (!is_method("INVITE")) {
> send_reply("405","Method Not Allowed");
> exit;
> }
>
> if ($rU==NULL) {
> # request with no Username in RURI
> sl_send_reply("484","Address Incomplete");
> exit;
> }
>
> t_check_trans();
>
> # preloaded route checking
> if (loose_route()) {
> xlog("L_ERR",
> "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
> if (!is_method("ACK"))
> sl_send_reply("403","Preload Route denied");
> exit;
> }
>
> # record routing
>       xlog("DEst and RURI before record route $ru/$du \n");
>       record_route();
>       xlog("DEst and RURI after record route $ru/$du \n");
> setflag(1); # do accounting
>
> if ( !load_balance("1","sip")) {
>
>                xlog("Inside load_balance loop LoadBalance\n");
> send_reply("500","No Destination available");
> exit;
> }
>
>
> t_on_failure("GW_FAILOVER");
>
> route(RELAY);
> }
>
>
> route[RELAY] {
> if (!t_relay()) {
> sl_reply_error();
> };
> exit;
> }
>
>
> failure_route[GW_FAILOVER] {
>         xlog("Inside failure_route GW_FAILOVER \n");
> if (t_was_cancelled()) {
> exit;
> }
>
> # failure detection with redirect to next available trunk
> if (t_check_status("(408)|([56][0-9][0-9])")) {
> xlog("Failed trunk $rd/$du detected \n");
>
> if ( load_balance("1","sip") ) {
> t_on_failure("GW_FAILOVER");
>                     xlog("Destination available before initial req are
> $ru/$du \n");
> t_relay();
> exit;
> }
> send_reply("500","All GW are down");
> }
> }
>
>
> local_route {
> if (is_method("BYE") && $DLG_dir=="UPSTREAM") {
> acc_log_request("200 Dialog Timeout");
> }
> }
>
>
> Regards
> Mayur
>
> On Tue, Jan 16, 2018 at 4:07 PM, Bogdan-Andrei Iancu
> <bogdan at opensips.org> wrote:
> > Hi Mayur,
> >
> > The simplest way to debug this is by using the script_trace() function -
> > see:
> >     http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43
> >
> > Simply add in the very begging of your script:
> >     script_trace( 1, "$rm from $si, ruri=$ru/$du", "LB");
> >
> > and make a call - see the execution trace through the script for your
> > INVITE.
> >
> > Regards,
> >
> > Bogdan-Andrei Iancu
> >
> > OpenSIPS Founder and Developer
> >   http://www.opensips-solutions.com
> > OpenSIPS Summit 2018
> >   http://www.opensips.org/events/Summit-2018Amsterdam
> >
> > On 01/15/2018 07:23 PM, Mayur Koshal wrote:
> >
> > Hi Bogdan,
> >
> > Thanks for your time and looking into this.
> >
> > 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.
> >
> > Need to find out the reason why it is looping inside LB and not
> forwarding
> > it to Proxy.
> >
> >
> > Regards
> > Mayur
> >
> >
> >
> >
> > On Mon, Jan 15, 2018 at 10:43 PM, Bogdan-Andrei Iancu <
> bogdan at opensips.org>
> > wrote:
> >>
> >> Hi MAyur,
> >>
> >> 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).
> >>
> >> When you do t_relay() in your script, place before it an xlog to see the
> >> destinations:
> >> xlog("sending out request to $ru/$du\n");
> >>
> >> Regards,
> >>
> >> Bogdan-Andrei Iancu
> >>
> >> OpenSIPS Founder and Developer
> >>   http://www.opensips-solutions.com
> >> OpenSIPS Summit 2018
> >>   http://www.opensips.org/events/Summit-2018Amsterdam
> >>
> >> On 01/12/2018 07:36 PM, Mayur Koshal wrote:
> >>>
> >>> Hi Bogdan,
> >>>
> >>> Thanks for the Reply.
> >>>
> >>> Yes The opensips load balancer is able to reach destinations which is
> >>> configured in the load balancer table as I can see in the wireshark
> >>> logs and opensips logs of the SIP Proxy server.
> >>>
> >>>
> >>>
> >>>
> >>> I have removed one SIP proxy in the table and the load distribution
> >>> table looks like :
> >>>
> >>> mysql> select * from load_balancer;
> >>> | id | group_id | dst_uri                  | resources | probe_mode |
> >>> description |
> >>>
> >>> +----+----------+--------------------------+-----------+----
> --------+-------------+
> >>> |  2 |        1 | sip:192.168.100.187:5060 | sip=50    |          0 |
> >>> serv1       |
> >>>
> >>> +----+----------+--------------------------+-----------+----
> --------+-------------+
> >>>
> >>>
> >>> Now I am using the setup with only one sip proxy to make it simpler as
> :
> >>>
> >>>
> >>> UAC(192.168.100.19:5065).......>Load_Balancer(192.168.100.
> 19:5060)......>Proxy(192.168.100.187:5060)..........>
> >>>   UAS(192.168.187:5070)
> >>>
> >>>
> >>> I have added a user in Load Balancer:
> >>>
> >>> sip:bharti at 192.168.100.187:5070
> >>>
> >>>
> >>>
> >>> Database changed
> >>> mysql> select * from location;
> >>>
> >>> +-----+----------+--------+---------------------------------
> +----------+------+---------------------+------+------------
> ---------------------+------+---------------------+-------+-
> -------+--------------------+--------+---------+--------------+
> >>> | id  | username | domain | contact                         | received
> >>> | path | expires             | q    | callid
> >>> | cseq | last_modified       | flags | cflags | user_agent         |
> >>> socket | methods | sip_instance |
> >>>
> >>> +-----+----------+--------+---------------------------------
> +----------+------+---------------------+------+------------
> ---------------------+------+---------------------+-------+-
> -------+--------------------+--------+---------+--------------+
> >>> | 272 | bharti   |        | sip:bharti at 192.168.100.187:5070 | NULL
> >>> | NULL | 1970-01-01 05:30:00 | 1.00 | dfjrewr12386fd6-343 at opensips.mi
> >>> |    1 | 1970-01-01 05:30:00 |     0 |      0 | OpenSIPS MI Server |
> >>> NULL   |    NULL | NULL         |
> >>>
> >>> +-----+----------+--------+---------------------------------
> +----------+------+---------------------+------+------------
> ---------------------+------+---------------------+-------+-
> -------+--------------------+--------+---------+--------------+
> >>> 1 row in set (0.01 sec)
> >>>
> >>> ------------------------------------------------------------
> ----------------------------------------
> >>>
> >>>
> >>> I am using commands in sipp:
> >>>
> >>> UAC ---./sipp -sn uac 192.168.100.19:5060 -s bharti -i 192.168.100.19
> >>> -p 5065 -m 10 -r 1 -rp 1000
> >>>
> >>> UAS -- ./sipp -sn uas 192.168.100.19:5060 -i 192.168.100.187 -p 5070
> >>>
> >>>
> >>> If I remove the load balancer and execute similar sipp commands and
> >>> run a single call, it is successfull.
> >>>
> >>>
> >>>
> >>> Logs at Load_Balancer:
> >>>
> >>> ------------------------------------------------------------
> -------------------------------------------------------
> >>> Jan 11 18:13:17 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[5375]: Inside main route loop
> >>> LoadBalance
> >>> Jan 11 18:13:17 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[5376]: Inside failure_route
> >>> GW_FAILOVER
> >>> Jan 11 18:13:17 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[5352]: message repeated 2
> >>> times: [ Inside main route loop LoadBalance]
> >>> Jan 11 18:13:17 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[5352]: Inside failure_route
> >>> GW_FAILOVER
> >>> Jan 11 18:13:17 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[5352]: Inside main route loop
> >>> LoadBalance
> >>>
> >>> ------------------------------------------------------------
> --------------------------------------------------------
> >>>
> >>> Logs At OPensips Proxy :
> >>>
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16743]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16725]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16731]: new branch at
> >>> sip:bharti at 192.168.100.19:5060
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16731]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16721]: new branch at
> >>> sip:bharti at 192.168.100.19:5060
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16721]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16722]: new branch at
> >>> sip:bharti at 192.168.100.19:5060
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16722]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16728]: incoming reply
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16737]: new branch at
> >>> sip:bharti at 192.168.100.19:5060
> >>> Jan 11 18:13:18 stack-VirtualBox
> >>> /usr/local/opensips_proxy/sbin/opensips[16737]: incoming reply
> >>>
> >>> ------------------------------------------------------------
> --------------------------------------------
> >>>
> >>> Regards
> >>> Mayur
> >>>
> >>> On Tue, Jan 9, 2018 at 7:59 PM, Bogdan-Andrei Iancu <
> bogdan at opensips.org>
> >>> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> Are you sure the OpenSIPS LB is able to reach via SIP the destinations
> >>>> you
> >>>> configured in the LB table ? Run a single call (with sipp) and make a
> >>>> network capture to understand how the call is routed.
> >>>>
> >>>> Regards,
> >>>>
> >>>> Bogdan-Andrei Iancu
> >>>>
> >>>> OpenSIPS Founder and Developer
> >>>>    http://www.opensips-solutions.com
> >>>> OpenSIPS Summit 2018
> >>>>    http://www.opensips.org/events/Summit-2018Amsterdam
> >>>>
> >>>>
> >>>> On 01/08/2018 06:08 PM, Mayur Koshal wrote:
> >>>>>
> >>>>> Reposting the setup part  as was not visible clearly  in the previous
> >>>>> mail.
> >>>>>
> >>>>>
> >>>>> My setup is like :
> >>>>>
> >>>>>
> >>>>>                                                       --------->
> >>>>> Opensips Proxy 1 ---->  UAS 1
> >>>>>
> >>>>>     UAC   -----> Load Balancer
> >>>>>                                                       -------->
> >>>>> Opensips
> >>>>> Proxy 2 -----> UAS 2
> >>>>>
> >>>>> Regards
> >>>>> Mayur
> >>>>>
> >>>>> On Mon, Jan 8, 2018 at 9:16 PM, Mayur Koshal <mayurkoshal at gmail.com>
> >>>>> wrote:
> >>>>>>
> >>>>>> Hi Everyone,
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> I have configured and build opensips as a Load Balancer but am not
> >>>>>> able to make it work.
> >>>>>>
> >>>>>> Not able to figure out where the problem is ?
> >>>>>>
> >>>>>> Request your help in resolving the issue ..
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> My setup is like :
> >>>>>>
> >>>>>>
> >>>>>>                                                       --------->
> >>>>>> Opensips Proxy 1 ---->  UAS 1
> >>>>>>
> >>>>>>     UAC   -----> Load Balancer
> >>>>>>                                                       -------->
> >>>>>> Opensips
> >>>>>> Proxy 2 -----> UAS 2
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>     where  UAC             = 192.168.100.18
> >>>>>>           Load Balancer    = 192.168.100.18:5060
> >>>>>>           OPensips Proxy 1 = 192.168.100.194:5060
> >>>>>>           Opensips Proxy 2 = 192.168.100.187:5060
> >>>>>>         sipp UAS 1         = 192.168.100.194:5080
> >>>>>>         sipp UAS 2         = 192.168.100.187:5080
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> I use the below sipp command for
> >>>>>>
> >>>>>> Sipp UAC Command : ./sipp -sn uac -rsa 192.168.100.18:5060
> >>>>>> 192.168.100.194:5080
> >>>>>> Sipp UAS1  Command : ./sipp -sn uas
> >>>>>>
> >>>>>> When I bypass the load balancer and use sipp to test opensips proxy
> it
> >>>>>> works fine.
> >>>>>>
> >>>>>> When I run the Load Balancer I can see in the wireshark logs as:
> ICMP
> >>>>>> 590 Destination unreachable (Port unreachable).
> >>>>>>
> >>>>>> In the opensips logs it goes to the failure route and displays
> message
> >>>>>> Failed trunk 192.168.100.194/<null> detected.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> The load distribution table I am using is as below :
> >>>>>>
> >>>>>> mysql> select * from load_balancer;
> >>>>>>
> >>>>>>
> >>>>>> +----+----------+---------------------+-----------+---------
> ---+-------------+
> >>>>>> | id | group_id | dst_uri             | resources | probe_mode |
> >>>>>> description |
> >>>>>>
> >>>>>>
> >>>>>> +----+----------+---------------------+-----------+---------
> ---+-------------+
> >>>>>> |  1 |        1 | sip:192.168.100.194 | sip=64    |          0 |
> >>>>>> Server1
> >>>>>> |
> >>>>>> |  2 |        1 | sip:192.168.100.187 | sip=64    |          0 |
> >>>>>> Server2
> >>>>>> |
> >>>>>>
> >>>>>>
> >>>>>> +----+----------+---------------------+-----------+---------
> ---+-------------+
> >>>>>> 2 rows in set (0.00 sec)
> >>>>>>
> >>>>>>
> >>>>>> The load balancer script, Proxy script, Load balancer logs are
> below.
> >>>>>>
> >>>>>>
> >>>>>> Load Balancer Script :
> >>>>>>
> >>>>>>
> >>
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180307/9a8c84cd/attachment-0001.html>


More information about the Users mailing list