SIPSorcery.SoftPhone.MediaManager.Close C# (CSharp) Метод

Close() публичный Метод

Called when the media channels are no longer required, such as when the VoIP call using it has terminated, and all resources can be shutdown and closed.
public Close ( ) : void
Результат void
        public void Close()
        {
            try
            {
                logger.Debug("Media Manager closing.");

                _stop = true;

                if (_audioChannel != null)
                {
                    _audioChannel.SampleReady -= AudioChannelSampleReady;
                    _audioChannel.Close();
                }

                if (_rtpManager != null)
                {
                    _rtpManager.OnRemoteVideoSampleReady -= EncodedVideoSampleReceived;
                    _rtpManager.OnRemoteAudioSampleReady -= RemoteAudioSampleReceived;
                    _rtpManager.Close();
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception Media Manager Close. " + excp);
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Application closing, shutdown the SIP, Google Voice and STUN clients.
        /// </summary>
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            _mediaManager.Close();
            _sipClient.Shutdown();

            if (_stunClient != null)
            {
                _stunClient.Stop();
            }
        }
All Usage Examples Of SIPSorcery.SoftPhone.MediaManager::Close