Руководство Разработчика для Cisco Cisco Computer Telephony Integration Option 8.5

Скачать
Страница из 500
   
4-20
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 7.5(1)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
The .NET CIL consists of two class libraries: NetCil.dll and NetUtil.dll that need to be added as 
references on the build project. See the CTIOS Toolkit Combo Desktop sample. 
For deploying the client application, it is recommended that the NetCil.dll and NetUtil.dll class libraries 
to be installed on the host's Global Assembly Cache (GAC) using  the "gacutil"  (provided by in 
Microsoft Visual Studio .NET 2003)  or the "Microsoft .NET Framework 1.1" configuration manager. 
Together with .NET CIL are provided sample programs that teaches the use of the API under a .NET 
programming environment. See the section entitled
 for more 
information.
Next Steps
Refer to Chapter 6 and Appendix B for differences between the C++, and .NET and Java event 
publishing.
Refer to Chapters 7 through 12 for differences in method calls and syntax for those classes between 
C++ and Java.
Connecting to the CTI OS Server
To connect a desktop application to the CTI OS server, you must:
1.
Create a session instance, described below.
2.
Set the event listener and subscribe to events, described below.
3.
Set connection parameters, described below.
4.
Call the Connect() method, described on page 4-21.
5.
Set the connection mode, described on page 4-23.
This section also describes how to deal with connection failures, on page 4-22.
How to Create the Session Instance
To connect to the CTIOS Server, you must first create an instance of the CtiOsSession object.
The following line shows this in 
Java:
CtiOsSession rSession = new CtiOsSession();
Session Object Lifetime (C++ only)
In C++, a Session object must be created on the heap memory store so that it can exist beyond the scope of 
the method creating it. (In COM, VB, and Java, this is handled automatically.)
For example:
CCtiOsSession * m_pSession = NULL;
m_pSession = new CCtiOsSession();
The client application should hold a reference to the Session object as long as it is in use, but the client 
programmer must release the last reference to the object to prevent a memory leak when the object is not 
longer needed.