Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-10
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 COM CIL in Visual Basic 6.0
    ' all we do is listen for events
    Set m_session = m_sessionresolver.GetSession("")
End Sub
Private Sub Form_Terminate_Renamed()
    Call m_sessionresolver.RemoveSession("")
End Sub
Private Sub m_Session_OnCallEstablished(ByVal pIArguments As 
Cisco.CTIOSCLIENTLib.Arguments) 
' Handles m_Session.OnCallEstablished
    GetCallVariable1 pIArguments
End Sub
Function GetCallVariable1(ByVal pIArguments As CTIOSCLIENTLib.IArguments)
   
    Dim m_uid As String
    m_uid = pIArguments.GetValueString("Uniqueobjectid")
Dim m_call As Cisco.CTIOSCLIENTLib.Call
    Set m_call = m_session.GetObjectFromObjectID(m_uid)
   
    ' retrieve callvar1
    Dim m_callvar1 As String
    m_callvar1 = m_call.GetValueString("Callvariable1")
    
    'copy call variable1 to the clipboard
    Clipboard.SetText m_callvar1
End Function
Using the COM CIL in Visual Basic 6.0
Building a custom CTI application in Visual Basic 6.0 (or adding CTI functionality to your existing 
Visual Basic application) is very simple, but requires basic knowledge of referencing and using COM 
components in Visual Basic. All of the CIL components for COM are distributed as COM Dynamic Link 
Libraries (COM DLL). 
In order to be accessible to COM containers, including Visual Basic 6.0, COM components must be 
registered with Windows. The components that you will require for programming in Visual Basic 6.0 are:
  •
CTI OS Client library (CTIOSClient.dll). This is the main CIL library for COM. The objects 
available in this library are described  fully in the chapters that follow, “Session Object,” “Agent 
Object,” “Call Object,” and “SkillGroup Object.”
  •
CTI OS Arguments Library (arguments.dll). The Arguments helper class is used extensively in 
CTI OS, and is described fully in the chapter “Helper Classes.”
  •
CTI OS Session Resolver (ctiossessionresolver.dll). The Session Resolver is used to share a single 
CTI OS Session across multiple compilation unites (e.g .DLL files). It is only required in 
applications that use ActiveX controls or mix ActiveX controls with custom code.
Referencing COM Components in Visual Basic 6.0
To make use of these objects in your CTI application, Visual Basic 6.0 uses the concept of referencing 
COM components. To add or remove references within a Visual Basic application, go to the Project / 
References
 menu.