Re: CallsOnline

Dale E. Reed Jr. ( (no email) )
Wed, 21 Oct 1998 15:22:37 -0700

Ronnie D. Franklin wrote:
>
> I am trying to test beta code for Cisco.. and it has the update intermin
> packet available..
>
> Here is what is happening:
>
> Radius seems to be handling everything fine.. Start record, update
> intermin, and stop...
>
> However, Emerald 2.3xx gets the start record, displays the user in the calls
> online, and then when it gets the:
>
> update intermin record ACCT-STATUS-TYPE = 3
>
> the call disappears out of the table.. I assume because the ACCT-STATUS-TYPE
> equals 3 instead of 1...
>
> I am going to look at the stored procedures see if I can figure it out.. but
> I'm not all that good with SQL.. so if you can reply with a suggestion
> SOON.. I would appreciate it!!

This will only work with the trigger. Modify it like this:

CREATE TRIGGER calls_insert ON dbo.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) AND
AcctStatusType <= 2

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

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