Hi there list,
I've been looking around to make RADIUS work with ser ... And succesfully got Authentication work just nice. Need a hand on Authorization, but does not care about that as much as I do with Accounting.
This is the problem, I can get the Acct-Start messeages when an INVITE messege is received, but cannot get any Acct-Stop messege for any BYE or CANCEL messege. Here goes my ser.cfg ...
[...]
# -- RADIUS ACC -- modparam("acc", "radius_config", "/etc/radiusclient.conf") modparam("acc", "radius_flag", 1) modparam("acc", "radius_missed_flag", 2) modparam("acc", "log_level", 1)
[...]
route {
[...]
if (method=="INVITE") { setflag(1); acc_rad_request("200");
};
if (method=="BYE" || method=="CANCEL") { setflag(1); acc_rad_request("200"); };
[...]
}
And here goes my RADIUS output for a call made from user 1992005 to user 1992001 ...
radrecv: Accounting Request from host c0a801fd code=4, id=89, length=248 Acct-Status-Type = Start Service-Type = Sip-Session Sip-Response-Code = 200 Sip-Method = Invite User-Name = "1992005@192.168.1.253" Calling-Station-Id = "sip:1992005@192.168.1.253:11005" Called-Station-Id = "sip:1992001@192.168.1.253" Sip-Translated-Request-URI = "sip:1992001@192.168.1.253" Acct-Session-Id = "CF8F4CE6-A085-413A-B2E1-CD70D396EBBD@192.168.1.178" Sip-To-Tag = "n/a" Sip-From-Tag = "3735508357" Sip-CSeq = "36572" NAS-IP-Address = 192.168.1.253 NAS-Port-Id = 5060 Acct-Delay-Time = 0 Entro a rad_accounting Entro a rad_accounting_sql must_update_client_fst_ack=TRUE Calling Corrected = 1992005 Called Corrected = 1992001 Entro a rad_send_reply Sending Accounting Ack of id 89 to c0a801fd (nas linux)
( the previous output corresponds to the "RINGING" state .. Just before the called user answers the phone )
radrecv: Accounting Request from host c0a801fd code=4, id=90, length=278 Acct-Status-Type = Start Service-Type = Sip-Session Sip-Response-Code = 200 Sip-Method = Invite User-Name = "1992005@192.168.1.253" Calling-Station-Id = "sip:1992005@192.168.1.253:11005" Called-Station-Id = "sip:1992001@192.168.1.253" Sip-Translated-Request-URI = "sip:1992001@192.168.1.113:11001;user=phone" Acct-Session-Id = "CF8F4CE6-A085-413A-B2E1-CD70D396EBBD@192.168.1.178" Sip-To-Tag = "90d69e0f71f15064" Sip-From-Tag = "3735508357" Sip-CSeq = "36572" NAS-IP-Address = 192.168.1.253 NAS-Port-Id = 5060 Acct-Delay-Time = 0 Entro a rad_accounting Entro a rad_accounting_sql must_update_client_fst_ack=TRUE Calling Corrected = 1992005 Called Corrected = 1992001 Entro a rad_send_reply Sending Accounting Ack of id 90 to c0a801fd (nas linux) radrecv: Accounting Request from host c0a801fd code=4, id=91, length=278 Acct-Status-Type = Start Service-Type = Sip-Session Sip-Response-Code = 200 Sip-Method = Bye User-Name = "1992005@192.168.1.253" Calling-Station-Id = "sip:1992005@192.168.1.253:11005" Called-Station-Id = "sip:1992001@192.168.1.253" Sip-Translated-Request-URI = "sip:1992001@192.168.1.113:11001;user=phone" Acct-Session-Id = "CF8F4CE6-A085-413A-B2E1-CD70D396EBBD@192.168.1.178" Sip-To-Tag = "90d69e0f71f15064" Sip-From-Tag = "3735508357" Sip-CSeq = "36572" NAS-IP-Address = 192.168.1.253 NAS-Port-Id = 5060 Acct-Delay-Time = 0 Entro a rad_accounting Entro a rad_accounting_sql must_update_client_fst_ack=TRUE Calling Corrected = 1992005 Called Corrected = 1992001 Entro a rad_send_reply Sending Accounting Ack of id 91 to c0a801fd (nas linux)
( the previous output corresponds to when called user answer the phone. According to my ser.cfg, at a BYE or CANCEL message an Acct-Stop should be sent, but no stop messege is seen at the RADIUS output )
Any hint ?
Regards,
Lucas
if (method=3D=3D"BYE" || method=3D=3D"CANCEL") { setflag(1); acc_rad_request("200"); };
you should not need to call acc_rad_request here. setting the flag and t_relay should be enough.
-- juha
Hi,
if (method=3D=3D"BYE" || method=3D=3D"CANCEL") { setflag(1); acc_rad_request("200"); };
you should not need to call acc_rad_request here. setting the flag and t_relay should be enough.
Nope, it did not work .... :-(
Look ... this is my ser.cfg (is this what you meant?)
if (method=="REGISTER") {
# Lo siguiente es para auth con RADIUS if (!radius_www_authorize("")) { www_challenge("", "0"); break; }; save("location"); break; };
if (method=="INVITE") { setflag(1); acc_rad_request("200"); };
if (method=="BYE" || method=="CANCEL") { setflag(1); };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); break; }; };
t_relay();
.... if it is ... then, I just got the same situation. Not an Acct-Stop message at all :-( ... Any other idea ?
Thank you ... regards,
Lucas ...