different cost for different services

Mike Puchol mike at tech.am
Wed Jun 4 12:01:36 CEST 2008


Once upon a midnight dreary, "sub" pondered, weak and weary:

> Hello everybody,
> I'm going to set-up different services that are going to use the same
> freeradius server and accounts.
> So actually I have user X that with the same username/password can use
> service A and service B connecting from different NAS; services have a
> different cost to the end user.
> 
> Is it possibile to configure freeradius in such a way where, for me,
> cost means a different amount of seconds?
> 
> Thanks,
> sub
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Hi sub,

I have something like this working against Oracle, where we check using a
stored procedure, which in turn grabs the username, the WISP location ID,
and calculates the session time based on the price per minute.

For example:

authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM RADREPLY
WHERE Username = '%{SQL-User-Name}' UNION SELECT
0,'%{SQL-User-Name}','Session-Timeout',sess_time('%{WISPr-Location-ID}'),
'%{SQL-User-Name}'),'==' from dual"

Sess_time is a stored procedure which gets passed the username and the WISP
ID, and returns the max session time.

Hope it helps,

Mike





More information about the Freeradius-Users mailing list