Hello Brett -

I posted the following on this topic some time ago:

        http://www.starport.net/~radiator/2000-11/msg00114.html

If this won't work for you, I suggest you write a Hook which will be *much* 
easier to deal with.

hth

Hugh


>
> 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,ACCTTERMINAT
>ECAUSE,NASIDENTIFIER,\
> NASPORT,CALLINGSTATIONID,FRAMEDIPADDRESS,CONNECTSPEED,MODULATIONTYPE,MNPLEV
>ELS,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}','%{Simplifie
>d-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]

-- 
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.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