#table to keep radius client info
nas_table = "nas"
-
+
# Remove stale session if checkrad does not see a double login
deletestalesessions = yes
AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL"
accounting_stop_query = "UPDATE ${acct_table2} \
- SET AcctStopTime = (now() - '%{Acct-Delay-Time:-0}'::interval), AcctSessionTime = '%{Acct-Session-Time}', \
+ SET AcctStopTime = (now() - '%{Acct-Delay-Time:-0}'::interval), \
+ AcctSessionTime = NULLIF('%{Acct-Session-Time}', '')::bigint, \
AcctInputOctets = (('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), \
AcctOutputOctets = (('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), \
AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time:-0}', \
AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStopDelay) \
values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \
'%{NAS-Port}', '%{NAS-Port-Type}', (now() - '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), \
- (now() - '%{Acct-Delay-Time:-0}'::interval), '%{Acct-Session-Time}', '%{Acct-Authentic}', '%{Connect-Info}', \
+ (now() - '%{Acct-Delay-Time:-0}'::interval), NULLIF('%{Acct-Session-Time}', '')::bigint, \
+ '%{Acct-Authentic}', '%{Connect-Info}', \
(('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), \
(('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), '%{Called-Station-Id}', \
'%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', \