Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 508
   
4-10
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 8.0(1)
Chapter 4      Building Your Application
Using The CTI OS ActiveX Controls
If one chooses to write a program not using ActiveX controls, a Session object can be created and used 
directly (see CTI Toolkit AgentDesktop at the Win32 CIL samples).
However, in the case of an application built with the ActiveX controls, all ActiveX controls must use the 
same session object. The ActiveX controls accomplish this by retrieving a pointer to the same session 
object via the SessionResolver. The program hosting the ActiveX can obtain the Same session object by 
using the SessionResolver.GetSession method to retrieve a session named “”.
Sample VB .NET code to Retrieve CallVariable1
The following sample VB .NET code will retrieve the common session and just listen for a 
CallEstablishedEvent occurring in that session. If a CallEstablishedEvent occurs, it will retrieve 
CallVariable 1 and put it in the Windows Clipboard (from where it can be retrieved via CTRL-v or be 
used by other applications).
This code uses the COM CIL Interfaces and therefore, needs the following references: 
Cisco.CTIOSCLIENTLib, Cisco.CTIOSARGUMENTSLib, Cisco.CTIOSSESSIONRESOLVERLib. 
The references are shown in 
 (in Visual Basic .NET, select Project-> Add Reference...).
Figure 4-4
CTI OS COM CIL RCWs References Needed for Visual Basic .NET COM Programming
' VB sample for a simple CTIOS phone
' needs references to Cisco.CTIOSCLIENTLib 
Cisco.CTIOSSESSIONRESOLVERLib and Cisco.CTIOSARGUMENTSLib
'
' dim CTIOS session interface
' the session interface handles connect, setagent and others
Dim WithEvents m_session As Cisco.CTIOSCLIENTLib.Session
' the sessionresolver is needed to retrieve the session pointer