RE: (Fwd) RE: (RADIATOR) (Fwd) can i have two accounting tables?

2000-10-17 Thread Hakim Tass

hi Hugh!!!
I am sorry about the wrong email address, and I apologize for the
inconvience that might have caused to you.

well this is what exactly i want to do.
We are planning to have two different type of subscription scheme. In the
first scheme the  subscription is charged on hourly basis while the other
one it is based on number of days/months.
I want to keep the accounting information for this two types in two
different accounting tables.

Regards
Hakim
-Original Message-
From: Hugh Irvine [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 17, 2000 4:41 AM
To: Hakim Tass; [EMAIL PROTECTED]
Subject: Re: (Fwd) RE: (RADIATOR) (Fwd) can i have two accounting
tables?



Hello Hakim -

Could you please send your mail to "[EMAIL PROTECTED]" please (not
[EMAIL PROTECTED])? Thanks.


 hi Hugh!!!

 I did try that before putting in my question to the mailing list.
 But some how the accounting is being done in the first AuthBy SQL clause
 that i mention.
 I am writing below the snapshot of the configuration file , perhaps i
might
 be making a mistake or missing out on something.

 For the first two AuthBy SQL clause i want the accounting to be done in
 accountingtable1
 while for the last clause i want the accounting in accountingtable2. (but
 here the accounting information is going in accountingtable2)

 Realm
 MaxSessions 1
 AuthByPolicy ContinueWhileReject
 AuthBy SQL
 DBSourcedbi:mysql:mydatabase
 DBUsername  
 DBAuth  
 AuthSelect select PASSWORD,BALANCETIME from
 AUTHENTICATIONTABLE where \
 (USERNAME='%n' and BALANCETIME  0 and (EXPIRY_DATE 
now()
 or EXPIRY_DATE IS NULL))
 AuthColumnDef   0,Password,check
 AuthColumnDef   1,Session-Timeout,reply
 AddToReply  Service-Type = Framed,Framed-Protocol =
PPP
 AccountingStopsOnly
 AccountingTable ACCOUNTINGTABLE1
 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
 # You can use this to force Radiator to limit
 # maximum session times to how many minutes
 # are left in subaccounts.timeleft
 AcctSQLStatement update AUTHENTICATIONTABLE set
BALANCETIME
 = BALANCETIME-%{Acct-Session-Time} \
  where USERNAME = '%n'
 /AuthBy
   AuthByPolicy ContinueWhileReject
 MaxSessions 1
 AuthBy SQL
   #accounting for this authby clause to go in accountingtable1
 # Change DBSource, DBUsername, DBAuth for your database
 # See the reference manual
 DBSourcedbi:mysql:mydatabase
 DBUsername  
 DBAuth  

 AuthSelect select PASSWORD,EXPIRY_DATE from UNLIMITED
where
 USERNAME='%n' and (EXPIRY_DATE  now() or EXPIRY_DATE is NULL)

 AuthColumnDef   0,Password,check
 AddToReply  Service-Type = Framed,Framed-Protocol =
PPP
 /AuthBy
  AuthByPolicy ContinueWhileReject
 AuthBy SQL

 DBSource dbi:mysql:mydatabase
 DBUsername 
 DBAuth 
 AuthSelect select password,balancetime from
 AUTHENTICATIONTABLE2 where (username='%n' and  status = 1)
 AuthColumnDef0,Password,check
 AuthColumnDef1,Session-Timeout,Reply
 AccountingStopsOnly
 AccountingTable accountingtable2
 AcctColumnDef   username,User-Name
 AcctColumnDef   calldate,Timestamp,formatted-date,to_date\
  ('%e %m %Y %H %M %S','DD MM 
 HH24:MI:SS')
 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   acc

RE: (Fwd) RE: (RADIATOR) (Fwd) can i have two accounting tables?

2000-10-17 Thread Hugh Irvine


Hello Hakim -

On Tue, 17 Oct 2000, Hakim Tass wrote:
 hi Hugh!!!
 I am sorry about the wrong email address, and I apologize for the
 inconvience that might have caused to you.
 
 well this is what exactly i want to do.
 We are planning to have two different type of subscription scheme. In the
 first scheme the  subscription is charged on hourly basis while the other
 one it is based on number of days/months.
 I want to keep the accounting information for this two types in two
 different accounting tables.
 

You would do something like this:

# configure SQLAuthentication1
AuthBy SQL
Identifier SQLAuthentication1
DBSourcedbi:mysql:mydatabase
DBUsername  
DBAuth  
AuthSelect select PASSWORD,BALANCETIME from \
AUTHENTICATIONTABLE where \
(USERNAME='%n' and BALANCETIME  0 and \
(EXPIRY_DATE  now() or EXPIRY_DATE IS NULL))
AuthColumnDef   0,Password,check
AuthColumnDef   1,Session-Timeout,reply
AccountingTable
/AuthBy

#configure SQLAccounting1
AuthBy SQL
Identifier SQLAccounting1
DBSourcedbi:mysql:mydatabase
DBUsername  
DBAuth  
AuthSelect 
AccountingStopsOnly
AccountingTable ACCOUNTINGTABLE1
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
# You can use this to force Radiator to limit
# maximum session times to how many minutes
# are left in subaccounts.timeleft
AcctSQLStatement update AUTHENTICATIONTABLE set \
BALANCETIME = BALANCETIME-%{Acct-Session-Time} \
where USERNAME = '%n'
/AuthBy

# configure SQLAuthentication2
AuthBy SQL
   Identifier SQLAuthentication2
DBSource dbi:mysql:mydatabase
DBUsername 
DBAuth 
AuthSelect select password,balancetime from \
AUTHENTICATIONTABLE2 where (username='%n' and  status = 1)
AuthColumnDef0,Password,check
AuthColumnDef1,Session-Timeout,Reply
AccountingTable
/AuthBy

# configure SQLAccounting2
AuthBy SQL
Identifier SQLAccounting2
DBSource dbi:mysql:mydatabase
DBUsername 
DBAuth 
AuthSelect 
AccountingStopsOnly
AccountingTable accountingtable2
AcctColumnDef   username,User-Name
AcctColumnDef   calldate,Timestamp,formatted-date,to_date\
 ('%e %m %Y %H %M %S','DD MM  HH24:MI:SS')
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   nasport,NAS-Port,integer
AcctColumnDef   clientipaddress,Framed-IP-Address
AcctSQLStatement update authenticationtable2 set \
 balancetime = balancetime-%{Acct-Session-Time}\
 where USERNAME = '%n'
/AuthBy SQL

# configure SQLAuthentication
AuthBy GROUP
Identifier SQLAuthentication
AuthByPolicy ContinueUntilAccept
AuthBy SQLAuthentication1
AuthBy SQLAuthentication2
AddToReply \
Service-Type = Framed-User, \
Framed-Protocol = PPP
/AuthBy


Realm
MaxSessions 1
AuthByPolicy ContinueAlways
AuthBy SQLAccounting1
AuthBy SQLAccounting2 
AuthBy SQLAuthentication

Re: (Fwd) RE: (RADIATOR) (Fwd) can i have two accounting tables?

2000-10-16 Thread Hugh Irvine


Hello Hakim -

Could you please send your mail to "[EMAIL PROTECTED]" please (not
[EMAIL PROTECTED])? Thanks.

 
 hi Hugh!!!
 
 I did try that before putting in my question to the mailing list.
 But some how the accounting is being done in the first AuthBy SQL clause
 that i mention.
 I am writing below the snapshot of the configuration file , perhaps i might
 be making a mistake or missing out on something.
 
 For the first two AuthBy SQL clause i want the accounting to be done in
 accountingtable1
 while for the last clause i want the accounting in accountingtable2. (but
 here the accounting information is going in accountingtable2)
 
 Realm
 MaxSessions 1
 AuthByPolicy ContinueWhileReject
 AuthBy SQL
 DBSourcedbi:mysql:mydatabase
 DBUsername  
 DBAuth  
 AuthSelect select PASSWORD,BALANCETIME from
 AUTHENTICATIONTABLE where \
 (USERNAME='%n' and BALANCETIME  0 and (EXPIRY_DATE  now()
 or EXPIRY_DATE IS NULL))
 AuthColumnDef   0,Password,check
 AuthColumnDef   1,Session-Timeout,reply
 AddToReply  Service-Type = Framed,Framed-Protocol = PPP
 AccountingStopsOnly
 AccountingTable ACCOUNTINGTABLE1
 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
 # You can use this to force Radiator to limit
 # maximum session times to how many minutes
 # are left in subaccounts.timeleft
 AcctSQLStatement update AUTHENTICATIONTABLE set BALANCETIME
 = BALANCETIME-%{Acct-Session-Time} \
  where USERNAME = '%n'
 /AuthBy
   AuthByPolicy ContinueWhileReject
 MaxSessions 1
 AuthBy SQL
   #accounting for this authby clause to go in accountingtable1
 # Change DBSource, DBUsername, DBAuth for your database
 # See the reference manual
 DBSourcedbi:mysql:mydatabase
 DBUsername  
 DBAuth  
 
 AuthSelect select PASSWORD,EXPIRY_DATE from UNLIMITED where
 USERNAME='%n' and (EXPIRY_DATE  now() or EXPIRY_DATE is NULL)
 
 AuthColumnDef   0,Password,check
 AddToReply  Service-Type = Framed,Framed-Protocol = PPP
 /AuthBy
  AuthByPolicy ContinueWhileReject
 AuthBy SQL
 
 DBSource dbi:mysql:mydatabase
 DBUsername 
 DBAuth 
 AuthSelect select password,balancetime from
 AUTHENTICATIONTABLE2 where (username='%n' and  status = 1)
 AuthColumnDef0,Password,check
 AuthColumnDef1,Session-Timeout,Reply
 AccountingStopsOnly
 AccountingTable accountingtable2
 AcctColumnDef   username,User-Name
 AcctColumnDef   calldate,Timestamp,formatted-date,to_date\
  ('%e %m %Y %H %M %S','DD MM 
 HH24:MI:SS')
 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   nasport,NAS-Port,integer
 AcctColumnDef   clientipaddress,Framed-IP-Address
 AcctSQLStatement update authenticationtable2 set balancetime
 = balancetime-%{Acct-Session-Time}\
  where USERNAME = '%n'
  /AuthBy SQL
 /Realm
 

Using two AuthBy SQL clauses like this will not work. Perhaps you could give me
a little more detail on what you want