freeradiuswispr

Wispr-Location-Id and Wispr-Location-Name saved when accounting


I have several Hotspots around the city, each one with different Wispr-Location-Id and Wispr-Location-Name. All these Hotspots use the same Radius server and share the same database.

Is there any way when accounting message is received to save this two parameters (Wispr-Location-Id and Wispr-Location-Name)

I need to know which clients roams from one Hotspot to another. Thanks!


Solution

  • You'll need to edit the queries specific to your database dialect:

    They can be found at /etc/(raddb|freeradius)/sql/<dialect>/dialup.conf

    https://github.com/FreeRADIUS/freeradius-server/blob/v2.x.x/raddb/sql/mysql/dialup.conf#L163

    You'll need to add the additional fields and values to the following queries: - accounting_start_query - accounting_stop_query - accounting_stop_query_alt

    an example of a modified accounting_start_query for MySQL would be:

    accounting_start_query = " \
          INSERT INTO ${acct_table1} \
            (acctsessionid,    acctuniqueid,     username, \
             realm,            nasipaddress,     nasportid, \
             nasporttype,      acctstarttime,    acctstoptime, \
             acctsessiontime,  acctauthentic,    connectinfo_start, \
             connectinfo_stop, acctinputoctets,  acctoutputoctets, \
             calledstationid,  callingstationid, acctterminatecause, \
             servicetype,      framedprotocol,   framedipaddress, \
             acctstartdelay,   acctstopdelay,    xascendsessionsvrkey,
             wisprlocationid,  wisprlocationname) \
          VALUES \
            ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \
             '%{SQL-User-Name}', \
             '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
             '%{NAS-Port-Type}', '%S', NULL, \
             '0', '%{Acct-Authentic}', '%{Connect-Info}', \
             '', '0', '0', \
             '%{Called-Station-Id}', '%{Calling-Station-Id}', '', \
             '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \
             '%{%{Acct-Delay-Time}:-0}', '0', '%{X-Ascend-Session-Svr-Key}',\
             '%{WISPR-Location-Name}', '%{WISPR-Location-ID}')"
    

    You'll also need to add additional string type columns in the radacct table to hold the additional values.