Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 490
   
4-43
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 4      Building Your Application
Working with Events
Working with Events
Handling Events in Order
A desktop application using the CTI OS API must handle events in the order they are sent by CTI OS. 
Warning
Because many events include agent state data and button enablement data indicating valid agent 
state transitions, if events are handled out of order agents may not be presented with valid options.
Coding Considerations for CIL Event Handling
The CTI OS CIL fires events to the application in a single thread. It is recommended that the amount of 
time spent in a particular CIL event handler be kept to a minimum to ensure timely delivery of 
subsequent CIL events. If a screenpop based on a call event (such as the OnCallDelivered event or the 
OnCallDataUpdate event) takes longer than a few seconds (for example, remote database lookup), 
delegate this operation to a separate thread or separate process so as not to block CTI OS event handling. 
Note
The order of arrival of CIL events is highly dependent on the ACD that is in use at the customer site. 
Therefore, CIL event order is not guaranteed. Do not write your event handling code in a manner that 
relies on a particular event order.
If the application calls a CIL API method from a CIL event callback routine it must ensure that the 
method call is made on the same thread as the CIL event callback. This rule applies to the following 
methods:
SetCurrentCall 
SetAgent 
This rule must be followed in order to guarantee that events are fired from the CIL to the application in 
the proper sequence. 
When handling events in the browser using JavaScript, keep event processing time to a minimum 
because all other JavaScript execution (e.g., handling of button clicks) may be blocked during handling 
of the event.
Monitoring the OnCallEnd() Event
A Monitor Mode application that monitors any Call-related events must also monitor the OnCallEnd() 
event. 
Warning
The Call object in the CTI OS CIL is only deleted when the OnCallEnd() event is received. If the 
OnCallEnd() and OnCallDataUpdate() events are not monitored, Call objects accumulate and cause 
a memory leak.