Hello Greg -

You are correct - there are no Acct-Start-Time or Acct-Stop-Time attributes.

You can either write a PreClientHook to add the corresponding pseudo-attributes to the accounting starts and accounting stops, or you can set up different Handlers.

# define Handlers

<Handler Acct-Status-Type = Start>
.....
</Handler>

<Handler Acct-Status-Type = Stop>
.....
</Handler>

<Handler Request-Type = Accounting-Request>
.....
</Handler>

<Handler>
.....
</Handler>


There are some example hooks in the file "goodies/hooks.txt".

regards

Hugh


On Friday, October 11, 2002, at 01:16 PM, Greg 'Rafiq' Clarkson wrote:

Hi all,

I am currently working with a contractor to integrate radiator 3.3.1 with
freeside 1.4

My freeside expert want me to insert 'Acct-Start-Time' and 'Acct-Stop-Time'
values into an sql database.

The only values I know are 'start' and 'stop' records along with
acct-session-time.

I have grepped the dictionaries for these values without success.

Do they exist as RADIUS attributes?

BTW I know about the example in the manual:
AcctColumnDef START_TIME,%b-0%{Acct-Session-Time},literal

So just to test it I actually created 'Acct-Start-Time' and 'Acct-Stop-Time'
(see below) and they do insert timestamps into the database. However, they
insert the SAME timestamp into each field.

My freeside contractor wants it to only write into the acctstarttime field
when it is a start record and into the acctstoptime field when it is a stop
record.

Anyhow for what it is worth I have included a reduced version of my config
file below.


#
# this is called by /usr/local/etc/rc.d/radius.sh
#####################################################################
##
## Variable Definitions
##

DefineGlobalVar dbSpec dbi:Pg:dbname=radtest;host=localhost
DefineGlobalVar dbUser XXXXXXX
DefineGlobalVar dbPass XXXXXX
######################################################################
##
## Global parameters
##

Trace 4

PidFile /var/run/radiator.pid

User radiator
Group radiator

"radius-radacct.cfg" 133 lines, 3448 characters written
greg@wiz-fiz:~: % cat radius-radacct.cfg
# Configuration file for the Radiator RADIUS server.
#
# this is called by /usr/local/etc/rc.d/radius.sh
#####################################################################
##
## Variable Definitions
##

DefineGlobalVar dbSpec dbi:Pg:dbname=radtest;host=localhost
DefineGlobalVar dbUser XXXXXXX
DefineGlobalVar dbPass XXXXXX
######################################################################
##
## Global parameters
##

Trace 4

PidFile /var/run/radiator.pid

User radiator
Group radiator

BindAddress 0.0.0.0
AuthPort 1812
AcctPort 1813

DbDir /usr/local/etc/radiator
DictionaryFile %D/dictionary

LogDir /var/log/radius
# change logfile to null GC 120902
LogFile
#LogFile %L/logfile.%Y-%m-%d

UsernameCharset a-zA-Z0-9\.\-_/%#@
# rewrite usernames to lowercase
RewriteUsername tr/A-Z/a-z/

######################################################################
##
## Client Definitions
##

######################################################################
##
## AuthBy Definitions
##

<AuthBy SQL>
Identifier freeradius
NoDefault
IgnoreAccounting
DBSource %{GlobalVar:dbSpec}
DBUsername %{GlobalVar:dbUser}
DBAuth %{GlobalVar:dbPass}
# AuthSelect
</AuthBy>

<AuthBy RADIUS>
Identifier RadiusProxyAuth
IgnoreAccounting
Host XXXXXXXXX
Secret XXXXXXXXX
AuthPort 1812
AcctPort 1813
</AuthBy>

<AuthBy SQL>
Identifier freeradius
IgnoreAuthentication
DBSource %{GlobalVar:dbSpec}
DBUsername %{GlobalVar:dbUser}
DBAuth %{GlobalVar:dbPass}
HandleAcctStatusTypes Start,Stop
DateFormat %Y-%m-%d %H:%M:%S

AccountingTable radacct
AcctColumnDef acctsessionid,Acct-Session-Id
AcctColumnDef acctuniqueid,Acct-Unique-Id
AcctColumnDef username,User-Name
AcctColumnDef acctstatustype,Acct-Status-Type
AcctColumnDef nasipaddress,NAS-IP-Address
AcctColumnDef nasportid,NAS-Port,integer
AcctColumnDef nasporttype,NAS-Port-Type
AcctColumnDef acctstarttime,Acct-Start-Time,integer
AcctColumnDef acctstoptime,Acct-Stop-Time,integer
#AcctColumnDef acctstoptime,Timestamp,integer-date
AcctColumnDef acctsessiontime,Acct-Session-Time,integer
AcctColumnDef acctauthentic,Acct-Authentic,
AcctColumnDef connectinfo_start,Connect-Info
AcctColumnDef acctinputoctets,Acct-Input-Octets,integer
AcctColumnDef acctoutputoctets,Acct-Output-Octets,integer
AcctColumnDef calledstationid,Called-Station-Id
AcctColumnDef callingstationid,Calling-Station-Id
AcctColumnDef acctterminatecause,Ascend-Disconnect-Cause
AcctColumnDef servicetype,Service-Type
AcctColumnDef framedprotocol,Framed-Protocol
AcctColumnDef framedipaddress,Framed-IP-Address
#AcctColumnDef acctstartdelay,Acct-Delay-Time,integer
AcctColumnDef acctstopdelay,Acct-Delay-Time,integer

AcctFailedLogFileName %L/detail.freeradius
</AuthBy>


######################################################################
##
## SessionDatabase
##

######################################################################
##
## Logging
##

######################################################################
##
## Handler Definitions
##

<Handler Request-Type=Accounting-Request>
AcctLogFileName %L/detail_acc.%Y-%m
AuthByPolicy ContinueAlways
AuthBy freeradius
</Handler>

<Handler>
AcctLogFileName %L/detail
AuthByPolicy ContinueUntilAccept
AuthBy freeradius
AuthBy RadiusProxyAuth
</Handler>
greg@wiz-fiz:~: %

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.


NB: I am travelling this week, so there may be delays in our correspondence.

--
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 [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to