doing minute billing

C Thompson cthompson at wingnet.net
Wed Jan 9 10:35:35 CST 2002


Currently, we are doing some accounting updates to our MySQL database
using the following code in RADIUS.CFG:

AcctSQLStatement update SUBSCRIBERS set TIMELEFT=TIMELEFT-0%{Acct-
Session-Time} where USERNAME='%n'

So if a user has a session-time of 50 seconds, they are billed for 50
seconds.

What we want to do is to be able to bill the user in minute increments.
The logic for this seems to be the following:

set TIMELEFT=TIMELEFT-0{Acct-Session-Time} / 60 ; round up to next whole
number and multiply by 60

Can we do this in RADIUS, or must it be done in MySQL?  Any code
examples out there?

Thanks!


Craig Thompson, Manager
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605
423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net

-------------------------------------------------------

-- 
Mike McCauley                               mikem at open.com.au
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory etc etc 
on Unix, Win95/8, 2000, NT, MacOS 9, MacOS X
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list