Define a virtual server to write the accounting packets. Any "listen" section that listens on an accounting port should set "virtual_server = write-detail.example.com
Write the "detail" files.
See raddb/modules/detail.example.com for more info.
That’s it!
Define a virtual server to process the accounting packets. Read accounting packets from the detail file(s) for the home server.
All packets read from the detail file are processed through the preacct && accounting sections.
The following text is copied verbatim from sites-available/default. You should edit it for your own local configuration.
Pre-accounting. Decide which accounting type to use.
Ensure that we have a semi-unique identifier for every request, and many NAS boxes are broken.
Read the 'acct_users' file
Accounting. Log the accounting data.
Create a 'detail’ed log of the packets. Note that accounting requests which are proxied are also logged in the detail file.
Update the wtmp file
If you don’t use "radlast", you can delete this line.
For Simultaneous-Use tracking.
Due to packet losses in the network, the data here may be incorrect. There is little we can do about it.
Return an address to the IP Pool when we see a stop record.
Ensure that &control.IP-Pool.Name is set to determine which
Log traffic to an SQL database.
NOTE! You will have to ensure that any accounting packets NOT handled by the SQL module (e.g. "stop with zero session length" result in the accounting section still returning "ok".
Otherwise, the server will think that the accounting packet was NOT handled properly, and will keep trying to process it through this virtual server!
See "Accounting queries" in mods-config/sql/main/$driver/queries.conf
Instead of sending the query to the SQL server, write it into a log file.
Cisco VoIP specific bulk accounting
Filter attributes from the accounting response.
See "Autz-Type Status-Server" for how this works.
Default Configuration
# This is a sample configuration for "decoupled" accounting.
# "Decoupled" accounting is where the accounting packets are
# NOT written "live" to the back-end database. This method
# can only be used if you are not interested in "live"
# accounting. i.e. Where you can tolerate delays that may be
# a few seconds, before accounting packets get written to
# the DB.
# Oddly enough, this method can speed up the processing of
# accounting packets, as all database activity is serialized.
# This file is NOT meant to be used as-is. It needs to be
# edited to match your local configuration.
server write_detail.example.com {
recv Accounting-Request {
detail.example.com
}
}
server read-detail.example.com {
listen {
type = detail
filename = "${radacctdir}/detail.example.com/detail-*:*"
load_factor = 10
track = yes
}
recv Accounting-Request {
acct_unique
files
}
send Accounting-Response {
detail
# daily
unix
radutmp
# sradutmp
 # pool of IPs are used.
sqlippool
# sql
# sql_log
# pgsql-voip
attr_filter.accounting_response
# Acct-Type Status-Server {
# }
}
}