Re: Time banking

Dale E. Reed Jr. ( (no email) )
Fri, 12 Jun 1998 16:05:49 -0700

2Day Internet wrote:
>
> I am testing my understanding of Time Banking.
>
> The text in the manual suggests an amount of time (in minutes) is allocated
> to a subaccount in column 'timeleft'.
>
> One would imagine there would be a trigger on the stop record insert which
> decremented 'time left' by the number of minutes spent in the last session.
> I dont see one in RadiusNT.sql
>
> You dont happen to have such a trigger sitting around waiting for a good
> home do you?

See below. The second part of the trigger must have been missed when the
radiusnt.sql file was created.

Alternately, you can turn on the Manual Service update to have RadiusNT
itself update the subaccounts.

CREATE TRIGGER calls_insert ON Calls
FOR INSERT
AS
UPDATE ServerPorts
Set sp.UserName = i.UserName,
sp.AcctStatusType = i.AcctStatusType,
sp.CallDate = DateAdd(Second, 0-i.AcctDelayTime, i.CallDate),
sp.FramedAddress = i.FramedAddress
FROM Servers s, ServerPorts sp, inserted i
WHERE s.IPAddress = i.NASIdentifier AND
s.ServerID = sp.ServerID AND
sp.Port = i.NASPort AND
(DateAdd(Second, 0-i.AcctDelayTime, i.CallDate) >= sp.CallDate OR
sp.CallDate IS NULL)

UPDATE SubAccounts
Set sa.TimeLeft = sa.TimeLeft - (i.AcctSessionTime/60 + 1)
FROM SubAccounts sa, inserted i
WHERE sa.login = i.UserName
and sa.TimeLeft <> NULL
and i.AcctStatusType = 2
GO

> My staging NAS is a Netserver/8i and it does not seem to be recognising the
> Session-Timeout attribute I can see RadiusNT sending it at authentication
> time.
>
> It just lets the user stay connected ... any ideas?

Check with USR to see if they support that attribute. Its possible that
they don't.

-- Dale E. Reed Jr.  (daler@iea-software.com)_________________________________________________________________       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |   http://www.iea-software.com