Author Topic: EventUserEvent is not received when sending RequestDistributeUserEvent  (Read 4782 times)

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
After the EventReleased is received, I want to attach some data for future reporting purpose. I sent RequestDistributeUserEvent to my DN itself with some KeyValuePair:

KeyValueCollection info = new KeyValueCollection();
info.Add("CallDroppedBy", "Agent");
info.Add("CallTimeExceeded", "No");

CommonProperties commonProp = CommonProperties.Create();
commonProp.ConnID = connID1;
commonProp.ThisDN = thisDN;
commonProp.UserData = info;

RequestDistributeUserEvent reqDistributeUserEvent = RequestDistributeUserEvent.Create(thisDN, commonProp);
IMessage reqDUEResponse = tServerProtocol.Request(reqDistributeUserEvent);
RequestResponse_Router(reqDUEResponse);

When I debug my application (by the way, I'm using C#.NET to develop an agent desktop), I found that the Request is sent, but I received EventACK with no userdata. How can I receive EventUserEvent with the userdata that I attached so that it can be used for reporting purpose later?

Also, I found that no RequestDistributeUserEvent and EventUserEvent (or even EventACK) can be found in SIP Server log. Is is because when a DN send RequestDistributeUserEvent to itself, no EventUserEvent received but EventACK is received? 

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: EventUserEvent is not received when sending RequestDistributeUserEvent
« Reply #1 on: September 26, 2015, 07:46:59 PM »
Is at least interaction alive on Agent? I mean, no voice ok, but is he on AfterCallWork at least? If ConnID is dead already then no way to attach data to it.
Can you post full SIP Server logs showing this?

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: EventUserEvent is not received when sending RequestDistributeUserEvent
« Reply #2 on: September 27, 2015, 03:52:01 AM »
Hi cavagnaro, thanks for your reply. The log info below is from when I debug my application:

'EventReleased' ('65')
message attributes:
AttributeConnID [long] = 006A026F401154D2
AttributeEventSequenceNumber [long] = 263983
AttributeCallID [int] = 16784585
AttributeThisDN [str] = "13041"
AttributeThisDNRole [int] = 2 [RoleDestination]
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 859000
AttributeTimeinSecs [int] = 1443323797
AttributeCallState [int] = 0
AttributePropagatedCallType [int] = 1 [Internal]
AttributeReasons [bstr] = KVList:
'CallUUID' [str] = "Agent"
AttributeAgentID [str] = "Testing"
AttributeCallType [int] = 1 [Internal]
AttributeDNIS [str] = "13041"
AttributeExtensions [bstr] = KVList:
'BusinessCall' [int] = 0
AttributeCallUuid [str] = "CVHLQ55KB50HH77LLE2253SFEC00017L"
AttributeOtherDNRole [int] = 1 [RoleOrigination]
AttributeReferenceID [int] = 6
AttributeOtherDN [str] = "13021"

'RequestDistributeUserEvent' ('48')
message attributes:
AttributeCommunicationDN [str] = "13041"
UserEvent      = ComplexClass(CommonProperties):
AttributeConnID [long] = 006A026F401154D2
AttributeThisDN [str] = "13041"
AttributeUserData [bstr] = KVList:
'DroppedBy' [str] = "Agent"
AttributeReferenceID [int] = 8

'EventACK' ('138')
message attributes:
AttributeEventSequenceNumber [long] = 263989
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 161000
AttributeTimeinSecs [int] = 1443323798
AttributeReferenceID [int] = 8
AttributeThisDN [str] = "13041"
AttributeUserEvent [int] = 48

'EventAgentNotReady' ('76')
message attributes:
AttributeExtensions [bstr] = KVList:
'WrapUpTime' [int] = 1
'ReasonCode' [str] = "ManualSetACWPeriod"
'AgentSessionID' [str] = "GBLK2TI3R12HV0P1K9PKB6SLRC0008TI"
AttributeEventSequenceNumber [long] = 263991
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 261000
AttributeTimeinSecs [int] = 1443323798
AttributeReferenceID [int] = 9
AttributeAgentWorkMode [int] = 3 [AfterCallWork]
AttributeAgentID [str] = "Testing"
AttributeThisDN [str] = "13041"

'EventAgentReady' ('75')
message attributes:
AttributeExtensions [bstr] = KVList:
'AgentSessionID' [str] = "GBLK2TI3R12HV0P1K9PKB6SLRC0008TI"
AttributeEventSequenceNumber [long] = 263992
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 263000
AttributeTimeinSecs [int] = 1443323799
AttributeAgentWorkMode [int] = 0 [Unknown]
AttributeAgentID [str] = "Testing"
AttributeThisDN [str] = "13041"

'EventAgentReady' ('75')
message attributes:
AttributeExtensions [bstr] = KVList:
'AgentSessionID' [str] = "GBLK2TI3R12HV0P1K9PKB6SLRC0008TI"
AttributeEventSequenceNumber [long] = 263995
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 366000
AttributeTimeinSecs [int] = 1443323802
AttributeReferenceID [int] = 10
AttributeAgentWorkMode [int] = 0 [Unknown]
AttributeAgentID [str] = "Testing"
AttributeThisDN [str] = "13041"

After the call is released, the Agent's work mode will change to ACW, and then after the wrap up time, change to Ready.

« Last Edit: September 28, 2015, 02:21:31 AM by Alyw »

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: EventUserEvent is not received when sending RequestDistributeUserEvent
« Reply #3 on: September 28, 2015, 09:19:09 AM »

Hi,

It shouldn't matter if the interaction is still active or finished when you send a UserEvent.
It is correct that the Client that initiates the RequestDistributeUserEvent receives an EventACK event.
But any client that is registered for the DN should be sent an EventUserEvent

In my test below you can see this:

The client sends a RequestDistributeEventUserEvent setting ThisDN to it's own DN:

[code]10:09:51.425 Trc 04541 RequestDistributeEvent received from [528] (00000008 anonymousTServerClient 192.168.1.59:50967)
message RequestDistributeEvent
AttributeReferenceID 3
AttributeUserEvent EventUserEvent
AttributeUserData [15] 00 01 00 00..
'Pete' 'Pete'
AttributeThisDN '7001'
10:09:51.425 Int 04543 Interaction message "RequestDistributeEvent" received from 528 ("anonymousTServerClient")[/code]

Then in the SIP Server log you can see the EventACK being sent back to the client that initiated the request.

[code]@10:09:51.4250 [0] 8.1.101.10 send_to_client: message EventACK
AttributeEventSequenceNumber 00000000000009fc
AttributeCustomerID 'Environment'
AttributeTimeinuSecs 425000
AttributeTimeinSecs 1443431391 (10:09:51)
AttributeReferenceID 3
AttributeThisDN '7001'
AttributeUserEvent RequestDistributeEvent
10:09:51.425 Trc 04542 EventACK sent to [528] (00000008 anonymousTServerClient 192.168.1.59:50967)[/code]

Then you can see the UserEvent being sent to any client that is registered for that DN

[code]@10:09:51.4250 [0] 8.1.101.10 distribute_user_event: message EventUserEvent
AttributeEventSequenceNumber 00000000000009fd
AttributeCustomerID 'Environment'
AttributeTimeinuSecs 425000
AttributeTimeinSecs 1443431391 (10:09:51)
AttributeThisDN '7001'
AttributeUserData [15] 00 01 00 00..
'Pete' 'Pete'
AttributeUserEvent EventUserEvent
AttributeReferenceID 3
10:09:51.425 Trc 04542 EventUserEvent sent to [636] (00000007 anonymousTServerClient 192.168.1.59:50668)
10:09:51.425 Trc 04542 EventUserEvent sent to [632] (00000006 Stat_Server_Pulse 192.168.1.34:36085)
10:09:51.425 Trc 04542 EventUserEvent sent to [628] (00000005 Stat_Server 192.168.1.34:36084)
10:09:51.425 Trc 04542 EventUserEvent sent to [596] (00000004 Orchestration_Server 192.168.1.34:36056)[/code]

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: EventUserEvent is not received when sending RequestDistributeUserEvent
« Reply #4 on: September 29, 2015, 02:28:53 AM »
Hi @PeteHoyle, thanks for your reply. I can't found the RequestDistributeUserEvent and EventACK (or EventUserEvent) in the SIP log file. How can I check that a client is registered for a particular DN in CME?

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: EventUserEvent is not received when sending RequestDistributeUserEvent
« Reply #5 on: September 30, 2015, 01:39:38 PM »
Sorry when I say a client has registered for a DN, I mean that the client app has made the request that is equivalent to a RequestRegisterAddress for that DN, you cannot see it in CME

[code]RequestRegisterAddress requestRegisterAddress =
              RequestRegisterAddress.Create(
                  thisDn,
                  RegisterMode.ModeShare,
                  ControlMode.RegisterDefault,
                  AddressType.DN);[/code]

In the SIP Server log you should see reqeust\events similar to the ones below for each DN that is registered by each client..


11:30:35.271  -- created: CRequest@3df1c30 RequestRegisterAddress-Stat_Server_Pulse[620]/176
11:30:35.271: $+TLIB:CTI:Unknown:0:22
11:30:35.271 +++ CIFace::Request +++
  -- new invoke
  Parsed: RequestRegisterAddress
  From: Stat_Server_Pulse[620]/176
  Numbers: +<11573> -<none>
  Status: parsed:1 queued:0 sent:0 acked:0 preevent:0 event:0 context:0 transferred:0
  -----
@11:30:35.2710 [0] 8.1.101.10 send_to_client: message EventRegistered
AttributeEventSequenceNumber 00000000000007ab
AttributeCustomerID 'Environment'
AttributeTimeinuSecs 271000
AttributeTimeinSecs 1443609035 (11:30:35)
AttributeReferenceID 176
AttributeThisDN '11573'
AttributeExtensions [66] 00 03 01 00..
'AgentStatus' -1
'AgentStatusTimestamp' 0
'status' 0
AttributeAddressInfoStatus 1
AttributeAddressInfoType 8 (AddressInfoAddressType)
AttributeAddressType 1 (DN)
11:30:35.271 Trc 04542 EventRegistered sent to [620] (00000005 Stat_Server_Pulse 192.168.1.34:34332)
  TRegManager::ClientRegistered 5  11573
  -- processed by client handler
« Last Edit: September 30, 2015, 01:41:33 PM by PeteHoyle »