Menu

load_balancer : ressources does not decrease

Khainou
2011-08-04
2013-05-09
  • Khainou

    Khainou - 2011-08-04

    Hi !

    Plz, I need help :S !

    I set up this feature, but a call is finished, the number of "load" in "opensipsctl lb_list fifo" does not decrease.

    So, resources are always used. To reset, I have to restart opensips.

    How can I do to make this work?

    Thank you!

    Here is my configuration file:

    route{

    if ($rU=="dialog") {
                    xlog("L_INFO","------dialog------");
                    if (load_balance("1","dialog"))
                            route(1);
                    else
                            route(2);
            }
            else {
                    xlog("L_INFO","------conf------");
                    if (load_balance("1","conf"))
                            route(1);
                    else
                            route(2);
            }

    } route {

            xlog("l'appel est dirige vers :  $dun");
            t_relay();
            exit();

    }

    route {

            xlog(" --- Service Full --- ");
            sl_send_reply("500","Service full");
            exit();

    }

    _And lb_list, _ :

    Destination:: sip:X.X.X.1:5060 id=1 group=1 enabled=yes auto-re=on

            Resource:: dialog max=2 load=0

    Destination:: sip:X.X.X.2:5060 id=1 group=1 enabled=yes auto-re=on

            Resource:: dialog max=2 load=0

    Destination:: sip:X.X.X.3:5060 id=2 group=1 enabled=yes auto-re=on

            Resource:: conf max=2 load=0

    Destination:: sip:X.X.X.4:5060 id=2 group=1 enabled=yes auto-re=on

            Resource:: conf max=2 load=0

     
  • Bogdan-Andrei Iancu

    The calls are not "seen" as terminated (by LB) as the BYE (actually any sequential request) does not go through opensips - only the initial INVITE.

    Add in route before t_relay:
        record_route();

    and in main route {}, in the very beginning:
        route {
              if (has_totag() ) {
                     loose_route();
                     t_relay();
                     exit;
              }
              …………

    You may need to load additional modules like "rr" for the functions.

    Regards,
    Bogdan

     
  • Khainou

    Khainou - 2011-08-04

    Indeed, with that, the "BYE" through LB
    I understand.

    thank you very much !!!
    It works!