コード例 #1
0
        /// <summary>
        /// Stops recording the current conference
        /// </summary>
        public void StopRecording()
        {
            if (stopTimer != null)
            {
                stopTimer.Dispose();
                stopTimer = null;
            }

            if (this.perfCounter != null)
            {
                this.perfCounter.Dispose();
            }

            if (this.recording)
            {
                perfCounter.Dispose();

                // Stop all the streams
                foreach (StreamRecorder sm in streams.Values)
                {
                    sm.StopListening();
                }

                streams      = null;
                participants = null;

                // Stop the rtpSession
                RtpEvents.RtpParticipantAdded -= new RtpEvents.RtpParticipantAddedEventHandler(this.OnNewRtpParticipant);
                RtpEvents.RtpStreamAdded      -= new RtpEvents.RtpStreamAddedEventHandler(this.OnNewRtpStream);
                RtpEvents.RtpStreamRemoved    -= new RtpEvents.RtpStreamRemovedEventHandler(this.OnRtpStreamRemoved);

                if (rtpSession != null)
                {
                    rtpSession.Dispose();
                    rtpSession = null;
                }

                DBHelper.RecordConferenceEndTime(conferenceID, System.DateTime.Now);

                this.recording = false;
            }
        }