[Serusers] radius accounting failed
Kamran Ahmad
p_kami at yahoo.com
Fri Apr 15 10:40:33 CEST 2005
hello
i am getting radius accounting Failed two times.
like
Fri Apr 15 04:04:28 2005
Acct-Status-Type = Failed
Service-Type = Sip-Session
Fri Apr 15 04:04:36 2005
Acct-Status-Type = Start
Fri Apr 15 04:04:36 2005
Acct-Status-Type = Start
Service-Type = Sip-Session
Fri Apr 15 04:07:56 2005
Acct-Status-Type = Failed
ser.cfg
----------------------------
debug=3
fork=yes
log_stderror=no
dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
#fifo_db_url="mysql://ser:heslo@localhost/ser"
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/xlog.so"
#radius configuration
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_radius.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
loadmodule "/usr/local/lib/ser/modules/exec.so"
loadmodule "/usr/local/lib/ser/modules/uri.so"
#loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
#loadmodule "/usr/local/lib/ser/modules/uri_db.so"
#loadmodule "/usr/local/lib/ser/modules/uri_radius.so"
#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
#modparam("auth_db|uri_db|usrloc","db_url","mysql://ser:heslo@localhost/ser")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper",
"rtpproxy_sock","unix:/var/run/rtpproxy.sock")
modparam("usrloc", "db_mode", 0)
modparam("registrar", "nat_flag", 6)
modparam("rr", "enable_full_lr", 1)
#radius config
modparam("auth_radius","radius_config","/usr/local/etc/radiusclient/radiusclient.conf")
modparam("auth_radius","service_type",15)
modparam("acc","radius_config","/usr/local/etc/radiusclient/radiusclient.conf")
modparam("acc","log_level",1)
modparam("acc", "radius_missed_flag", 2)
modparam("acc","log_flag",1)
modparam("acc","radius_flag",1)
#radius config
route {
#-----------------------------------------------------------------
# Sanity Check Section
#-----------------------------------------------------------------
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too Many Hops");
break;
};
if (msg:len > max_len) {
sl_send_reply("513", "Message Overflow");
break;
};
#-----------------------------------------------------------------
# Record Route Section
#-----------------------------------------------------------------
if (method!="REGISTER") {
record_route();
};
if (method=="BYE" || method=="CANCEL") {
unforce_rtp_proxy();
}
#Stop radius accounting
if (method=="BYE") {
acc_rad_request("Stop");
};
#Stop radius accounting
#-----------------------------------------------------------------
# Loose Route Section
#-----------------------------------------------------------------
if (loose_route()) {
if (has_totag() && method=="INVITE") {
if (nat_uac_test("19")) {
setflag(6);
force_rport();
fix_nated_contact();
};
force_rtp_proxy("l");
};
route(1);
break;
};
#-----------------------------------------------------------------
# Call Type Processing Section
#-----------------------------------------------------------------
if (uri==myself) {
if (method=="INVITE") {
route(3);
break;
} else if (method=="REGISTER") {
route(2);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
route(1);
};
}
route[1] {
#-----------------------------------------------------------------
# Default Message Handler
#-----------------------------------------------------------------
t_on_reply("1");
if (!t_relay()) {
if (method=="INVITE" && isflagset(6)) {
unforce_rtp_proxy();
};
sl_reply_error();
};
}
route[2] {
#-----------------------------------------------------------------
# REGISTER Message Handler
#----------------------------------------------------------------
if (!search("^Contact: \*") && nat_uac_test("19")) {
setflag(6);
fix_nated_register();
# fix_nated_contact();
force_rport();
};
sl_send_reply("100", "Trying");
#radius config
if (!radius_www_authorize("")) {
www_challenge("","0");
break;
};
exec_msg("cat >> /tmp/reg.log");
#end of radius config
if (!save("location")) {
sl_reply_error();
};
}
route[3] {
#-----------------------------------------------------------------
# INVITE Message Handler
#-----------------------------------------------------------------
if (!radius_www_authorize("")) {
www_challenge("","0");
break;
};
if (nat_uac_test("19")) {
setflag(6);
}
if (uri=~"^sip:9[0-9]*@ser") {
strip(1);
rewritehostport("gwip:port");
#t_relay();
force_rport();
fix_nated_contact();
force_rtp_proxy();
t_relay();
#start accounting
setflag(1);
acc_rad_request("Start");
break;
}
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
#consume_credentials();
#call now start radius accounting
setflag(1);
acc_rad_request("Start");
#call start radius accounting
if (isflagset(6)) {
force_rport();
# xlog("L_DBG","going for fixnated and forcertp%fu");
#log("hello");
fix_nated_contact();
force_rtp_proxy();
};
t_on_reply("1");
if (!t_relay()) {
if(isflagset(6)) {
unforce_rtp_proxy();
}
sl_reply_error();
};
}
onreply_route[1] {
if (isflagset(6) &&
status=~"(180)|(183)|2[0-9][0-9]") {
fix_nated_contact();
if (!search("^Content-Length:\ 0")) {
force_rtp_proxy();
};
}
else if (nat_uac_test("1")) {
fix_nated_contact();
};
}
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
More information about the sr-users
mailing list