--- Forwarded mail from [EMAIL PROTECTED]

Date: Tue, 20 Mar 2001 12:10:44 +1100 (EST)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: BOUNCE [EMAIL PROTECTED]:    Non-member submission from [Brett
Murphy <[EMAIL PROTECTED]>]

>From mikem  Tue Mar 20 12:10:35 2001
Received: by oscar.open.com.au (8.9.0/8.9.0) id MAA07043
        for [EMAIL PROTECTED]; Tue, 20 Mar 2001 12:10:35 +1100 (EST)
>Received: from mail.alphalink.com.au (mail.alphalink.com.au [203.24.205.7]) by
perki.connect.com.au with ESMTP id MAA13072
  (8.8.8/IDA-1.7 for <[EMAIL PROTECTED]>); Tue, 20 Mar 2001 12:01:37 +1100
(EST)
Received: from mail.alphalink.com.au (mail.alphalink.com.au [203.24.205.7]) by
perki.connect.com.au with ESMTP id MAA13072
  (8.8.8/IDA-1.7 for <[EMAIL PROTECTED]>); Tue, 20 Mar 2001 12:01:37 +1100
(EST)
Received: from noc.alphalink.com.au (noc.alphalink.com.au [202.161.122.66])
        by mail.alphalink.com.au (8.9.3/8.9.3) with ESMTP id MAA01040
        for <[EMAIL PROTECTED]>; Tue, 20 Mar 2001 12:01:29 +1000
Message-Id: <[EMAIL PROTECTED]>
X-Sender: [EMAIL PROTECTED]
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Tue, 20 Mar 2001 12:02:04 +1100
To: [EMAIL PROTECTED]
From: Brett Murphy <[EMAIL PROTECTED]>
Subject: Multiple SQL statements in radiator config
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi,

I have a session time totalling SQL statement I need to be dependant on
whether another INSERT fails or not, how can I issue 2 semi-colon separated
SQL statements in the AcctSQLStatement  ??

eg
#accounting first, adds octets and time used to fields in SUBSCRIBERS table
   <AuthBy SQL>
      Identifier      AcctSTORE_USED
      AuthSelect
      DBSource        dbi:mysql:blah
      DBUsername      rad
      DBAuth          ********
      AccountingStopsOnly
      AcctSQLStatement update SUBSCRIBERS SET
inoctets=(inoctets+0%{Acct-Input-Octets}),\
      outoctets=(outoctets+0%{Acct-Output-Octets}),\
      timeused=(timeused+0%{Acct-Session-Time}),\
      peaktimeused=peaktimeused+peaktime(%{Acct-Session-Time}) where
username=(TRIM(LEADING 'P' FROM '%n'))
   </AuthBy>

# now store the stop record
   <AuthBy SQL>
      Identifier      Acct_RADLAST
      AuthSelect
      DBSource        dbi:mysql:blah
      DBUsername      rad
      DBAuth          ********
      AcctSQLStatement INSERT DELAYED INTO ACCOUNTING
(USERNAME,TIME_STAMP,ACCTSTATUSTYPE,ACCTDELAYTIME,\
      
ACCTINPUTOCTETS,ACCTOUTPUTOCTETS,ACCTSESSIONID,ACCTSESSIONTIME,ACCTTERMINATECAUSE,NASIDENTIFIER,\
      
NASPORT,CALLINGSTATIONID,FRAMEDIPADDRESS,CONNECTSPEED,MODULATIONTYPE,MNPLEVELS,V42BISUSAGE,CALLEDSTATION)
\
      VALUES ((TRIM(LEADING 'P' FROM
'%n')),'%b','%{Acct-Status-Type}','%{Acct-Delay-Time}',\
      
'%{Acct-Input-Octets}','%{Acct-Output-Octets}','%{Acct-Session-Id}','%{Acct-Session-Time}',\
      '%{Acct-Terminate-Cause}','%N','%{NAS-Port}','%{Calling-Station-Id}',\
      
'%{Framed-IP-Address}','%{Connect-Speed}','%{Modulation-Type}','%{Simplified-MNP-Levels}','%{Simplified-V42bis-Usage}',\
      '%{Called-Station-Id}')
   </AuthBy>

The problem I have is when the brain dead NAS sends multiple stop records,
I add the sessiontime and data etc more than once.
I have handled the multiple stop records into the ACCOUNTING table by
setting the index keys appropriately to ignore multiple records.

I am guessing if I can incorporate both SQL functions into one, the second
will be dependant on the first completing successfully




All the best,
Brett Murphy
Director, Alphalink (Australia) PTY LTD
ph: +61 3 9495-9000 fax: +61 3 9486-6822
email: [EMAIL PROTECTED]

The contents of this message may not be quoted,
copied, reproduced or published in part or in whole,
without the written authorization of Brett Murphy,
Director, Alphalink (Australia) Pty Ltd.





---End of forwarded mail from [EMAIL PROTECTED]

-- 
Mike McCauley                               [EMAIL PROTECTED]
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory etc etc 
on Unix, Win95/8, 2000, NT, MacOS 9, MacOS X
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to