On 04/15/2014 01:09 PM, Fernando Pizarro wrote:
Hi all!
I had configured MySQL to store sessions of the users and I have a lots of records with wrong acctsessiontime value because NAS are sent Accounting On/Off packets and the database is update with the actual timestamp.
Values in acctsessiontime, acctstarttime, acctstoptime etc. are all send by NAS, they are not not generated by freeradius. (Acct-Session-Time attribute and such)
I change deletestalesessions = no in sql.conf but the database is update too. What is the function of this parameter?
IIRC, records of such sessions will be overriden (sql update), so no new inserts will occur. However, how it works, depends on unique session id, the one in sql where condition rather than one sent by NAS. I have a hunch you mixed up that unique id:) Then you get updates on existing records and possibly override acctsessiontime.
There are some attribute to avoid stale sessions? I remember Idle-Timeout attribute but if the NAS isn't live the server never kill that session right?
Right. Again, first you need a way to identify user. Username is a good start;) Then, sort all user's sessions by acctstarttime. Only last one can have null acctstoptime. However, be very careful before deleting all other stale sessions. For even with acctstoptime empty, their acctsessiontime, bytesthis and octetsthat may and should get updated with interim packets. IOW, they stil may provide useful information for billing. Regards...