(RADIATOR) Two Accounting tables!!!
    Hakim Tass 
    hakim at kccg.net
       
    Fri Aug 10 06:38:41 CDT 2001
    
    
  
thanx!!!
Mangaged to do that!
regards
Hakim
-----Original Message-----
From: Hugh Irvine [mailto:hugh at open.com.au]
Sent: 10 August, 2001 11:01 AM
To: Hakim Tass; Radiator Mailing List
Subject: Re: (RADIATOR) Two Accounting tables!!!
Hello Hakim -
On Friday 10 August 2001 17:20, Hakim Tass wrote:
> hello Hugh!!
> i am attaching the current configuration file!
>
> well the current configuration is running just fine!
> except that the flat rate customers accounting information goes into the
> ACCOUNTINGTABLE and the AcctSQLStatement get executed!(nothing happens to
> database )(but time is lost in the execution of the queries which is not
> required)
> if some how i could separate the accountiing of the two <AuthBY SQL> it
> will be great! in that way i can have two separate accounting tables!
>
Here is what I would do:
############################################################################
#######################################
Foreground
LogStdout
Trace            4
AuthPort         1812
AcctPort         1813
DictionaryFile   .\dictionary.cisco
PidFile          .\radius.pid
LogFile          e:\radiator-2.18.2\logs\logs.txt
# define Client clause(s)
<Client DEFAULT>
         Secret mysecret
         DupInterval     20
</Client>
# define SessionDatabase SQL
<SessionDatabase SQL>
         Identifier  SDBSQL
         DBSource        dbi:ODBC:radius
         DBUsername      radius
         DBAuth          radius
         #AddQuery       insert into radoline ... DEFAULT IS WORKING FINE
</SessionDatabase>
# define AuthBy clauses
<AuthBy SQL>
         #this authby is for prepaid customers
         Identifier      PrePaidSQL
         DBSource        dbi:ODBC:radius
         DBUsername      radius
         DBAuth          radius
         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, \
               Class = PrePaid
         AccountingStopsOnly
         AccountingTable ACCOUNTINGTABLE
         #dont need the other accounting information for the time being
         AcctColumnDef   USERNAME,User-Name
         AcctColumnDef   CALLDATE,Timestamp,integer-date
         AcctColumnDef   ACCTSESSIONTIME,Acct-Session-Time,integer
         #this will update the balancetime for each session
         AcctSQLStatement update AUTHENTICATIONTABLE set \
               BALANCETIME = BALANCETIME-%{Acct-Session-Time} \
               where USERNAME = '%n'
         #this sql statement set the startdate and expirydate of the prepaid
         #customer first time he logs in
         AcctSQLStatement update AUTHENTICATIONTABLE set \
               startdate = GetDate(),expiryDate = GetDate()+30 \
               where (username='%n' and \
               startdate is null and expirydate is null)
</AuthBy>
<AuthBy SQL>
         # for FLAT RATE CUSTOMERS
         Identifier      FlatRateSQL
         DBSource        dbi:ODBC:radius
         DBUsername      radius
         DBAuth          radius
         AuthSelect select password from CUSTOMERS where username='%n'
         AuthColumnDef    0,Password,check
         AddToReply \
               Service-Type = Framed, \
               Framed-Protocol = PPP, \
               Class = FlatRate
</AuthBy>
# define Handlers
<Handler Request-Type = Accounting-Request, Class = PrePaid>
         AuthBy PrePaidSQL
</Handler>
<Handler Request-Type = Accounting-Request, Class = FlatRate>
         AuthBy FlatRateSQL
</Handler>
<Handler>
        MaxSessions 1
        AuthByPolicy ContinueUntilAccept
        AuthBy PrePaidSQL
        AuthBy FlatRateSQL
</Handler>
If you have any questions, please ask.
regards
Hugh
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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