Sure, here is how to connect:
Public Function TConnect() As Boolean
Call TConnection.ConfigureAddp(10, 20, addpTraceFull)
Call TConnection.EnableAddp(True)
' Control connection parameters
If IsEmpty(Me.TServer) = True Or IsEmpty(Me.TPort) = True Then
' Log.WriteAs getLogFileName(), "class.TConnect", -1, -1, "Connection parameters missing."
TConnect = False
Exit Function
End If
' Log.WriteAs getLogFileName(), "class.TConnect", 1, 0, "THost is " + Me.TServer + " @ " + Me.TPort
If frmTelephony.TConnection.TConnect() = False Then
' Log.WriteAs getLogFileName(), "class.TConnect", -1, -1, "Could not connect to TServer"
TConnect = False
Exit Function
End If
' Log.WriteAs getLogFileName(), "class.TConnect", 1, 0, "Connecting to TServer..."
TConnect = True
End FunctionHere is how I would register:
Private Sub TConnection_TEventLinkConnected(EventInfo As DesktopToolkitX.TEventInfo)
numOfRegisteredQueues = 0
Call myWatch.setCallResult(EventLinkConnected, "", "Event", 0)
If myWatch.numOfChannels = 0 Then
' Log.WriteAs getLogFileName(), "TConnection.TEventLinkConnected", -1, 0, "Because channels (DNs) not set and initialized, main program couldn't continue."
If Me.TConnection.TDisconnect() = False Then
' Log.WriteAs getLogFileName(), "TConnection.TEventLinkConnected", -1, 0, "Couldnt Disconnect from TServer"
End If
Exit Sub
End If
Dim rs As TStatus
Dim i As Integer
' if you are watching more than one DN, numOfChannels would be 2 <-- Nortel for example
For i = 1 To myWatch.numOfChannels
' Log.WriteAs getLogFileName(), "TConnection.TEventLinkConnected", 1, 1, "Processing " + Trim(Str(i))
Call Me.TExtension(i).TSetRegisterMode(ModeMonitor)
rs = Me.TExtension(i).TRegister()
If rs = T_FAIL Then
' Log.WriteAs getLogFileName(), "TConnection.TEventLinkConnected", -1, 0, "Couldnt register Channel " + Trim(Str(i))
Else
' Log.WriteAs getLogFileName(), "TConnection.TEventLinkConnected", 1, 0, "Registering Channel " + Trim(Str(i))
End If
Next i
End SubUmmm... What else? It is pretty straight-forward really...
Here is how you would query for agent status on that DN, because you would not want to try to login agent who is already logged in, right?
Public Sub Get_DN_Info(Index As Integer, dn As String)
Dim rs As TStatus
rs = TExtension(Index).TQueryAddress(AddressInfoDNStatus)
End Sub
Here is how you would get Attach-Data:
Private Sub TExtension_TEventAttachedDataChanged(Index As Integer, EventInfo As DesktopToolkitX.TEventInfo)
Dim i As Integer
Dim sName As String
Dim sValue As String
Dim connId As String
Dim AgentId As String
connId = vbNullString
connId = EventInfo.connId.GetConnIDAsStr()
AgentId = vbNullString
AgentId = EventInfo.AgentId
For i = 0 To EventInfo.userData.GetCount - 1
sName = vbNullString
sValue = vbNullString
sName = EventInfo.userData.Get(i).Key
If EventInfo.userData.Get(i).Type = CKVTypeNum Then
sValue = Str(EventInfo.userData.Get(i).NumValue)
Else
sValue = EventInfo.userData.Get(i).StringValue
End If
Call myWatch.setUserData(Index, connId, AgentId, sName, sValue)
Next i
End Sub
Please tell me if you need anything else
Genesys ActiveX is really a breeze to program and actually works enough to make it enjoyable. They provide you with ActiveX sample which pretty much is self-explanatory.
If you have a question - feel free to ask
Vic