radiusd
.SessionDatabase SQL
has a number of customisable
SQL statements (AddQuery, DeleteQuery, UpdateQuery, ReplaceQuery,
ClearNasQuery and CountQuery). These statements are used to add, remove,
maintain and count the entries in the SQL Session Database. The default
statements will work with the example RADONLINE table in the example SQL
schemas in the goodies directory. If you wish, you can use more or fewer
columns in your SQL Session Database, and you can change the names of the
columns or the table. If you do use a different table schema, you will
probably have to change statements to match your schema.goodies/hotspot.sql
for a sample database schema used
by goodies/hotspot-fidelio.cfg
.SessionDatabase
SQL
uses by defining one or more DBSource, DBUsername and
DBAuth lines. For more information about SQL configuration and failure
behaviour, see Section 3.8. SQL configuration.SessionDatabase SQL
is tolerant of database
failures. If your database server goes down, Radiator will try to
reconnect to a database as described above, starting again at the first
database you specified. Whichever database Radiator connects to, it will
stay connected to it until that database becomes unreachable, at which
time it will again search for a database, starting at the first again. If
on the other hand, Radiator is not able to connect to any SQL server, it
will stop enforcing Simultaneous-Use limits until one of its databases
comes back on line.SessionDatabase SQL
understands also the same
parameters as SessionDatabase xxxxxx
. For more
information, see Section 3.17. <SessionDatabase xxxxxx>. It supports
also all the common SQL configuration parameters. For more information
about the SQL configuration parameters, see Section 3.8. SQL configuration.DeleteQuery delete from RADONLINE where NASIDENTIFIER =? and NASPORT=? DeleteQueryParam %1 DeleteQueryParam %2
insert into RADONLINE (USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, NASPORTTYPE, SERVICETYPE) values (%0, '%1', %2, %3, %{Timestamp}, '%{Framed-IP-Address}', '%{NAS-Port-Type}', '%{Service-Type}')
delete from RADONLINE where NASIDENTIFIER='%1' and NASPORT=0%2
delete from RADONLINE where NASIDENTIFIER='%0'
select NASIDENTIFIER, NASPORT, ACCTSESSIONID, FRAMEDIPADDRESS \ from RADONLINE where USERNAME=%0
CountQuery select NASIDENTIFIER, NASPORT, ACCTSESSIONID, \ FRAMEDIPADDRESS from RADONLINE where USERNAME like ? CountQueryParam %%@%R
CountQuery select NASIDENTIFIER, NASPORT, ACCTSESSIONID, FRAMEDIPADDRESS \ from RADONLINE where CALLEDSTATIONID = ? CountQueryParam %{Called-Station-Id}
select ACCTSESSIONID from RADONLINE where NASIDENTIFIER='%0'
delete from RADONLINE where NASIDENTIFIER='%0' and ACCTSESSIONID = %1
# This vendor sends id of subsequent accounting session during authentication SessionIdentifier Vendor-Session-Id
AddSessionQuery
defaults
to:INSERT INTO SESSIONS (%0) VALUES (%1)
GetSessionQuery
defaults
to:SELECT * FROM SESSIONS WHERE tenant_id=%2 AND (name=%4 OR id=%3)
UpdateSessionQuery
defaults
to:UPDATE SESSIONS SET %0 WHERE tenant_id=%2 AND id=%3
DeleteSessionQuery
defaults
to:DELETE FROM SESSIONS WHERE tenant_id=%2 AND id=%3