(RADIATOR) Compute the Start time from Timestamp and Acct-Session-Time

Lopez, A. a.lopez at tue.nl
Thu Jul 15 11:03:56 CDT 2004


Hello all,

I want to store in MySQL database accounting information of calls (using
the GNU gatekeeper).

This is part of my config:

 

AcctColumnDef USERNAME,User-Name,

AcctColumnDef CALLINGSTATIONID,Calling-Station-Id,

AcctColumnDef CALLEDSTATIONID,Called-Station-Id,

AcctColumnDef STOP_TIME, Timestamp, integer-date, %H:%M:%S,

AcctColumnDef DURATION_sec, Acct-Session-Time

 

Well, everything goes fine but I also want to store the Start Time of
the call in the format %H:%M:%S. 

I though it would be easy to compute the start time by subtracting the
Acct-Session-Time to the Timestamp, but I don't find the way to do it
(perhaps I should take a rest!)

Is it possible to do such a subtraction in the config file itself?? If
that's the case, what kind of command/syntax I should use??

 

I also tried to compute the start time using a PreProcessingHook, which
computes the difference and adds an attribute "Timestamp_start" 

 

sub {

        my $p=${$_[0]};

 

        $p->add_attr('Timestamp_start',  $p->get_attr('Timestamp') -
$p->get_attr('Acct-Session-Time'));

} 

 

After that, I add this line in the Config file, in order to store the
Timestamp in %H:%M:%S format:

 

AcctColumnDef START_TIME, Timestamp_start, integer-date, %H:%M:%S,

 

This adds wrong information to MySQL.

 

Any idea??

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20040715/bb3584ed/attachment.html>


More information about the radiator mailing list