Dynamic session timeout

Alan DeKok aland at deployingradius.com
Mon Oct 15 13:30:41 CEST 2018


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.




More information about the Freeradius-Users mailing list