> I'm playing with the idea of setting up accounts with a limited number of
> hours per month. I'm not using any commercial billing system
> (Platypus,emerald) to do this, only a mysql database. Has anyone played
> with this? Here are some ideas I have, I'm hoping someone with better ideas
> will share theirs.
I did this as I knew that when setting up radius that some bozo in
marketing would think it was a good idea..
I did it on a daily and monthly basis.
> and elapsed_time_month. max_time_month, if defined, would be the number of
> seconds we're going to allow the user to log on per month.
> elapsed_time_month is reset to zero at the beginning of each month with
> cron, and it grows each time the user logs off (we add Acct-Session-Time
> each time).
If you have a lot of NAS's and more than one radius server you are going
to want to some verification of the elapsed time say once a day. As it is
possible to get duplicate radius disco records.
> So, my auth statement would look something like this:
>
> AuthSelect select password, '' as CHECKATTR, if(elapsed_time_month <
> max_time_month && (max_time_month - elapsed_time_month ) > 36000,
> 'Session-Timeout=36000',
> concat('Session-Timeout=',max_time_month-elapsed_time_month)) as REPLYATTR
> from subscribers where username='%n' and suspended = 0;
>
> (I haven't tested the SQL yet, so don't cut and paste this!)
Pretty much the same for us..
> them a zero second timeout (bad idea?). One problem I just noticed is that
usually equates to no timeout..
> if I do not have a max_time_month defined, the user will never get on.
> Maybe I'd have to set a very high default?
I used a whole bunch of if then's in the SQL query.. though I am not sure
if you can do this in any SQL server other than mysql..
> Next, we have to process the stop accounting records. Here's where I get
> confused.
>
> Could I do something like this:
>
> AcctSQLStatement update subscribers set
> elapsed_time_month=elapsed_time_month+%{Acct-Session-Time};
OK... We did this all with scripts to off load as much of the CPU away
from our radius servers and radius auth databases and radiator..
We have 4 radius servers in diffrent parts of our network.. they all have
sync'd auth databases...2 servers are basicly auth servers and 2 servers
are accounting servers and backup auth....
We take and every 5 min rip the accounting records off of the acconting
servers and check for dups update the auth tables to be replicated and
throw them in our warehouse...
> It seems I'd have to use an AccountingStopsOnly here somewhere. How would I
> do this and keep logging everything to my detail file? Wow, am I getting
> too complex here? Is there a better way?
Radiator lets you do some scarry stuff...
There are examples of the time banking stuff in the complex config in the
contrib section I beleive..
We are very happy with our radiator setup..
--------------------------------------------------------------------------
James D. Butt 'J.D.' [EMAIL PROTECTED] - [EMAIL PROTECTED]
MidWest Communications, Inc.
--------------------------------------------------------------------------
===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.