Can the SER accounting module log missed calls through radius to mysql? Or are missed calls only logged to a flat file? I am currently logging all successful calls through the SER accounting module without any problems but I would like to also have radius write the information for missed calls into the MySQL DB as well. So far Iv'e had trouble getting it to work. Please advise.
~Alan
Error message from Freeradius.
rlm_sql (sql): Unsupported Acct-Status-Type = 15
The account type is specified in the RFC and "dictionary.ser" as failed:
## Acct-Status-Type Values ### VALUE Acct-Status-Type Start 1 # RFC2866, acc VALUE Acct-Status-Type Stop 2 # RFC2866, acc VALUE Acct-Status-Type Failed 15 # RFC2866, acc
Missed call log from debug output for response code 603 (Decline) and 486 (Busy) which I would like this information dumped to the database.
Acct-Status-Type = Failed Service-Type = Sip-Session Sip-Response-Code = 603 Sip-Method = 1 User-Name = "alan@sip.host.com" Calling-Station-Id = "sip:alan@sip.host.com" Called-Station-Id = "sip:chidu@sip.host.com" Sip-Translated-Request-URI = "sip:chidu@10.180.2.13:5060" Acct-Session-Id = "dc06f80821541776@YWJha2Vy" Sip-To-Tag = "4c4efb52" Sip-From-Tag = "ae6a1764" Sip-Cseq = "1" NAS-Port = 5060 Acct-Delay-Time = 0 NAS-IP-Address = 127.0.0.1
Acct-Status-Type = Failed Service-Type = Sip-Session Sip-Response-Code = 486 Sip-Method = 1 User-Name = "alan@sip.host.com" Calling-Station-Id = "sip:alan@sip.host.com" Called-Station-Id = "sip:chidu@sip.host.com" Sip-Translated-Request-URI = "sip:chidu@10.180.2.13:5060" Acct-Session-Id = "3e49f433b443d02f@YWJha2Vy" Sip-To-Tag = "1e237c68" Sip-From-Tag = "0678bd37" Sip-Cseq = "1" NAS-Port = 5060 Acct-Delay-Time = 0 NAS-IP-Address = 127.0.0.1
My current config is set-up as per the accounting documentation for missed calls:
# ----------- 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=5060 #children=4 fifo="/tmp/ser_fifo"
# -------------------------- Aliases --------------------------------
alias=sip.host.com
# ----------------------- Core Modules ------------------------------
loadmodule "/ser-0.9.6/lib/modules/sl.so" loadmodule "/ser-0.9.6/lib/modules/tm.so" loadmodule "/ser-0.9.6/lib/modules/rr.so" loadmodule "/ser-0.9.6/lib/modules/maxfwd.so" loadmodule "/ser-0.9.6/lib/modules/usrloc.so" loadmodule "/ser-0.9.6/lib/modules/registrar.so" loadmodule "/ser-0.9.6/lib/modules/textops.so" loadmodule "/ser-0.9.6/lib/modules/xlog.so"
# --------------- RADIUS Authentication Module ----------------------
loadmodule "/ser-0.9.6/lib/modules/auth.so" loadmodule "/ser-0.9.6/lib/modules/auth_radius.so"
# --------------- RADIUS Accounting Module --------------------------
loadmodule "/ser-0.9.6/lib/modules/acc.so"
# --------------- Nathelper Mod --------------------------------------
loadmodule "/ser-0.9.6/lib/modules/nathelper.so"
# ----------------- Module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode", 0)
# -- RADIUS Authentication params --
modparam("auth_radius", "radius_config", "/radiusclient/radiusclient.conf") modparam("auth_radius", "service_type", 15)
# -- RADIUS Accounting params --
modparam("acc", "radius_config", "/radiusclient/radiusclient.conf") #modparam("acc", "service_type", 15) modparam("acc", "radius_flag", 1) modparam("acc", "radius_missed_flag", 3) #modparam("acc", "failed_transactions", 1) #modparam("acc", "report_cancels", 1) modparam("acc", "report_ack", 1)
# -- Logging Params
#modparam("acc", "log_missed_flag", 1) #modparam("acc", "log_level", 1) #modparam("acc", "log_flag", 1 )
# -- rr params --
modparam("rr", "enable_full_lr", 1)
# -- NAT Helper Params --
modparam("nathelper", "rtpproxy_disable", 1)
############################################### # Request Routing Logic #
route{
# Sanity Checks
# Don't forward a message more than 10 times. # This setting is important to avoid endless loops in case of misconfiguration
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); break; };
# Don't except messages that are too long
if ( msg:len > max_len ) { sl_send_reply("513", "Message too big"); break; };
if (loose_route()) { setflag(1); t_relay(); break; };
# Authentication starts here
if (uri=~"sip.host.com" || uri=~"10.180.0.32") { xlog("L_ERR", " method <%rm> <%fu> <%tu>\n"); if (method=="REGISTER") { fix_nated_contact(); if (!radius_www_authorize("")) { www_challenge("", "0"); break; };
save("location"); break; };
if (method=="INVITE" || method=="ACK" || method=="BYE" || method=="CANCEL") { setflag(1); setflag(3); record_route(); log(1, "INVITE received\n"); # }; # if (method=="BYE" || method=="CANCEL") { # setflag(1); # log(1, "BYE received\n"); # } else { # log(1, "Call Hung no BYE received\n"); # setflag(3); # }; # # if (uri=~"sip:.*[@:]sip.host.com" || uri=~"sip:.*[@:]10.180.0.32") { # log(1, "Request for host.com\n"); # } else { # log(1, "Request for other domain received\n"); # }; # # if (( method=="ACK")) { # setflag(3); };
if (!lookup("location")) { sl_send_reply("480", "Temporarily Unavailable"); break; };
if (!t_relay()) { sl_reply_error(); };
}; }
-------------------