Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 506
   
4-28
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(1)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
c.
Set connection parameters.
d.
Call the Connect() method.
e.
Set the connection mode in the OnConnection() event handler.
Settings Download
One of the many useful features of CTI OS is the ability to configure Agent Desktop settings for once 
on the server and have them be available to all agent desktops via the RequestDesktopSettings() 
method. Any changes can be made once on the server instead of changing each and every desktop. 
Settings download can be considered as part of the process of setting up a connection that the client 
application will use. 
Desktop settings are stored in the registries on the machines running CTI OS Server. Centralizing the 
desktop settings on the server streamlines the process of changing or updating the agent desktop. A 
settings download every time a client application connects ensures that all the desktops are based on the 
same settings.
Downloading settings from CTI OS Server can be done after connecting and setting the mode via the 
RequestDesktopSettings()
 method on the Session object. The 
OnGlobalSettingsDownloadConf
 event indicates success and also returns the settings which are 
now available to the client application in the form of properties on the Session object. These properties 
can be accessed via the GetValue() methods. Refer to Chapter 9 for a list of all the properties of the 
Session object. 
The request for desktop settings can be made either in the OnConnection event or in the 
OnSetAgentModeEvent
 event (if Agent mode has been specified). Sample code:
Private Sub m_Session_OnConnection(ByVal pDispParam As Object)
'Issue a request to the server to send us all the Desktop 'Settings
m_Session.RequestDesktopSettings eAgentDesktop
 
End Sub
The OnGlobalSettingsDownloadConf event passes back the settings and they can be accessed 
via the Session object. For example, the following snippet checks for Sound Preferences and specifically 
to see if the Dial Tone is Mute or not:
Private Sub m_session_OnGlobalSettingsDownloadConf(ByVal pDispParam As Object)
Dim SoundArgs As CTIOSARGUMENTSLib.Arguments
' check if "SoundPreferences is a valid property
   
If m_session.IsValid("SoundPreferences ") = 1 Then
  Set SoundArgs = m_session.GetValue("SoundPreferences")
  Dim DialToneArgs As CTIOSARGUMENTSLib.Arguments
   If Not SoundArgs Is Nothing Then
      If SoundArgs.IsValid("DialTone") = 1 Then
          Set DialToneArgs = SoundArgs.GetValue("DialTone")
      End If
   End If
       
   Dim Mute As Integer
   If Not DialToneArgs Is Nothing Then    
     If DialToneArgs.IsValid("Mute") = 1 Then
       Mute = DialToneArgs.GetValueInt("Mute")
       If Mute = 1 Then
         MsgBox "Dial Tone MUTE"//Your logic here
       Else
         MsgBox "Dial Tone  NOT MUTE"//Your logic here