Max-Daily-Session for current station only

Lorenzo Milesi maxxer at ufficyo.com
Wed Feb 26 18:20:03 CET 2014


>   From the packet.  That's why it's printed out in debug mode.
>  See "man unlang".  And the tons of other examples in the SQL
> sub-directories.

Thanks!
For the record I added this to sql/mysql/counter.conf:
sqlcounter max_daily_session_location {
            counter-name = Max-Daily-Session-Location
            check-name = Max-Daily-Session-Location
               reply-name = Session-Timeout
            sqlmod-inst = sql
            key = User-Name
            reset = daily
               query = "SELECT SUM(acctsessiontime - \
                 GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
                 FROM radacct WHERE username = '%{%k}' AND \
                 (UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b') \
                 AND calledstationid = '%{Called-Station-Id}' "
}

and "max_daily_session_location" in sites-available/default's authorize section.


-- 
Lorenzo Milesi - lorenzo.milesi at yetopen.it

YetOpen S.r.l. - http://www.yetopen.it/



More information about the Freeradius-Users mailing list