Author Topic: Help on Reading USER_EVENT  (Read 7776 times)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Help on Reading USER_EVENT
« on: June 04, 2007, 05:11:26 PM »
Hi
I'm trying to do the following, send and attached data to retrieve all customer numbers, but this returns as user_events.
I have tried to manipulate it but i believe my code is not the best of all as i have found that some times it doesn't catch the events. Why? Don't know, so i was wondering if anybody has a code developed and working to share?

Thanks a lot

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Re: Help on Reading USER_EVENT
« Reply #1 on: June 04, 2007, 11:06:03 PM »
Hi, Cavagnaro,

I had posted a program that attaches and retrieves attach data on this board. I think keywords were "outbound attach data". Is it what you need?

Why are you getting UserEvent when doing attach data request??? Am I missing something?

Best regards,
Vic

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Help on Reading USER_EVENT
« Reply #2 on: June 05, 2007, 02:26:47 AM »
My problem is that when you launch a user event with chained_records, OCS returns:

chained_record
chained_record
chainedrecords_end

and with them is the phone number.

So i want to show to the agent all the numbers of the customer so he can choose on which one he will do a reschedule (still working with Genesys on this issue).

My code is very complex so i was hoping someone has a cleaner way to do it or at least compare ideas.

Thanks

Offline jjavierv

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: Help on Reading USER_EVENT
« Reply #3 on: September 25, 2008, 12:45:08 AM »
I had done this accessing directly from the calling list table (I was running out of time  ::)).  How healthy is that?  :-\

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Help on Reading USER_EVENT
« Reply #4 on: September 25, 2008, 02:10:32 AM »
? That is impossible, the record handle is only make on the fly, no way to catch it from a table...please don't look the face at us.

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Re: Help on Reading USER_EVENT
« Reply #5 on: September 26, 2008, 02:21:35 AM »
I have not done it, but I wonder if issuing a mass of preview requests would do the trick. Is it what you are doing?

Vic

Offline dmans1

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Help on Reading USER_EVENT
« Reply #6 on: October 24, 2008, 01:35:43 PM »
I'm starting to write vb6 (activex toolkit) code to implement the preview dialing in my company's crm application.
My first idea is to get the preliminary customer data on the previewrecord user event , then start filling an array on the subsequent chainedrecord events and upon receiving the chainedrecordsdataend event raise an event up to the application's form so the accumulated data and phones can be requested from there.

Will post progress and errors if u are using vb6 too.

Offline dmans1

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Help on Reading USER_EVENT
« Reply #7 on: November 04, 2008, 02:04:39 PM »
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)