[Serusers] FIFO DB Can't connect to remote DB server

Juan Priotti jpriotti at gmail.com
Fri Jul 15 22:00:12 CEST 2005


Hi all,

I moved the mysql DB from the same server it's running ser + sems and
I get this error :

Jul 15 20:51:20 server2 ser[72317]: Maxfwd module- initializing
Jul 15 20:51:20 server2 ser[72319]: new_connection(): Can't connect to
local MySQL server through socket '/tmp/mysql.sock' (2)
Jul 15 20:51:20 server2 ser[72319]: db_init(): Could not create a connection
Jul 15 20:51:20 server2 ser[72319]: ERROR: child_init(1): Error while
connecting database
Jul 15 20:51:20 server2 ser[72319]: init_mod_child(): Error while
initializing module usrloc
Jul 15 20:51:20 server2 ser[72319]: init_child failed

I've specify the address where ser has to connect to the DB
(fifo_db_url="mysql://username@password@xx.xx.xx.xx/ser"), but it
still tries to connect to a local mysql
Anybody knows why it happends? sems VM was working before moving the
DB to another server.

Thank you in advance

Juan

ser.cfg

# ----------- global configuration parameters ------------------------

#debug=3         # debug level (cmd line: -dddddddddd)
#fork=yes
#log_stderror=no        # (cmd line: -E)

/* Uncomment these lines to enter debugging mode
fork=no
log_stderror=yes
*/

check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5090
#children=4
fifo="/tmp/ser_fifo"

# Configure FIFO DB
fifo_db_url="mysql://username@password@xx.xx.xx.xx/ser"

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/ser/modules/mysql.so"

loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
#loadmodule "/usr/local/lib/ser/modules/avp.so"
#loadmodule "/usr/local/lib/ser/modules/avpops.so"
#loadmodule "/usr/local/lib/ser/modules/avp_db.so"

# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
#modparam("usrloc", "db_mode",   0)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -------------------------  request routing logic -------------------

# main routing logic

route{

        # initial sanity checks -- messages with
        # max_forwards==0, or excessively long requests
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if ( msg:len > max_len ) {
                sl_send_reply("513", "Message too big");
                break;
        };

        # we record-route all messages -- to make sure that
        # subsequent messages will go through our proxy; that's
        # particularly good if upstream and downstream entities
        # use different transport protocol
        record_route();
        # loose-route processing
        if (loose_route()) {
                t_relay();
                break;
        };

        if (uri==myself) {

           if (method=="REGISTER") {

              # make UAs which want to register happy
              sl_send_reply("200","OK");
              break;
           };

           # switch to statefull mode:
           if (!t_newtran()){
                sl_send_reply("500","could not create transaction");
                break;
           };

           if (method=="ACK"){
                # actively absorb ACKs
                t_relay();
                break;
           };

           # prevent timeout on the other side:
           t_reply("100","Trying - just wait a minute !");

           if (method=="INVITE"){

                # redirect the call to the 'conference' plug-in
                # if the URI begin with 100
                if (uri=~"sip:111.*@") {

                   # assumes that Sems configuration parameter 'socket_name='
                   # has been set to /tmp/am_sock
                   if(!t_write_req("/tmp/am_fifo","conference")) {
                      t_reply("500","error contacting sems");
                   };
                   break;
                };

                # redirect the call to the 'announcement' plug-in
                # if the URI begin with 200
                if (uri=~"sip:222.*@") {

                   if(!t_write_req("/tmp/am_fifo","announcement")) {
                      t_reply("500","error contacting sems");
                   };
                   break;
                };

                # no service number, redirect to voicemail.
                # do not forget to load AVPs so that voicemail gets the
                # callee's email address.
                #load_avp("r_uri","email",0);
                if(!t_write_req("/tmp/am_fifo","voicemail")) {
                    t_reply("500","error contacting sems");
                };
                break;
           }
           else if (method=="BYE" || method=="CANCEL") {

                # Sems should already know which plug-in is handling that
                # call. "bye" is no plug-in name. It is a reserved name which
                # tells Sems to terminate the call.

                if(!t_write_req("/tmp/am_fifo","bye")) {
                    t_reply("500","error contacting sems");
                };
           };
        };

        # forward to current uri now; use stateful forwarding; that
        # works reliably even if we forward from TCP to UDP
        if (!t_relay()) {
                sl_reply_error();
        };
}




More information about the sr-users mailing list