예제 #1
0
        public void SIPProviderDeleted(SIPProvider sipProvider)
        {
            try
            {
                logger.Debug("SIPProviderBindingSynchroniser SIPProviderDeleted for " + sipProvider.Owner + " and " + sipProvider.ProviderName + ".");

                SIPProviderBinding existingBinding = m_bindingPersistor.Get(b => b.ProviderId == sipProvider.Id);
                if (existingBinding != null)
                {
                    if (existingBinding.IsRegistered)
                    {
                        // Let the registration agent know the existing binding should be expired.
                        existingBinding.BindingExpiry        = 0;
                        existingBinding.NextRegistrationTime = DateTime.UtcNow;
                        m_bindingPersistor.Update(existingBinding);
                    }
                    else
                    {
                        m_bindingPersistor.Delete(existingBinding);
                    }
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPProviderBindingSynchroniser SIPProviderDeleted. " + excp.Message);
            }
        }
예제 #2
0
        public void SIPProviderAdded(SIPProvider sipProvider)
        {
            try
            {
                logger.Debug("SIPProviderBindingSynchroniser SIPProviderAdded for " + sipProvider.Owner + " and " + sipProvider.ProviderName + ".");

                if (sipProvider.RegisterEnabled)
                {
                    SIPProviderBinding binding = new SIPProviderBinding(sipProvider);
                    m_bindingPersistor.Add(binding);
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPProviderBindingSynchroniser SIPProviderAdded. " + excp.Message);
            }
        }