I use this setup: In radiusd.conf I write a counter:
$INCLUDE ${confdir}/sql.conf sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session sqlmod-inst = sql key = User-Name reset = never query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}'" } When a user logs in, radius checks the counter: rlm_sql (sql): sql_set_user escaped user --> 'tagric15' radius_xlat: 'SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='tagric15'' rlm_sql (sql): Reserving sql socket id: 0 rlm_sql (sql): - sql_xlat finished rlm_sql (sql): Released sql socket id: 0 radius_xlat: '125168' rlm_sqlcounter: (Check item - counter) is greater than zero rlm_sqlcounter: Authorized user tagric15, check_item=99999999, counter=125168 rlm_sqlcounter: Sent Reply-Item for user tagric15, Type=Session-Timeout, value=99874831 modcall[authorize]: module "noresetcounter" returns ok for request 31 Of course the Max-All-Session attribute needs to be set for the user. My full radiusd.conf file is available at jabali.net/~carl under the phpMyPrepaid section. There are also notes in notes.txt Carl Peterson Jabali Networks On Wednesday 06 April 2005 21:53, Graeme Lee wrote: > Shahidul Islam wrote: > >Hello, > > > > I'd like to implement following scenario with freeradius: > > > > User has some specific time (say 3600 seconds) one can use. After the > > time is exceeded, radiusd return zero seconds as access-time for the > > user when one logs in. > > > > NAS requests allowed access-time when user logs in and returns used > > time to radiusd when user logs off. > > > > I'd like to store this information in sql-database (mysql). > > > >Babu > > > >- > >List info/subscribe/unsubscribe? See > > http://www.freeradius.org/list/users.html > > stored procedures and triggers are wonderful things. I have no > familiarity with mysql's abilities in this regard though. > > G > > > - > List info/subscribe/unsubscribe? See > http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html