public void Stop()
        {
            try
            {
                logger.Debug("RTCC daemon stopping...");

                logger.Debug("Shutting down SIP Transport.");
                m_sipTransport.Shutdown();

                if (m_rtccCore != null)
                {
                    m_rtccCore.Stop();
                }
                if (m_rateUpdater != null)
                {
                    m_rateUpdater.Stop();
                }

                logger.Debug("RTCC daemon stopped.");
            }
            catch (Exception excp)
            {
                logger.Error("Exception RTCCDaemon Stop. " + excp.Message);
            }
        }
        public void Stop()
        {
            try
            {
                logger.Debug("SIP Application Server stopping...");

                m_dialPlanEngine.StopScriptMonitoring = true;

                if (m_accessPolicyHost != null && m_accessPolicyHost.State == CommunicationState.Opened)
                {
                    m_accessPolicyHost.Close();
                }

                if (m_sipProvisioningHost != null && m_sipProvisioningHost.State == CommunicationState.Opened)
                {
                    m_sipProvisioningHost.Close();
                }

                if (m_callManagerSvcHost != null && m_callManagerSvcHost.State == CommunicationState.Opened)
                {
                    m_callManagerSvcHost.Close();
                }

                if (m_sipNotificationsHost != null && m_sipNotificationsHost.State == CommunicationState.Opened)
                {
                    m_sipNotificationsHost.Close();
                }

                if (m_callManager != null)
                {
                    m_callManager.Stop();
                }

                if (m_rtccCore != null)
                {
                    m_rtccCore.Stop();
                }

                //if (m_notifyManager != null)
                //{
                //    m_notifyManager.Stop();
                //}

                if (m_monitorEventWriter != null)
                {
                    m_monitorEventWriter.Close();
                }

                if (m_sipProxyDaemon != null)
                {
                    m_sipProxyDaemon.Stop();
                }

                if (m_sipMonitorDaemon != null)
                {
                    m_sipMonitorDaemon.Stop();
                }

                if (m_sipRegistrarDaemon != null)
                {
                    m_sipRegistrarDaemon.Stop();
                }

                if (m_sipNotifierDaemon != null)
                {
                    m_sipNotifierDaemon.Stop();
                }

                if (m_sipRegAgentDaemon != null)
                {
                    m_sipRegAgentDaemon.Stop();
                }

                if (m_sipNotifierDaemon != null)
                {
                    m_sipNotifierDaemon.Stop();
                }

                if (m_rateUpdater != null)
                {
                    m_rateUpdater.Stop();
                }

                // Shutdown the SIPTransport layer.
                m_sipTransport.Shutdown();
                DNSManager.Stop();

                m_sipSorceryPersistor.StopCDRWrites = true;

                logger.Debug("SIP Application Server stopped.");
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPAppServerDaemon Stop." + excp.Message);
            }
        }