计费时保存的Wispr-Location-Id和Wispr-Location-Name

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

我在城市周围有几个热点,每个都有不同的 Wispr-Location-Id 和 Wispr-Location-Name。所有这些热点都使用相同的 Radius 服务器并共享相同的数据库。

有没有办法在收到计费消息时保存这两个参数(Wispr-Location-Id 和 Wispr-Location-Name)

我需要知道哪些客户端从一个热点漫游到另一个热点。 谢谢!

您需要编辑特定于您的数据库方言的查询:

它们可以在 /etc/(raddb|freeradius)/sql/<dialect>/dialup.conf

找到

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

您需要将其他字段和值添加到以下查询中: - accounting_start_query - accounting_stop_query - accounting_stop_query_alt

MySQL 的修改 accounting_start_query 的示例是:

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}')"

您还需要在 radacct table 中添加额外的字符串类型列来保存额外的值。