(RADIATOR) Two Accounting tables!!!
Hakim Tass
hakim at kccg.net
Thu Aug 9 12:50:23 CDT 2001
hello !!!
can i have two different accounting tables?
Here is what i am doing:-
i have two types of customers, Prepaid and the other is flat rate.
when the Prepaid users when they connect for the first time their start date
and expiry date are set and also the balance time gets deducted for every
session and the session information is stored in accountingtable.
when the flat rate customer connects only session information is to be
stored.
but since right now the AcctSQLStatement are one after the other, all of
them gets executed!
I want to separate this, any way to do it!
i have giving the sample configuration that i would ideally like to have!
(this one is not working though!)
here the accounting information of even FLAT RATE customers is going in
ACCOUNTINGTABLE instead OPTIGOLDACCOUNTING
so eventually when flat rate customers disconnects there are about 4 queries
which get executed unnecessarily (want to avoid this too)!
regards
Hakim
########SAMPLE CONFIGURATOIN
############################################################################
############
<AuthBy SQL>
Identifier SQLAuthentication1
DBSource dbi:ODBC:radius
DBUsername radius
DBAuth radius
# this is for the prepaid users
AuthSelect select PASSWORD,BALANCETIME from AUTHENTICATIONTABLE where
\
(USERNAME='%n' and BALANCETIME > 0)
AuthColumnDef 0,Password,check
AuthColumnDef 1,Session-Timeout,reply
AddToReply Service-Type = Framed,Framed-Protocol = PPP
AccountingStopsOnly
AccountingTable ACCOUNTINGTABLE
AcctColumnDef USERNAME,User-Name
AcctColumnDef CALLDATE,Timestamp,integer-date
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type,integer
AcctColumnDef ACCTDELAYTIME,Acct-Delay-Time,integer
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef \
ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTTERMINATECAUSE,Acct_Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-Identifier
AcctColumnDef NASIDENTIFIER,NAS-IP-Address
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef CLIENTIPADDRESS,Framed-IP-Address
#this is for the prepaid users
AcctSQLStatement update AUTHENTICATIONTABLE set BALANCETIME =
BALANCETIME-%{Acct-Session-Time} where USERNAME = '%n'
#couple of more sql statements here to set the startdate and expiry date on
first user
#AcctSQLStatement update authenticationtable set expriydate = GetDate() +
30 .....
</AuthBy>
<AuthBy SQL>
Identifier SQLAuthentication2
DBSource dbi:ODBC:radius
DBUsername radius
DBAuth radius
#this is for the flat rate customers
AuthSelect select password from CUSTOMERS where username='%n'
AuthColumnDef 0,Password,check
AccountingStopsOnly
AccountingTable OPTIGOLDACCOUNTING
AcctColumnDef USERNAME,User-Name
AcctColumnDef CALLDATE,Timestamp,integer-date
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type,integer
AcctColumnDef ACCTDELAYTIME,Acct-Delay-Time,integer
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef \
ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTTERMINATECAUSE,Acct_Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-Identifier
AcctColumnDef NASIDENTIFIER,NAS-IP-Address
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef CLIENTIPADDRESS,Framed-IP-Address
</AuthBy>
############################################################################
####################
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list