Dynamic session timeout

Sam T givemesam at gmail.com
Fri Nov 2 01:32:20 CET 2018


Hi Alan and Arran

Thank you for your feedback. So if this expression is indeed corrected now,
i guess my question lies with how to handle the output.

It appears that the function to get WISPr-Session-Terminate-Time as an
integer is resulting in a blank value

  if (reply:WISPr-Session-Terminate-Time) {
            update reply {

        # Session-Timeout :=
"%{expr:%{integer:reply:WISPr-Session-Terminate-Time} - %l}"
        # Session-Timeout := "%l"
        Session-Timeout := "%{integer:reply:WISPr-Session-Terminate-Time}"
            }
        }

Specifically,

Session-Timeout := "%{integer:reply:WISPr-Session-Terminate-Time}"

results in a blank value

/////

This returns noop

Login OK: [22-22-22-22-22-11/password] (from client wificpa port 0)
# Executing section post-auth from file
/etc/freeradius/sites-enabled/wifirush.rad
+- entering group post-auth {...}
++? if (reply:WISPr-Session-Terminate-Time)
? Evaluating (reply:WISPr-Session-Terminate-Time) -> TRUE
++? if (reply:WISPr-Session-Terminate-Time) -> TRUE
++- entering if (reply:WISPr-Session-Terminate-Time) {...}
        expand: %{integer:reply:WISPr-Session-Terminate-Time} ->
+++[reply] returns noop
++- if (reply:WISPr-Session-Terminate-Time) returns noop
Sending Access-Accept of id 105 to 96.227.97.217 port 63869
        WISPr-Bandwidth-Max-Up = 5000000
        WISPr-Bandwidth-Max-Down = 5000000
        Mikrotik-Rate-Limit = ""
        Acct-Interim-Interval = 300
        Session-Timeout = 0
        Idle-Timeout = 900
        WISPr-Session-Terminate-Time = "2018-12-02T12:22:23+00:00"
Finished request 3.
Going to the next request

//////////



%{expr:%{integer:reply:WISPr-Session-Terminate-Time} - %l}

the value being returned is not what we are expecting / Session-Timeout =
2753857926  / 2.7 Billion seconds is not what we were hoping for /
2753857926 seconds ago was July 28 1931

So, my question is, is the nested function,

{integer:reply:WISPr-Session-Terminate-Time}

actually converting into seconds or is it the value compared to epoch?

Any additional direction on how to handle the output, if correct, would be
greatly appreciated.


More information about the Freeradius-Users mailing list