Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-55
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
Private Sub m_session_OnSilentMonitorStatusReportEvent(By Val pIArguments As 
CTIOSCLIENTLib.IArguments)
         Dim strAgent As String
         Dim nMode As Integer
         nMode pIArguments.GetValueInt(“StatusCode)
If nMode = eSMStatusMonitorStarted Then strAgent =  
pIArguments.GetValueString(“MonitoredUniqueObjectID”)
            MsgBox “Silent Monitor Status”,, 
“Started Monitoring Agent: ” & strAgent
         Else
            MsgBox “Silent Monitor Status”,, 
“Request Failed with code = ” & nMode            
         End If
End Sub
Private Sub tmrScreening_Timer()
‘After listening the conversation for 30 sec, drop monitoring session
‘Assemble arguments for stop  request
‘Agent to monitor
m_Args.AddItem "SMSessionKey", m_nSMSessionKey
‘Request silent monitor session to stop
m_SMManager.StopSilentMonitorRequest(m_Args, m_nSMSessionKey)
End Sub
Monitored Client Code Sample
Private Sub m_session_OnSilentMonitorStartRequestedEvent(By Val pIArguments As 
CTIOSCLIENTLib.IArguments)
     Dim strRequestInfo As String
    
     strRequestInfo =  pIArguments.DumpArgs
MsgBox “Request to Start Silent Monitor Received”,, strRequestInfo
End Sub
Private Sub m_session_OnSilentMonitorStopRequestedEvent(By Val pIArguments As 
CTIOSCLIENTLib.IArguments, bDoDefaultProcessing)
     Dim strRequestInfo As String
    
     strRequestInfo =  pIArguments.DumpArgs
MsgBox “Request to Stop Silent Monitor Received”,, strRequestInfo
End Sub
Shutting Down Silent Monitor Manager
Shutting down the Silent monitor object requires that the monitoring client call the 
StopSilentMonitorMode method when it is done monitoring an agent, and that the monitored client call 
the StopSilentMonitorMode method during cleanup. Each client must then remove the silent monitor 
manager from the Session object by calling SetMonitorCurrentSilentMonitor with a NULL pointer. 
Finally each client must destroy the silent monitor object using Session’s DestroySilentMonitorManager 
method. 
Following is a code sample for initiating and ending a silent monitor session: 
‘Stop Silent Monitor ModeRequest
m_SMManager.StopSilentMonitorMode