Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide
4-18
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4 Building Your Application
Using the Java CIL Libraries
Subscribing for Events in C++
Events interfaces are provided in C++ using the publisher-subscriber model. To subscribe for events, you
must create a callback class (event sink), or implement the event interface in your main class. The
callback class can be derived from the Adapter classes defined in CIL.h, such as
AllInOneEventsAdapter.h.
must create a callback class (event sink), or implement the event interface in your main class. The
callback class can be derived from the Adapter classes defined in CIL.h, such as
AllInOneEventsAdapter.h.
To register for an event, you use the appropriate AddEventListener method on the Session object:
// Initialize the event sink
m_pEventSink = new CEventSink(&m_ctiSession, &m_ctiAgent, this);
// Add event sink as an event listener
m_ctiSession.AddAllInOneEventListener((IAllInOne *) m_pEventSink);
To remove an event listener (upon program termination), use the appropriate RemoveEventListener on
the Session object:
the Session object:
// Tell session object to remove our event sink
m_ctiSession.RemoveSessionEventListener((IAllInOne *) m_pEventSink);
STLPort
Version 7.1(1)(0) of the Cisco CTI OS Toolkit no longer uses STLPort. Instead, it uses Microsoft’s
version of STL, thereby removing any special configuration of the build environment.
version of STL, thereby removing any special configuration of the build environment.
Next Steps
•
For detailed information on the CTI OS client start up and shut down sequence, see the section
“Disconnecting from CTI OS Server”.
•
For detailed information on the CTI OS Client Interface Library objects, see Chapters 6 through 11.
•
For a complete sample application that uses the CIL interface with C++ static libraries, see the
C++phone sample application on the CTI OS CD.
Using the Java CIL Libraries
The Java CIL provides a powerful cross-platform library for developing Java CTI applications. It is built
using a similar architecture to the C++ CIL and the interface is also similar to C++ with some
differences. As a result, a developer porting a C++ CIL application to Java or working between a Java
and C++ should find it fairly easy to switch between the two.
using a similar architecture to the C++ CIL and the interface is also similar to C++ with some
differences. As a result, a developer porting a C++ CIL application to Java or working between a Java
and C++ should find it fairly easy to switch between the two.
The Java CIL consists of two packages contained in a single JAR file called JavaCIL.jar. The packages
are com.cisco.cti.ctios.util and com.cisco.cti.ctios.cil. The Java CIL can be installed on Windows using
the CTI OS Client Install or it can be copied directly from the CTIOS_JavaCIL directory on the CTIOS
media under Installs\CTIOSClient. The Java CIL also includes JavaDoc with the distribution. No install
is provided for Linux. Users will need to mount the CDROM and copy the CTIOS_JavaCIL directory
from the media. The Java CIL version can be checked by using the CheckVersion.bat program in
Windows or the checkversion shell script on Linux. Both of these can be found in the same directory as
the JAR file.
are com.cisco.cti.ctios.util and com.cisco.cti.ctios.cil. The Java CIL can be installed on Windows using
the CTI OS Client Install or it can be copied directly from the CTIOS_JavaCIL directory on the CTIOS
media under Installs\CTIOSClient. The Java CIL also includes JavaDoc with the distribution. No install
is provided for Linux. Users will need to mount the CDROM and copy the CTIOS_JavaCIL directory
from the media. The Java CIL version can be checked by using the CheckVersion.bat program in
Windows or the checkversion shell script on Linux. Both of these can be found in the same directory as
the JAR file.
Sun JRE installers are also included on the media as a convenience for developers who need to obtain
the correct version of the JRE.
the correct version of the JRE.