Dynamic session timeout

Sam T givemesam at gmail.com
Wed Oct 24 20:09:04 CEST 2018


Thank you so much for the reply. I'm working with my team and they tried to
implement the unlang you shared with me. The result was a very negative
value. We reversed it and it was the same but positive


       if (reply:WISPr-Session-Terminate-Time) {
         update reply {
         Session-Timeout := "%{expr:%{WISPr-Session-Terminate-Time} - %l}"
         }
       }

They broke down for me what they are trying to do, maybe this can help us
find tune the question

### RULES

GET 'date/time now', 'WISPr-Session-Terminate-Time', and Session-Timeout;
COMPARE 'date/time now' & 'WISPr-Session-Terminate-Time' and determine the
difference in seconds as "session-timeout-delta";
IF "session-timeout-delta" is less than Session-Timeout
ACTION set Session-Timeout = "session-timeout-delta";


Here are screen shots of the radius reply we received.

[image: image.png]

[image: image.png]

session timeout was reply'ed at = 1540400055
should have been 3600?
WISPr-Session-Terminate-Time = 2018-11-18T12:22:23+00:00

THANK YOU!

On Mon, Oct 15, 2018, 4:33 AM Alan DeKok <aland at deployingradius.com wrote:

> On Oct 14, 2018, at 1:25 PM, Sam T <givemesam at gmail.com> wrote:
> > Our application needs to timeout a user account and all devices with
> > activate sessions on that account at a specific time. Our  Service is
> > offered monthly and are unlimited data.
> >
> > Is SQL counter or some other module able to send session timeout
> > dynamically on the fly to accounts for a session that should only be
> 200min
> > vs 1440 for an session that needs to expire at a specific moment on all
> > devices?
>
>   The sqlcounter module tracks total time per month.  It can't disconnect
> people at a particular time.
>
> > I was thinking to make a sql query script to do a Delta calculation
> between
> > now and WISPr-Session-Terminate-Time and if that number is less than
> > session-timeout, to use that value.
> >
> > I feel like there may be a module in freeradius that may do this but I
> > could not figure if SQL counter does this.
>
>   You don't need an SQL query or a module.  Just use simple logic in
> "unlang".
>
>         if (reply:WISPr-Session-Terminate-Time) {
>                 update reply {
>                         Session-Timeout <=
> "%{expr:%{WISPr-Session-Terminate-Time} - %l}"
>                 }
>         }
>
>   See "man unlang" for the meaning of "<=".  And the "expr" module just
> does math.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 14785 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20181024/12493960/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 3640 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20181024/12493960/attachment-0003.png>


More information about the Freeradius-Users mailing list