liran tal wrote:
Waiting for that traffic limitation patch, Venkatesh.
Thanks.
Hi,
I was stuck with this problem too, and I came up with this solution,
which works in my test environment.
The idea is to store allowed bytes in Tmp-Integer-0, than just use
unlang to compare user's allowed and actual traffic bytes.
btw, maximum traffic count is 2^31 bytes, if you do it this way.
if(control:Tmp-Integer-0) {
if("%{sql:SELECT SUM(AcctOutputOctets+AcctInputOctets) FROM radacct
WHERE UserName='%{User-Name}' }" > "%{control:Tmp-Integer-0}" ) {
# traffic bytes limit reached
reject
}
}
Regards,
Flamur
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html