[OpenSIPS-Users] OpenSIPS load_balancer issue

rajib deka rajibdk at gmail.com
Thu Dec 3 16:15:48 CET 2009


Hi,

I have the following configuration for my opensips server with mysql. I have
showed the mysql table and opensips cfg file content. The issue I am facing
is when I place 20 calls to opensips it routes 10 calls to 10.128.46.103 and
it disconnects the rest of the calls, it doesnot even go for the other gate
way. Please help me.

--Rajib

mysql> select * from load_balancer;

+----+----------+------------------------+-----------+------------+-------------+

| id | group_id | dst_uri                | resources | probe_mode |
description |

+----+----------+------------------------+-----------+------------+-------------+

|  1 |        1 | sip:10.128.46.103:5060 | pstn=10   |          2 |
gateway_2   |

|  2 |        1 | sip:10.128.46.50:5060  | pstn=25   |          2 |
gateway_3   |

+----+----------+------------------------+-----------+------------+-------------

Routing Script:

debug=3

memlog=1

log_stderror=no

log_facility=LOG_LOCAL0



fork=yes

children=4

check_via=no     # (cmd. line: -v)

dns=off          # (cmd. line: -r)

rev_dns=off      # (cmd. line: -R)



port=5060



#set module path

mpath="/usr/local/lib/opensips/modules/"



loadmodule "maxfwd.so"

loadmodule "sl.so"

loadmodule "db_mysql.so"

loadmodule "tm.so"

loadmodule "xlog.so"

loadmodule "uri.so"

loadmodule "rr.so"

loadmodule "dialog.so"

loadmodule "mi_fifo.so"

loadmodule "signaling.so"

loadmodule "textops.so"

loadmodule "load_balancer.so"



modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("dialog", "dlg_flag", 13)

modparam("dialog", "db_mode", 1)

modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost
/opensips")



modparam("rr","enable_double_rr",1)

modparam("rr","append_fromtag",1)



modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost
/opensips")

modparam("load_balancer", "probing_interval", 10)



route{

        if (!mf_process_maxfwd_header("10")) {

                sl_send_reply("483","looping");

                exit;

        }





        if (!has_totag()) {

                # initial request

                record_route();

        } else {

                # sequential request -> obey Route indication

                loose_route();

                t_relay();

                exit;

        }

   # handle cancel and re-transmissions

        if ( is_method("CANCEL") ) {

                if ( t_check_trans() )

                        t_relay();

                exit;

        }



        # from now on we have only the initial requests

        if (!is_method("INVITE")) {

                send_reply("405","Method Not Allowed");

                exit;

        }



        # detect resources and do balancing

      #  if ($rU=~"^1") {

                # looks like a Conference call

       #         load_balance("1","conf");

       # } else if ($rU=~"^2") {

                # looks like a VoiceMail call

        #        load_balance("1","vm");

        #} else {

                # PSTN call

                load_balance("1","pstn");

        #}





        # LB function returns negative if no suitable destination (for
requested resources) is found,

        # or if all destinations are full

        if ($retcode<0) {

             #rewritehost("10.128.46.103:5060");

             sl_send_reply("500","Service full");

             xlog("SGS: Service full : Call failed");

             exit;

        }



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

        $rd = $dd;

        # send it out

        if (!t_relay()) {

                sl_reply_error();

                xlog("SGS: Call Not Connected");

        }else{

                xlog("SGS: Call Connected");

        }



        if ( is_method("BYE") ) {

                xlog("SGS: Selected Route : $du\n");

        }

}





Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]: hash = 2054
fragments no.:     1, unused:     0                 bucket size:    524288 -
1048576 (first    989664)

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: hash = 101
fragments no.:     1, unused:     0                  bucket size:       808
-       808 (first       808)

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25317]:
-----------------------------

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25312]: TOTAL:     71
free fragments = 993256 free bytes

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]: TOTAL:     73
free fragments = 994016 free bytes

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: hash = 2054
fragments no.:     1, unused:     0                 bucket size:    524288 -
1048576 (first    988864)

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25312]:
-----------------------------

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]:
-----------------------------

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: TOTAL:     59
free fragments = 993120 free bytes

Dec  3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]:
-----------------------------

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]: Memory
status (pkg):

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]: fm_status
(0x81b1e40):

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]:  heap size=
1048576

Dec  3 09:58:58 usnjpar1askvm01 opensips: INFO:core:init_tcp: using epoll_lt
as the TCP io watch method (auto detected)

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
NOTICE:core:main: version: opensips 1.6.0-notls (i386/linux)

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:core:main: using 32 Mb shared memory

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:core:main: using 1 Mb private memory per process

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:maxfwd:mod_init: initializing...

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:sl:mod_init: Initializing StateLess engine

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:tm:mod_init: TM - initializing...

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:xlog:mod_init: initializing...

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:dialog:mod_init: Dialog module - initializing

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
ERROR:db_mysql:db_mysql_submit_query: driver error: Unknown column 'vars' in
'field list'

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
ERROR:core:db_do_query: error while submitting query

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
ERROR:dialog:select_entire_dialog_table: Error while querying (fetch)
database

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
ERROR:db_mysql:db_mysql_free_result: invalid parameter value

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
NOTICE:signaling:mod_init: initializing module ...

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:textops:mod_init: initializing...

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:load_balancer:mod_init: Load-Balancer module - initializing

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb

Dec  3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]:
INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25650]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25650]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Call
Connected

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS:
Selected destination is: sip:10.128.46.103:5060

Dec  3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Call
Connected

Dec  3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25645]: SGS:
Service full : Call failed

Dec  3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS:
Service full : Call failed

Dec  3 09:59:35 usnjpar1askvm01 last message repeated 4 times

Dec  3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25645]: SGS:
Service full : Call failed

Dec  3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS:
Service full : Call failed

~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20091203/19de62e2/attachment-0001.htm 


More information about the Users mailing list