コード例 #1
0
        public void TerminateCall()
        {
            if (_speechRecognizer != null)
            {
                _speechRecognizer.StopSpeechRecognition();
            }

            if (_audioVideoFlow != null)
            {
                _audioVideoFlow.StateChanged -= AudioVideoFlow_StateChanged;
                _audioVideoFlow = null;
            }

            if (_audioVideoCall != null)
            {
                _audioVideoCall.BeginTerminate(AudioVideoCallTerminated, _audioVideoCall);
                _audioVideoCall.Flow.StateChanged -= AudioVideoFlow_StateChanged;
                _audioVideoCall.StateChanged      -= AudioVideoCall_StateChanged;
                _audioVideoCall.AudioVideoFlowConfigurationRequested -= AudioVideoCall_FlowConfigurationRequested;
                _audioVideoCall.ConversationChanged -= AudioVideoCall_ConversationChanged;
                _audioVideoCall = null;
            }
            else
            {
                _waitForAudioVideoCallTerminated.Set();
            }

            if (_subConversation != null)
            {
                _transcriptRecorder.OnSubConversationRemoved(_subConversation, this);
                _subConversation = null;
            }

            _waitForAudioVideoCallAccepted.Reset();
            _waitForAudioVideoFlowStateChangedToActiveCompleted.Reset();
        }
コード例 #2
0
        public void TerminateCall()
        {
            if (_instantMessagingFlow != null)
            {
                _instantMessagingFlow.StateChanged    -= this.InstantMessagingFlow_StateChanged;
                _instantMessagingFlow.MessageReceived -= this.InstantMessagingFlow_MessageReceived;
                _instantMessagingFlow = null;
            }

            if (_instantMessagingCall != null)
            {
                _instantMessagingCall.BeginTerminate(InstantMessagingCallTerminated, _instantMessagingCall);
                _instantMessagingCall.StateChanged -= this.InstantMessagingCall_StateChanged;
                _instantMessagingCall.InstantMessagingFlowConfigurationRequested -= this.InstantMessagingCall_FlowConfigurationRequested;
                _instantMessagingCall.ConversationChanged -= this.InstantMessagingCall_ConversationChanged;
                _instantMessagingCall = null;
            }
            else
            {
                _waitForIMCallTerminated.Set();
            }

            if (_subConversation != null)
            {
                _transcriptRecorder.OnSubConversationRemoved(_subConversation, this);
                _transcriptRecorder = null;
            }
            if (_subConversation != null)
            {
                _transcriptRecorder.OnSubConversationRemoved(_subConversation, this);
                _subConversation = null;
            }

            _waitForIMCallAccepted.Reset();
            _waitForIMFlowStateChangedToActiveCompleted.Reset();
        }
コード例 #3
0
        public override void Shutdown()
        {
            if (_state == TranscriptRecorderState.Terminated)
            {
                return;
            }
            _state = TranscriptRecorderState.Terminated;

            if (this.IsSubConversation)
            {
                _transcriptRecorder.OnSubConversationRemoved(this.Conversation, this);
            }
            else
            {
                _transcriptRecorder.OnMediaTranscriptRecorderTerminated(this);
                TerminateConversation();
            }
            _transcriptRecorder = null;
        }