public void SIPProviderUpdated(SIPProvider sipProvider) { try { logger.Debug("SIPProviderBindingSynchroniser SIPProviderUpdated for " + sipProvider.Owner + " and " + sipProvider.ProviderName + "."); SIPProviderBinding existingBinding = m_bindingPersistor.Get(b => b.ProviderId == sipProvider.Id); if (sipProvider.RegisterEnabled) { if (existingBinding == null) { SIPProviderBinding newBinding = new SIPProviderBinding(sipProvider); m_bindingPersistor.Add(newBinding); } else { existingBinding.SetProviderFields(sipProvider); existingBinding.NextRegistrationTime = DateTime.UtcNow; m_bindingPersistor.Update(existingBinding); } } else { 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 SIPProviderUpdated. " + excp.Message); } }