3.52.1. CountQuery Previous topic Parent topic Child topic Next topic

This parameter specifies an SQL query that will be used to count the users currently online according to the SQL Session Database. Defaults to “select COUNT(*) from RADONLINE where DNIS=’%{Called-Station-Id}’”. AuthBy PORTLIMITCHECK will compare the results of this query with SessionLimit in order to determine whether the user will be permitted to log in at all.
Tip
You must have a <SessionDatabase SQL> configured into Radiator. The Session Database must be configured to save the columns that you plan to use to group users in your CountQuery. So, if you are using the default CountQuery, your SQL Session Database must be configured to save the Called-Station-Id attribute to the DNIS column, with something like:
<SessionDatabase SQL>
      # We want to save the DNIS as well as the usual things.
      # Requires a different schema to the example RADONLINE provided
      AddQueryinsert into RADONLINE (USERNAME,\
      NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP,\
      FRAMEDIPADDRESS, NASPORTTYPE, SERVICETYPE, DNIS) \
      values (%0, '%N',\
      %{NAS-Port}, '%{Acct-Session-Id}', %{Timestamp},\
      '%{Framed-IP-Address}', '%{NAS-Port-Type}', \
      '%{Service-Type}', '%{Called-Station-Id}')
</SessionDatabase>