FreeRADIUS and Asterisk. Problem with accounting
Hi all. The problems start when I configure FreeRadius to insert RADIUS accounting data into SQL, in my case - postgreSQL database. I followed the steps on http://wiki.freeradius.org/SQL_HOWTO. FreeRadius creates SQL insert indeed, as you can see down below, but the thing is that the data from this table is totally useless, as e.g. acctstartime and acctstoptime fields are equal, which doesn't make sense. If we see the /var/log/radius/radacct/127.0.0.1/detail-20080107 file (see above), we can see that all of the AvPs are created in the SQL table, except the ones which have "Asterisk" as prefix (e.g. Asterisk-Acc-Code, Asterisk-Src, etc). I thought that FreeRadius will somehow map these values from Asterisk to values which can be put to radacct table, e.g. Asterisk-Start-Time ---> acctstarttime, etc. Obviously, it doesn't. I've been googling for whole day concerning this problem, and I wasn't able to find anything related to it, so probably other users had no problems with that. I assume that I would have to create a custom table for supporting asterisk RADIUS packets, but I wasn't able to find anything on google. I would appreciate any kind of help, hint, or advice. Paweł Plato
Pawel Plato wrote:
... I thought that FreeRadius will somehow map these values from Asterisk to values which can be put to radacct table,
Not everyone has an Asterisk server. There are standard RADIUS attributes which everyone else uses. See raddb/sql/mysql/dialup.conf. It contains the default queries used by the server. You can edit them to add anything you want. e.g.
Asterisk-Start-Time ---> acctstarttime, etc. Obviously, it doesn't. I've been googling for whole day concerning this problem, and I wasn't able to find anything related to it, so probably other users had no problems with that. I assume that I would have to create a custom table for supporting asterisk RADIUS packets, but I wasn't able to find anything on google. I would appreciate any kind of help, hint, or advice.
See raddb/sql/mysql/schema.sql. Both the schema and queries are editable. All of this is documented in the file "doc/rlm_sql", and in the comments at the start of the "raddb/sql.conf" file. There is *no* need to google for things when the server includes a large amount of documentation. Alan DeKok.
participants (2)
-
Alan DeKok -
Pawel Plato