[Serusers] accounting not logging into mysql

Iqbal iqbal at gigo.co.uk
Wed Oct 13 16:49:22 CEST 2004


Hi

I have finally manged to get the acc.so module up and running, it no logs
in fine, and I can get Xlite (the UA I am using) to REGISTER and login,
and I can see new user logged in details in the connection table in the
SER database...but acc table is empty.

I copied the default accounting example, and pasted it into my config
below. All the auth etc with db works, but when I initiate a call, I see
the INVITE flags being sent to my console, hence I figure the ser.cfg
file should picmk these up and send to acc table in DB...but alas table
is empty, neideas

-
#
# $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $
#
# simple quick-start config script
#

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

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

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

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

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

# Uncomment this if you want to use SQL database
#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/mysql.so"
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/acc.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)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#modparam("auth_radius", "radius_config",
"/usr/local/etc/radiusclient/radiusclient.conf")
#
# If you set "calculate_ha1" parameter to yes (which true in this
config),
# uncomment also the following parameter)
#

modparam("auth_db", "db_url", "mysql://ser:pass@server.com/ser")
modparam("usrloc", "db_url", "mysql://ser:pass@server.com/ser")
modparam("acc", "db_url", "mysql://ser:pass@server.com/ser")

#modparam("group", "db_url", "mysql://ser:pass@server.com/ser")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# ----------------- Accounting Parameters              ---------------

# set the reporting log level
#
#modparam("acc", "log_level", 1)
# number of flag, which will be used for accounting; if a message is
# labeled with this flag, its completion status will be reported
modparam("acc", "db_flag", 1)
modparam("acc", "log_level", 2)
modparam("acc", "db_missed_flag", 1)
modparam("acc", "failed_transactions", 1)

# ----------------- setting module-specific parameters ---------------

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

# main routing logic

route{

        /* ********* ROUTINE CHECKS  ********************************** */

if( (method=="INVITE") || (method=="ACK") || (method=="BYE") ||
(method=="REGISTER")) {
                setflag(1);
}

        # filter too old messages
        if (!mf_process_maxfwd_header("10")) {
                log("LOG: Too many hops\n");
                sl_send_reply("483","Too Many Hops");
                break;
        };

 if ( msg:len > max_len ) {
                        sl_send_reply("513", "Message too big");
                        break;
                };


  #  Process record-routing
    if (loose_route()) { t_relay(); break; };


        # labeled all transaction for accounting
        setflag(1);

        # record-route INVITES to make sure BYEs will visit our server too
        if (method=="INVITE") record_route();

        # forward the request statefuly now; (we need *stateful*
forwarding,
        # because the stateful mode correlates requests with replies and
        # drops retranmissions; otherwise, we would have to report on
        # every single message received)
        if (!t_relay()) {
                sl_reply_error();
                break;
        };

}



tks

Iqbal




More information about the sr-users mailing list