Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 500
   
4-54
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Enabling Silent Monitor in Your Application
Monitored Mode
In this mode, the client sends audio and status reports on silent monitor session and receives requests for 
start and stop silent monitor session. This mode is intended for client applications developed for Agent 
desktop functionality. The StartSMMonitoredMode method on the SilentMonitorManager object selects 
this mode.
Following is a code sample for specifying the mode for the client application: 
Dim m_Args As New Arguments
 
‘Assemble arguments to set the work mode
 
m_Args.AddItem("HeartbeatInterval", 5)
 
m_Args.AddItem("HeartbeatTimeout", 15)
 
'Address or hostname of the silent monitor service
 
m_Args.AddItem("SMSAddr", "localhost")
 
'Port on which silent monitor service is listening
 
m_Args.AddItem("SMSListenPort", 42228)
 
'QoS setting when sending messages to the silent monitor service
 
m_Args.AddItem("SMSTOS", 0)
 
'Milliseconds between heartbeats
 
m_Args.AddItem("SMSHeartbeats", 5000)
 
'Number of missed heartbeats before the connection to the
 
'silent monitor service is considered disconnected
 
m_Args.AddItem("SMSRetries", 3)
 
‘Extension number of the IP Phone to monitor
 
m_Args.AddItem("MonitoringDeviceID", 1234)
 
‘Set the working mode to monitored
 
m_silentMonitor.StartSMMonitoredMode(args)
Initiating and Ending a Silent Monitor Session
Initiating a silent monitor session starts with the client, in monitoring mode, calling the 
StartSilentMonitorRequest method. This indicates that the CTI OS server should send an 
OnSilentMonitorStartRequestedEvent to a remote client in monitored mode. The remote client, upon 
receiving the OnSilentMonitorStartRequestedEvent, chooses whether or not accept the request. The 
remote client acknowledges its approval or rejection by sending a status report back to the monitoring 
client. The monitoring client will receive the acceptance or rejection via the 
OnSilentMonitorStatusReportEvent. When the session is accepted by the remote client it, will 
immediately start forwarding voice to the monitoring client. The silent monitoring session can only be 
terminated by the monitoring client by calling the StopSilentMonitorRequest method, CTI OS server 
will issue the OnSilentMonitorStopRequestedEvent to the remote client. The monitored client will stop 
sending audio immediately when OnSilentMonitorStopRequestedEvent is received by its 
SilentMonitorManager object.
Following are code samples for initiating and ending a silent monitor session: 
Monitoring Client Code Sample
Private Sub btnStartSM_OnClick()
Dim m_Args As New Arguments
‘Assemble arguments for start request
‘Agent to monitor
m_Args.AddItem "AgentID", “23840”
m_Args.AddItem "PeripheralID", “5000”
‘Request silent monitor session to start
m_SMManager.StartSilentMonitorRequest(m_Args, m_nSMSessionKey)
End Sub