On Fri, 2 Aug 2002 12:18:09 +0300
"Nikodim Nikodimov" <[EMAIL PROTECTED]> wrote:

> Hi freeradius users,
> 
> Which columns from the mysql database are for the Input and output
> traffic. And what is the dimension?
> 
> NN

Hi

You might like to try the following radacct table structure:

http://www.peternixon.net/freeradius/voip_radius.sql

I mentioned on the list a couple of days ago that I had been working on
this, but this is the first time I have given it to anyone. Please have a
look at this file before running it. You should make sure you understand
what sql.conf is doing..

I use the following modified lines in sql.conf

Note that I had some problems with some types of queries, and had to back
out the changes. I will update to the list when I have something alittle
nicer..

        accounting_start_query = "INSERT into radacct (RadAcctId,
AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NA
SPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic,
ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOct
ets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType,
FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, Ac
ctStatusType) values('', '%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Por
t-Id}', '%{NAS-Port-Type}', '%S', '0', '0', '%{Acct-Authentic}',
'%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Statio
n-Id}', '', '%{Service-Type}', '%{Framed-Protocol}',
'%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0', 'Start')"

        accounting_start_query_alt  = "UPDATE ${acct_table1} SET
AcctStartTime = '%S', AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_s
tart = '%{Connect-Info}', AcctStatusType = 'Start' WHERE AcctSessionId =
'%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAd
dress = '%{NAS-IP-Address}'"

        accounting_stop_query = "UPDATE ${acct_table1} SET AcctStopTime =
'%S', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets =
 '%{Acct-Input-Octets}', AcctOutputOctets = '%{Acct-Output-Octets}',
AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acc
t-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}', H323RemoteAddress =
'%{h323-remote-address}', AcctStatusType = 'Stop', h323confid = '
%{h323-conf-id}', h323calltype = '%{h323-call-type}', CiscoNASPort =
'%{Cisco-NAS-Port}', h323gwid = '%{h323-gw-id}', h323disconnectcause =
 '%{h323-disconnect-cause}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND
UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Addre
ss}'"

accounting_stop_query_alt = "INSERT into radacct (RadAcctId, AcctSessionId,
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPort
Type, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic,
ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets,
CalledStationId, CallingStationId, AcctTerminateCause, ServiceType,
FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, AcctSta
tusType, h323confid) values('', '%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}',
'%{NAS-IP-Address}', '%{
NAS-Port-Id}', '%{NAS-Port-Type}', '0', '%S', '%{Acct-Session-Time}',
'%{Acct-Authentic}', '', '%{Connect-Info}', '%{Acct-Input-Octets}', '
%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}',
'%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}'
, '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time}', 'Stop',
'%{h323-conf-id}')"

Cheers

-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc

Attachment: msg07534/pgp00000.pgp
Description: PGP signature

Reply via email to