[OpenSIPS-Users] Load Balancer Issue

Nilanjan Banerjee nil.banerjee at gmail.com
Mon Oct 22 13:25:54 CEST 2012


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'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.

Regards,
Nil.

____________

Load Balancer:
____________

route{
        if (!mf_process_maxfwd_header("3")) {
                sl_send_reply("483","looping");
                exit;
        }

        if (!has_totag()) {
                # initial request
                record_route();
        } else {
                # sequential request -> obey Route indication
                loose_route();
                t_relay();
                exit;
        }

        # detect resources and do balancing

         load_balance("1","sc");


        # LB function returns negative if no suitable destination (for
requested resources) is found,
        # or if all destinations are full
        if ($retcode<0) {
             sl_send_reply("500","Service full");
             exit;
        }

        xlog("Selected destination is: $du\n");

        # send it out
        if (!t_relay()) {
                sl_reply_error();
        }
}

____________

Proxy:
____________

route{
record_route();
        if (!t_relay()) {
             #   xlog("L_ERR","sl_reply_error\n");
                sl_reply_error();
        }
}


On Sun, Oct 21, 2012 at 7:39 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:

> **
> Hi Nil,
>
> I wild guess is you are not correctly do "loose_route" on the LB, so
> instead of following the Route (to OpenSIPS Proxy), it goes directly to end
> destination in RURI (Client 2).
>
> Of course, I assume that all parties (LB + Proxy) do record_route() for
> the call, right ?
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
>
> On 10/21/2012 10:09 AM, Nilanjan Banerjee wrote:
>
> Hello,
>
>   I am trying to build the following setup using OpenSIPS load balancer
> and the proxy functionality:
>
> Client 1 (sipp) <----> OpenSIPS Load Balancer <----> OpenSIPS Proxy <---->
> Client 2 (sipp)
>
> At the client ends I am using the following commands:
>
> Client 1: sipp -sn uac -rsa [Load Balancer Address] [Client 2 Address]
>
> Client 2: sipp -sn uas
>
> 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).
>
> 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?
>
> [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.]
>
> Would greatly appreciate any help in this matter. Thanks in advance.
>
> Nil.
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121022/16d9796f/attachment.htm>


More information about the Users mailing list