RADIUS & Billing MVTS Pro

Brian Candler B.Candler at pobox.com
Sat Jan 21 12:31:39 CET 2012


Please note that it's rude to cross-post. This is a 'users' question, not a
'developers' question.

On Fri, Jan 20, 2012 at 03:18:53PM +0200, Mohamed Daif wrote:
>    all calls must be checked firstly from two tables then go to Specific
>    Gateways like below :
...
>    how can i add both tables to FreeRADIUS and make configuration to check
>    before sending calls to MVTS Servers.

What database backend are you using?

If you are using mysql (possibly others) then you can use stored procedures. 
Each one must return a single result set, with 5 columns in the correct
order.  However is can take as many arguments as you like.  e.g.

 authorize_check_query = "Call getCheck('%{User-Name}');"
 authorize_reply_query = "Call getReply('%{User-Name}');"
 group_membership_query = "Call getGroups('%{User-Name}');"
 authorize_group_check_query = "Call getGroupCheck('%{Sql-Group}');"
 authorize_group_reply_query = "Call getGroupReply('%{Sql-Group}');"

So you write the logic within the stored procedure to query as many
different tables as you like, in whatever order you like.

The other option is to have multiple instances of rlm_sql, and call them at
different points as required.  (However each instance of the module might
keep its own pool of connections to your SQL database)

sql sql_blacklist {
 ... blacklist queries go here
}

sql sql_whitelist {
 ... whitelist queries go here
}

Then you can call both sql_blacklist and sql_whitelist at whatever points
you require in your authorize { ... } block.

HTH,

Brian.



More information about the Freeradius-Users mailing list