accounting_start_query = "INSERT into ${acct_table1}%{h323-call-type} \
- (RadiusServerName, AcctSessionId, UserName, NASIPAddress, AcctStartTime, \
+ (RadiusServerName, AcctSessionId, UserName, NASIPAddress, AcctTime, \
CalledStationId, CallingStationId, AcctDelayTime, \
h323gwid, h323callorigin, h323calltype, h323setuptime, h323confid) \
values('${radius_server_name}', '%{Acct-Session-Id}', '%{SQL-User-Name}', \
- '%{NAS-IP-Address}', '%S', '%{Called-Station-Id}', \
+ '%{NAS-IP-Address}', (now() - '%{Acct-Delay-Time:-0}'::interval), '%{Called-Station-Id}', \
'%{Calling-Station-Id}', '%{Acct-Delay-Time:-0}', '%{h323-gw-id}', \
'%{h323-call-origin}', '%{h323-call-type}', strip_dot('%{h323-setup-time}'), '%{h323-conf-id}')"
accounting_stop_query = "INSERT into ${acct_table2}%{h323-call-type} \
- (RadiusServerName, AcctSessionId, UserName, NASIPAddress, AcctStopTime, \
- AcctSessionTime, AcctAuthentic, AcctInputOctets, AcctOutputOctets, \
- CalledStationId, CallingStationId, AcctTerminateCause, FramedProtocol, \
- AcctDelayTime, H323RemoteAddress, AcctStatusType, CiscoNASPort, h323calltype, h323callorigin, h323confid, \
+ (RadiusServerName, AcctSessionId, UserName, NASIPAddress, AcctTime, \
+ AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \
+ AcctDelayTime, H323RemoteAddress, CiscoNASPort, h323calltype, h323callorigin, h323confid, \
h323connecttime, h323disconnectcause, h323disconnecttime, h323gwid, h323setuptime) \
values('${radius_server_name}', '%{Acct-Session-Id}', '%{SQL-User-Name}', \
- '%{NAS-IP-Address}', '%S', '%{Acct-Session-Time:-0}', '%{Acct-Authentic}', \
- '%{Acct-Input-Octets:-0}', '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', \
- '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Framed-Protocol}', \
- '%{Acct-Delay-Time:-0}', '%{h323-remote-address}', 'Stop', '%{Cisco-NAS-Port}', \
- '%{h323-call-type}', '%{h323-call-origin}', '%{h323-conf-id}', strip_dot('%{h323-connect-time}'), \
- '%{h323-disconnect-cause}', strip_dot('%{h323-disconnect-time}'), '%{h323-gw-id}', strip_dot('%{h323-setup-time}'))"
+ '%{NAS-IP-Address}', (now() - '%{Acct-Delay-Time:-0}'::interval), '%{Acct-Session-Time:-0}', \
+ '%{Acct-Input-Octets:-0}', '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', \
+ '%{Acct-Delay-Time:-0}', '%{h323-remote-address}', '%{Cisco-NAS-Port}', '%{h323-call-type}', \
+ '%{h323-call-origin}', '%{h323-conf-id}', strip_dot('%{h323-connect-time}'), '%{h323-disconnect-cause}', \
+ strip_dot('%{h323-disconnect-time}'), '%{h323-gw-id}', strip_dot('%{h323-setup-time}'))"
}