Hi! Thanks again for the help! the year 2000 was us playing with dates to see if we can learn about out issue. We are getting this error: Improperly nested variable; %{integer:reply:WISPr-Session-Terminate-Time}} rlm_expr: xlat failed. We have some syntax issue. Your advise is very helpful! User-Password in the request is correct. 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) {...} Improperly nested variable; %{integer:reply:WISPr-Session-Terminate-Time}} rlm_expr: xlat failed. expand: %{expr:%{%{integer:reply:WISPr-Session-Terminate-Time}} - %l} -> +++[reply] returns noop ++- if (reply:WISPr-Session-Terminate-Time) returns noop Sending Access-Accept of id 0 to 96.227.97.217 port 54434 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-11-02T12:22:23+00:00" Finished request 0. Going to the next request Waking up in 4.9 seconds. Cleaning up request 0 ID 0 with timestamp +4 Ready to process requests. On Thu, Nov 1, 2018 at 5:50 AM Alan DeKok <aland@deployingradius.com> wrote:
On Nov 1, 2018, at 12:01 AM, Sam T <givemesam@gmail.com> wrote:
As an update, we are aiming for getting the actual Session-Timeout value from the reply or the difference in seconds between now() and the WISPr-Session-Terminate-Time - Whichever value is smaller
Here is the new output
Any tips would be much appreciated!
/// 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: %{reply:WISPr-Session-Terminate-Time} - %l -> 2000-11-01T12:22:23+00:00 - 1541009986
OK, i't sprinting the session terminate time as a full date string. You can fix that by using:
%{expr:%{%{integer:reply:WISPr-Session-Terminate-Time}} - %l}
Which will print it as an integer.
WISPr-Session-Terminate-Time = "2000-11-01T12:22:23+00:00"
Note *also* that the termination year is 2000, or 18 years in the past. That has to be fixed, too. It MUST be in the future, otherwise the Session-Timeout will again be wrong.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html