Max-Daily-Session for current station only
Hi. I'd like to create a counter which is exactly like the Max-Daily-Session, but should count only the time consumed on the current Called-Station-Id only. This because using HuntGroups I'd like to allow the user to connect 1h from station A and 2h from station B. Having a look at the rlm_sqlcounter shipped with FR2 I find there are only three possible parameters to be used in the query, and this doesn't include the NAS. Any help on how to implement this counter? Thanks -- Lorenzo Milesi - lorenzo.milesi@yetopen.it YetOpen S.r.l. - http://www.yetopen.it/
Edit the query. They're text for a reason.
ok but I where do I get the Called-Station-Id parameter? thanks -- Lorenzo Milesi - lorenzo.milesi@yetopen.it YetOpen S.r.l. - http://www.yetopen.it/
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@yetopen.it YetOpen S.r.l. - http://www.yetopen.it/
participants (2)
-
Alan DeKok -
Lorenzo Milesi