(RADIATOR) doing minute billing

Hugh Irvine hugh at open.com.au
Wed Jan 9 18:35:36 CST 2002


Hello Craig -

>
> 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?
>

As everything in radius is done in seconds, I would strongly suggest you stay 
with seconds in the database.

You can easily do seconds to minutes while post-processing the billing data.

regards

Hugh

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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