Done it!!
USER EVENT HANDLING SUB
[code]Private Sub Connection1_TEventUserEvent(EventInfo As DesktopToolkitX.TEventInfo)
Dim i As Integer
If EventInfo.UserData.IsEmpty = False Then
For i = 0 To EventInfo.UserData.GetCount - 1
Select Case EventInfo.UserData.Get(i).Key
Case "GSW_USER_EVENT"
handle_user_event EventInfo, EventInfo.UserData.Get(i).StringValue
Case "GSW_ERROR"
Debug.Print "Error: " & EventInfo.UserData.Get(i).StringValue
RaiseEvent TError(EventInfo)
Case "GSW_APPLICATION_ID"
If EventInfo.UserData.Get(i).Type = 0 Then
GSW_APPLICATION_ID = EventInfo.UserData.Get(i).StringValue
Else
GSW_APPLICATION_ID = EventInfo.UserData.Get(i).NumValue
End If
Case "GSW_RECORD_HANDLE"
If EventInfo.UserData.Get(i).Type = 0 Then
GSW_RECORD_HANDLE = EventInfo.UserData.Get(i).StringValue
Else
GSW_RECORD_HANDLE = EventInfo.UserData.Get(i).NumValue
End If
Case "GSW_CAMPAIGN_NAME"
If EventInfo.UserData.Get(i).Type = 0 Then
CAMPAIGN_NAME = EventInfo.UserData.Get(i).StringValue
Else
CAMPAIGN_NAME = EventInfo.UserData.Get(i).NumValue
End If
.
.
.
.
.
End Select
Next i
End If
End Sub[/code]
HANDLE USER EVENT METHOD
[code]Private Sub handle_user_event(EventInfo As DesktopToolkitX.TEventInfo, UsereventType As String)
Dim i As Integer
Select Case UsereventType
Case "PreviewRecord"
Call set_m_chainedphones(EventInfo, True)
Call ChainedRecordRequest(CAMPAIGN_NAME)
Case "ChainedRecord"
Call set_m_chainedphones(EventInfo, False)
Case "ChainedRecordsDataEnd"
RaiseEvent TEventChainedRecordEnded(EventInfo)
End Select
End Sub[/code]
The basic idea in the above logic is:
1. Call the RequestPreviewrecord
2. Catch the PreviewRecord ACK that the server sends,read the attached data that contain some basic customer info and put the customer's phone ,the GSW_RECORD_HANDLE,GSW_CALL_ATTEMPTS,GSW_CALL_RESULT in the 1st line of an array.
3. Then call a ChainedRecordRequest catch subsequent events that the server sends and further fill up the phones array.
4.Upon receiving the ChainedRecordsDataEnd ACK i raise an event that's listened by the crm application that does it;s stuff
(reads the phones array and the customer data that's handled from the OCS)