[Serusers] ser 0.9.0 accounting problems

topi topi at elpiset.net
Fri Sep 15 11:00:56 CEST 2006


hello,

i'm using ser 0.9.0 and acc module to log transactions, actually it
works but i need some help with two problems:

1) i would like to log acc messages to a different syslog facility, and
a different file, than general logs are logged. 

-> my ser.cfg file contains:

log_facility=LOG_LOCAL0

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

# -- acc params --
# set the reporting log level
modparam("acc", "log_level", 1) 
modparam("acc", "log_flag", 5)
#modparam("acc", "log_extra", "msg_body=$rb")


by setting log_level to 1, acc logs would be sent to LOG_LOCAL1
facility, is this right? 

if not, what i could do to get this logs into a different file?


2) the second problem is that while the acc documentation documents
'log_extra' param:

http://www.voice-system.ro/docs/acc-headers/acc.html#AEN308

i'm getting errors the following error:

Sep  5 12:46:43 host ser: set_mod_param_regex: parameter <log_extra> not
found in module <acc> 
Sep  5 12:46:43 host ser: parse error (104,19-20): Can't set module
parameter

what can be done?

thanks in advance,


topi


my /usr/local/ser/etc/ser.cfg:

#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 Exp $
#
# ----------- global configuration parameters ------------------------ 

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

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

sip_warning=0
log_facility=LOG_LOCAL0

alias="192.168.123.2"
alias="ser.mynetwork.net"

# ------------------ module loading ----------------------------------
loadmodule "/usr/local/ser/lib/ser/modules/mysql.so"
loadmodule "/usr/local/ser/lib/ser/modules/sl.so" 
loadmodule "/usr/local/ser/lib/ser/modules/tm.so"
loadmodule "/usr/local/ser/lib/ser/modules/rr.so"
loadmodule "/usr/local/ser/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/ser/lib/ser/modules/usrloc.so" 
loadmodule "/usr/local/ser/lib/ser/modules/registrar.so"
loadmodule "/usr/local/ser/lib/ser/modules/textops.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded ! 
loadmodule "/usr/local/ser/lib/ser/modules/auth.so"
loadmodule "/usr/local/ser/lib/ser/modules/auth_db.so"

# accounting
loadmodule "/usr/local/ser/lib/ser/modules/acc.so"

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

# -- usrloc params --
modparam("usrloc", "db_mode", 0)

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

# -- acc params --
# 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", "log_flag", 5)
#modparam("acc", "failed_transactions", 1)

#modparam("acc", "log_extra", "msg_body=$rb") 
#modparam("acc", "log_extra", "ua=hdr/User-Agent;uuid=avp/i:123")

# -------------------------  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") record_route(); 

        # 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;
        };

        if (method == "INVITE" || method== "ACK" || method == "CANCEL"
|| method == "BYE") {
                # accounting 
                setflag(5);
        };
        #
--------------------------------------------------------------------



        # if the request is for other domain use UsrLoc
        # (in case, it does not work, use the following command 
        # with proper names and addresses in it)
        if (uri==myself) {
                if (method=="REGISTER") {
                        save("location");
                        break; 
                };
                lookup("aliases");
                if (!uri==myself) {
                        append_hf("P-hint: outbound alias\r\n");
                        route(1); 
                        break;
                };
                # native SIP destinations are handled using our USRLOC
DB
                if (!lookup("location")) {
                        sl_send_reply("404", "Not Found"); 
                        break;

                };
        };

        append_hf("P-hint: usrloc applied\r\n");
        route(1);
}

route[1]
{
        # send it out now; use stateful forwarding as it works reliably 
        # even for UDP2TCP
        if (!t_relay()) {
                sl_reply_error();
        };
}




More information about the sr-users mailing list