Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: eferreyra on May 28, 2007, 01:00:36 PM
-
Hi, there is any way of detect if an Agent is already logged in a T-Seerver from other machine ?
I know when i receive event registered if AgentID is set then already have an agent logged in the DN, i receive error as well, but this happens if is logged from the same machine (other application) and from other machine, there is any way to detec each case ?
Thanks!
-
if you monitor the agent in CCPulse, in extended status you can see the DN that the agent is logged into.
Mark
-
[quote author=eferreyra link=topic=2258.msg8187#msg8187 date=1180357236]
Hi, there is any way of detect if an Agent is already logged in a T-Seerver from other machine ?
I know when i receive event registered if AgentID is set then already have an agent logged in the DN, i receive error as well, but this happens if is logged from the same machine (other application) and from other machine, there is any way to detec each case ?
Thanks!
[/quote]
Hi,
there are many way to detect it. Do you want to do it programatically (how do you spell it???!) or via visual inspection? If you are trying to do it programatically (or whatever way you are trying to spell it), all you need to do is look at the user-data passed along EventRegistered: it will tell you if agent is already registered into this DN or not. It will also tell you which agent registered as well.
Here is a sample code of how to detect agent logged in and also as a bonus, connid of the call as well :)
It is a bit messy, but it works just fine :) Feel free to play with it and make things better!
[color=green][size=8pt]Private Sub TExtension1_TEventRegistered(Index As Integer, EventInfo As DesktopToolkitX.TEventInfo)
'first let's check if agent is logged in or not
Dim count, count2 As Integer
Dim total_count As Integer
Dim userList As DesktopToolkitX.CTKVList
Dim userPair As DesktopToolkitX.CTKVPair
Dim agentStatus As Integer
Dim line As DesktopToolkitX.TLine
Set userList = EventInfo.Extensions
total_count = userList.GetCount
For count = 0 To total_count - 1
Set userPair = userList.Get(count)
If userPair.Key = "AgentStatus" Then
agentStatus = userPair.NumValue
' let's see if we need to log someone out!
If (Me.chkForcedLogout) Then
Select Case agentStatus
'logged out
Case 0:
'logged in
Case 1, 2, 3, 4, 5:
'agent is logged in
gAgentLoginID = EventInfo.AgentID
'check if user checked logout checkmark
' we need to logout this agent
For count2 = 0 To DN_Count - 1
If (Me.TExtension1(count2).TDN = EventInfo.ThisDN) Then
Me.TExtension1(count2).TLogout
End If
Next count2
End Select
End If
Else
If userPair.Key = "conn-1" Then
'let's get the connid
gConnID = userPair.StringValue
If Me.chkForcedRelease.Value = 1 Then
For count2 = 0 To DN_Count - 1
If (Me.TExtension1(count2).TDN = EventInfo.ThisDN) Then
'let's try to release this call
Me.TExtension1(count2).TGetActiveCallObj.THangUp
End If
Next count2
' line.ExtensionName = Me.TExtension1(2).Name
' line.THangUp
End If
End If
End If
[/size][/color]
-
Thanks very helpfull, im going to check the user data, but still i dont see in the example how to detect (assuming already logged AgentId is the same that is loggin now) if is logged on the same machine/terminal or in other.
Im going to pay more attention to user data ;D
-
Well, when you try to connect to TServer and send RequestRegisterAddress, the reply would tell you that somebody is already on it.
Do you mean some other way?
-
I cant find RequestRegisterAddress, i dont send this and dont see how...
sorry my ignorance...
-
Hi, Eferreyra,
do you mean you need the full sample of how to do it?
Sure, let me put something together for you :)
Best regards,
Vic
-
Where would you use this code? I mean how would you run it, is it in ccPulse or the toolkit?
-
In the toolkit, those agentstatus (1,2,3,4,5) are pretty usefull. :D
No remember where i saw the exact meaning of each on of them, something like:
1= Logged In and Ready
2= Logged In and Not Ready
....
Any ideas?
-
[quote author=cavagnaro link=topic=2258.msg9623#msg9623 date=1192209666]
In the toolkit, those agentstatus (1,2,3,4,5) are pretty usefull. :D
No remember where i saw the exact meaning of each on of them, something like:
1= Logged In and Ready
2= Logged In and Not Ready
....
Any ideas?
[/quote]
I just happened to be digging through the .NET GAD toolkit for 7.2, so I pulled these out for your reference. I'm still VERY new to Genesys, so this might not even be what you're looking for, so I apologize ahead of time if this isn't helpful. But this was found by digging through the .NET Multimedia Sample application and looking at how they reference the AgentStatus property.
public enum AgentMediaAction
{
LOGIN = 0,
LOGOUT = 1,
READY = 2,
NOT_READY = 3,
CREATE_INTERACTION = 4,
}
public enum MediaState
{
UNKNOWN = -1,
OUT_OF_SERVICE = 0,
LOGGED_OUT = 1,
NOT_READY = 2,
BUSY_NOT_READY = 3,
READY = 4,
BUSY_READY = 5,
}
public enum MediaType
{
VOICE = -2,
UNKNOWN = 0,
CHAT = 1,
EMAIL = 2,
}
-
???
This is a GAD issue, logoff and on.
-
what? What is a GAD issue?