(RADIATOR) Integer8 and AcctInsertQuery

Hugh Irvine hugh at open.com.au
Tue Jul 6 18:47:21 CDT 2004


Hello Herman -


On 6 Jul 2004, at 18:01, Herman verschooten wrote:

> Hi,
>  
> I am having a small problem... I am trying to execute a stored  
> procedure using AcctSQLStatement as such
>  
>  
> AcctSQLStatement exec AddSession  
> '%{Acct-Session-Id}','%{User-Name}',%{RB-Acct-Input-Octets-64},%{RB- 
> Acct-Output-Octets-64}
>  
> Now I have 2 problems... First, If there is not Accounting information  
> Radiator just blanks it out, second these values are in a hexidecimal  
> format (0x01234) which SQL does not convert to a numeric value.
>  

For the first problem you can use this:

AcctSQLStatement exec AddSession  
'%{Acct-Session-Id}','%{User-Name}',0%{RB-Acct-Input-Octets-64},0%{RB- 
Acct-Output-Octets-64}

which will use "0" if the value doesn't exist.

For the second problem your stored procedure should be able to parse  
the 0x1234 format by calling an internal routine.


> So I tried to use the AcctInsertQuery but how can I define which  
> column comes where in my statement if I use AcctColumnDef ?
>  
> AccountingTable TEST
> AcctColumnDef    AcctSessionID, Acct-Session-Id
> AcctColumnDef    CallDate, Timestamp, integer
> AcctColumnDef    Username, User-Name
> AcctColumnDef    AcctInputOctets,Acct-Input-Octets, integer
>
> AcctColumnDef    AcctOutputOctets,Acct-Output-Octets, integer
> AcctColumnDef    AcctInputOctets,RB-Acct-Input-Octets-64, integer
>
> AcctColumnDef    AcctOutputOctets,RB-Acct-Output-Octets-64, integer
> AcctInsertQuery exec AddSession %2
>  

The definition of AcctColumnDef's will cause Radiator to generate the  
SQL query internally.


> Thanks,
>  
> Herman
>


regards

Hugh



NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.

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