[Serusers] accounting doesn't seem to work?

Jean-Michel Hiver jhiver at ykoz.net
Sat Aug 19 15:16:18 CEST 2006


Hi List,

I am trying to get SER to run on FreeBSD 6

For some reason, I can't get the acc module to do anything.

I have downloaded SER from CVS, changed ./modules/acc/Makefile to enable 
SQL accounting, and did a gmake bin include_modules="mysql", then 
untared the resulting .tgz in /

SER starts fine, processes SIP message fine, and yields no errors in 
/var/log/messages.

However I can't see any accounting related information in ser's "acc" 
table (which remains always empty).

Any ideas?


PS: Here is my ser.cfg (I have replaced the IP addresses with dummy 
addresses because I don't want them to be archived...). If somebody 
would be kind enough to take a look at it...


debug=3
fork=yes
log_stderror=no

listen=123.123.123.123
port=5060
children=4

dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
fifo_db_url="mysql://ser:heslo@localhost/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/textops.so"

## ACC
loadmodule "/usr/local/lib/ser/modules/acc.so"
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)

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

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 >=  2048 ) {
                sl_send_reply("513", "Message too big");
                break;
        };

        if (method=="REGISTER") {
                sl_send_reply("501", "Not Implemented");
                break;
        };

        if (method=="OPTIONS") {
                sl_send_reply("501", "Not Implemented");
                break;
        };

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

        # subsequent messages withing a dialog should take the
        # path determined by record-routing
        if (loose_route()) {
                # mark routing logic in request
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
                break;
        };

        if (!uri==myself) {
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n");
                route(1);
                break;
        };

        route(3);

        if (method=="INVITE") {
                route(2);
                break;
        };

        route(1);
}


route[1]
{
        if (!t_relay()) {
                sl_reply_error();
        };
}


route[2] {

        if (uri=~"^sip:001#") {
                rewritehostport ("123.123.123.201:5060");
        };

        if (uri=~"^sip:002#") {
                rewritehostport ("123.123.123.202:5060");
        };

        if (uri=~"^sip:003#") {
                sl_send_reply ("401", "Unauthorized");
                break();
        };

        if (uri=~"^sip:004#") {
                rewritehostport ("123.123.123.204:5060");
        };

        route(1);
}


route[3]
{
        if ( !(
                (src_ip == 123.123.123.201)  ||
                (src_ip == 123.123.123.202)  ||
                (src_ip == 123.123.123.204)  ||
                1
        ) )
        {
                sl_send_reply("401", "Unauthorized");
                break();
        };
}



More information about the sr-users mailing list