RES: RES: freeradius disconnect user using accounting
Alan DeKok
aland at deployingradius.com
Wed Apr 8 17:15:24 CEST 2015
On Apr 8, 2015, at 10:21 AM, Leandro Melo - Netsul Telecom <leandromelo at netsulinternet.com.br> wrote:
> thanks for the reply, using the session-timeout attribute in radreply works perfectly, but I need to create a global setting to disconnect all connections have the same time session-timeout and do not want to apply this setting on each connection in radreply.
That should be simple.
> Another factor that is most important to perform this routine so do I need to disconnect the customer only between the hours of 00: 00hs to 06: 00hs, ie, even if the connection has reached its timeout the radius will expect the condition of time be pleased to disconnect the connection, something like this:
>
> if ("% {Acct-Session-Time}"> 30 && ($ (date + "% k") -g 0 && $ (date + "% k") -lt 6)) {
> # Disconnects the connection
> }
You can do pretty much this. See the "expr" module to do math:
if ((Acct-Session-Time > 30) && ("%{expr: 1 + 2}" < 4)) {
...
You can get the current time in a variety of formats. See:
http://wiki.freeradius.org/config/Run%20time%20variables
Alan DeKok.
More information about the Freeradius-Users
mailing list