CALL_CLEARED_EVENT not coming

Version 1
    This document was generated from CDN thread

    Created by: Saurav Naruka on 10-07-2013 12:43:21 PM
    Hi,

    I am using Cisco UCCX to build soft phone.
    I am not getting CALL_CLEARED_EVENT and END_CALL_EVENT but however I am getting CALL_CONNECTION_CLEARED_EVENT.
     
    In openreq message I am setting value of ServicesRequested as 0x00000007 and for CallMsgMask  I am setting 0x65EFFF ( I changed it to 0x20, 0x40, 0x60 but still I was not getting  CALL_CLEARED_EVENT). Value for ConfigMsgMask  is 0x0000000F and AgentStateMask is 0x1FF.
    Still I am not getting the CALL_CLEARED_EVENT. What can cause this behavior? Do i need to change something in Openreq?

    Thanks

    Subject: RE: New Message from Saurav Naruka in Contact Center Express CTI (UCCXCTI)
    Replied by: David Lender on 10-07-2013 01:46:55 PM
    I suggest you pull the MIVR log to show the OPEN_REQ and call event  messages.  To receive all call events, use mask   0x65EFFF as you have specified.
    Perhaps you are not setting the CallMsgMask you think you are setting.

    Subject: RE: New Message from Saurav Naruka in Contact Center Express CTI (UCCXCTI)
    Replied by: Saurav Naruka on 11-07-2013 09:21:15 AM
    Hi David,

    I got the MIVR log files. I am setting CallMsgMask value = 6680575

    19965187: Jul 11 19:35:17.504 IST %MIVR-ICD_CTI-7-UNK:InboundMsgProcessor : OPEN_REQ: { {servicereq=7, idletimeout=2147483647, agentInstrument=1106, clientPass=[xxxxx, appPathId=0, agentIDlong=Indro, invokeid=1, agentStateMask=511, configMsgMask=15, callMsgMask=6680575, versionnumber=10, agentExt=1106, clientid=Indro} } socket is Socket
    And there are entries for CALL_CLEARED_EVENT. But still I am only getting CALL_CONNECTION_CLEARED_EVENT only.

    19973076: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:OutboundMessageprocessor : Q size after posting msg : { length=-1 type=CALL_CONNECTION_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, connectionCallID: 16845712, releasingDeviceType: 76, localConnectionState: 65535, eventCause: 65535, monitoredDeviceDN: 1106, releasingDeviceID: 1106} to socket: Socket is : 29973077: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:OutboundMsgProcessor: got message: { CALL_CLEARED_EVENT }9973078: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:CSOutboundMsgProcessor: got an event message:{ length=-1 type=CALL_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, ConnectionCallID: 16845712, localConnectionState: 0, eventCause: 1014, connectionDeviceID:  } 9973079: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:OutboundMessageprocessor : sending msg : { length=-1 type=CALL_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, ConnectionCallID: 16845712, localConnectionState: 0, eventCause: 1014, connectionDeviceID:  to various sockets } 9973080: Jul 11 19:36:12.432 IST %MIVR-EXECUTOR_MGR-7-EXECUTE_CMD:Execute command: Facility=MIVR,Sub-Facility=ICD_CTI,Executor id=SOCKET,Mnemonic=PROCESS_CTI_MGR_EVENT9973081: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:Executor trace: Action=EXECUTE_CMD,Executor id=SOCKET,Mnemonic=PROCESS_CTI_MGR_EVENT,Executor type=null,Thread=null,Thread priority=null,Original Thread=null,Original thread priority=null,Time=null,Exception=null9973082: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:OutboundMessageprocessor : Q size after posting msg : { length=-1 type=CALL_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, ConnectionCallID: 16845712, localConnectionState: 0, eventCause: 1014, connectionDeviceID: } to socket: Socket is : 29973083: Jul 11 19:36:12.432 IST %MIVR-EXECUTOR_MGR-7-EXECUTE_CMD:Execute command: Facility=MIVR,Sub-Facility=ICD_CTI,Executor id=SOCKET,Mnemonic=PROCESS_CTI_MGR_EVENT9973084: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:Executor trace: Action=EXECUTE_CMD,Executor id=SOCKET,Mnemonic=PROCESS_CTI_MGR_EVENT,Executor type=null,Thread=null,Thread priority=null,Original Thread=null,Original thread priority=null,Time=null,Exception=null9973085: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNK:OutboundMessageprocessor : Q size after posting msg : { length=-1 type=CALL_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, ConnectionCallID: 16845712, localConnectionState: 0, eventCause: 1014, connectionDeviceID: } to socket: Socket is : 3
    2
    3
    49973122: Jul 11 19:36:12.435 IST %MIVR-ICD_CTI-7-UNK:encoding... <- MHDR   <- CALL_CLEARED_EVENT
    59973123: Jul 11 19:36:12.435 IST %MIVR-ICD_CTI-7-UNK:writing... MHDR:    0000: 00 00 00 17 00 00 00 0D                            ........   MDATA:   0000: 00 00 00 00 00 00 00 01   00 15 00 00 01 01 0B 90  ................0010: 00 00 03 F6 19 01 00                               .......
    69973124: Jul 11 19:36:12.435 IST %MIVR-ICD_CTI-7-UNK:MsgHandler : Sent : { CALL_CLEARED_EVENT to Socket  CID: 16845712 } 
    79973125: Jul 11 19:36:12.435 IST %MIVR-EXECUTOR_MGR-7-CMD_DONE:Command completed: Facility=MIVR,Sub-Facility=ICD_CTI,Executor id=SOCKET,Mnemonic=PROCESS_CTI_MGR_EVENT,Thread=MIVR_ICD_CTI_SOCKET-90-241100,Thread priority=5,Time=3
    I have no idea what needs to be changed to get CALL_CLEARED_EVENT. Is there any environment dependency? 

    Subject: RE: New Message from Saurav Naruka in Contact Center Express CTI (UCCXCTI)
    Replied by: David Lender on 11-07-2013 09:38:55 AM
    Your log snippet shows the CALL_CLEARED_EVENT being sent
    9973079: Jul 11 19:36:12.432 IST %MIVR-ICD_CTI-7-UNKutboundMessageprocessor : sending msg : { length=-1 type=CALL_CLEARED_EVENT, monitorID: 0, peripheralID: 1, peripheralType: 21, connectionDeviceIDType: 0, ConnectionCallID: 16845712, localConnectionState: 0, eventCause: 1014, connectionDeviceID:  to various sockets }

    Subject: RE: CALL_CLEARED_EVENT not coming
    Replied by: Saurav Naruka on 11-07-2013 03:49:59 PM
    Just to eliminate the possible reasons I downloaded UCCX CTI sample code from Cisco.

    I connected it then set the agent state and made a call to my extension and then ended the call. Here is the request response copied from command prompt.
     1Enter command >> connect -s 192.xxx.x.xx -n 12028
     2socket open to 192.xxx.x.xx:12028
     3Enter command >> openreq -v 10 -t 0xFFFFFFFF -s 0x00000007 -c 0x65EFFF -a 0x1FF-g 0x0000000F -i Indro -p xxxx -e 1106 -m 1106 -d 1106
     4Enter command >>
     5MsgType: OPEN_CONF, BodyLength: 26Invoke ID: 1  ServiceGranted: 0x7  PeripheralOnline: 1  AgentState: 9  agent_extension:  agent_instrument:  agent_id:
     6
     7setagentstatereq -s 0 -e 0 -a 1106 -d Indro -p xxx
     8Enter command >>
     9Unable to parse the message.00 00 01 2d 00 00 00 1e 00 00 00 00 00 00 00 01 00 00 00 00 00 15 00 02 00 00 00 00 00 00 00 01 ff ff ff ff 00 00 00 02 7f f8 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 0b 04 05 31 31 30 36 00 05 06 49 6e 64 72 6f00 c2 06 49 6e 64 72 6f 00 3e 04 00 00 00 02 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 04 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 05 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 06 3f 04 ff ff ffff 40 02 00 00 41 02 00 02 3e 04 00 00 00 07 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 08 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 09 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 0a 3f 04 ff ff ffff 40 02 00 00 41 02 00 02 3e 04 00 00 00 0b 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 0c 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02 3e 04 00 00 00 0d 3f 04 ff ff ff ff 40 02 00 00 41 02 00 02
    10
    11MsgType: SET_AGENT_STATE_CONF, BodyLength: 4Invoke ID: 2
    12
    13MsgType: CALL_DELIVERED_EVENT, BodyLength: 95  ConnectionDeviceType: 0  CallID: 16845725  ApplicationID: -1  CSQID: -1  AlertingDeviceType: 76  CallingDeviceType: 0  CalledDeviceType: 76  LastRedirectedDeviceType: 65535  LocalConnectionState: 2  EventCause: 22  NumNamedVars: 0  NumNamedArrays: 0  ConnectionDeviceID: 1106  AlertingDeviceID: 1106  CallingDeviceID: 2013  CalledDeviceID: 1106  LastRedirectedDeviceID:  SecondaryCallID: 0  ANI:  DNIS: 1106  DialedNumber:  CallerEnteredDigits:  CallWrapupData:  UserToUserInfo:  CallVar[1]:  CallVar[2]:  CallVar[3]:  CallVar[4]:  CallVar[5]:  CallVar[6]:  CallVar[7]:  CallVar[8]:  CallVar[9]:  CallVar[10]:
    14
    15MsgType: CALL_ESTABLISHED_EVENT, BodyLength: 78  ConnectionDeviceType: 0  CallID: 16845725  ApplicationID: -1  CSQID: -1  AnsweringDeviceType: 76  CallingDeviceType: 0  CalledDeviceType: 76  LastRedirectedDeviceType: 65535  LocalConnectionState: 3  EventCause: 22  ConnectionDeviceID: 1106  AnsweringDeviceID: 1106  CallingDeviceID: 2013  CalledDeviceID: 1106  LastRedirectedDeviceID:
    16
    17Unable to parse the message.00 00 00 35 00 00 00 74 00 00 00 00 00 00 00 01 00 00 60 00 00 01 00 00 00 00 00 01 00 00 00 00 00 14 00 03 00 00 01 01 0b 9d 51 0a 31 30 2e 30 2e 32 2e 31 35 00 19 05 31 31 30 36 00
    18
    19Unable to parse the message.00 00 00 39 00 00 00 74 00 00 00 00 00 00 00 01 00 00 60 00 00 00 00 00 00 00 00 01 00 01 00 00 00 14 00 03 00 00 01 01 0b 9d 51 0e 31 39 32 2e 31 36 38 2e 31 2e 32 32 33 00 19 05 31 31 30 36 00
    20
    21
    22MsgType: CALL_CONNECTION_CLEARED_EVENT, BodyLength: 36  ConnectionDeviceType: 0  CallID: 16845725  ReleasingingDeviceType: 76  LocalConnectionState: 65535  EventCause: 65535  ConnectionDeviceID: 1106  ReleasingDeviceID: 1106
    23
    24
    25
    26Unable to parse the message.00 00 00 1f 00 00 00 75 ff ff ff ff 00 00 00 01 00 00 00 00 00 00 00 00 ff ff ff ff 51 02 30 00 19 05 31 31 30 36 00
    27
    28
    29Unable to parse the message.00 00 00 1f 00 00 00 75 ff ff ff ff 00 00 00 01 00 00 00 00 00 01 00 00 ff ff ff ff 51 02 30 00 19 05 31 31 30 36 00
    Here also in cisco sample code I am not getting CALL_CLEARED_EVENT. 
    Please suggest some tips to troubleshoot the problem.

    Subject: RE: New Message from Saurav Naruka in Contact Center Express CTI (UCCXCTI)
    Replied by: David Lender on 11-07-2013 04:39:55 PM
    It seems to me you do not get a call cleared event in your environment.  Perhaps the call is going into After Call work so it really hasn’t ended only the connection has?

    Subject: RE: CALL_CLEARED_EVENT not coming
    Replied by: Saurav Naruka on 12-07-2013 09:36:58 AM
    Hi,

    This is strange that in our lab setup we are not getting CALL_CLEARED_EVENT.
    I checked CAD logs located in C:\Program Files\Cisco\Desktop\log\ Agent0001.dbg
    In this file there is no entry for CALL_CLEARED_EVENT but there are entries for CALL_CONNECTION_CLEARED_EVENT. So I think I am not getting CALL_CLEARED_EVENT at all.

    So I have two questions.
    1.Using only CALL_CONNECTION_CLEARED_EVENT for building soft phone is sufficient? Or do I require other events like CALL_CLEARED_EVENT in case of complex scenarios like IVR call and conference?
    2.  This may be completely an environment issue. How can I resolve it  (some guidelines on this will be very helpful)?

    Thanks