public SIPRegistrarBindingsManager( //SIPMonitorLogDelegate sipMonitorEventLog, SIPAssetPersistor <SIPRegistrarBinding> bindingsPersistor, //SendNATKeepAliveDelegate sendNATKeepAlive, int maxBindingsPerAccount, SIPUserAgentConfigurationManager userAgentConfigs) { //SIPMonitorEventLog_External = sipMonitorEventLog; m_bindingsPersistor = bindingsPersistor; //SendNATKeepAlive_External = sendNATKeepAlive; m_maxBindingsPerAccount = (maxBindingsPerAccount != 0) ? maxBindingsPerAccount : DEFAULT_BINDINGS_PER_USER; m_userAgentConfigs = userAgentConfigs; }
public void GetCiscoExpiryUnitTest() { Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name); string registrarExpiryNode = "<useragentconfigs>" + " <useragent expiry='3600'>fring</useragent>" + " <useragent expiry='300'>Cisco-CP7960G/8.0</useragent>" + " <useragent expiry='113'>*</useragent>" + " </useragentconfigs>"; XmlDocument regExpiryDom = new XmlDocument(); regExpiryDom.LoadXml(registrarExpiryNode); SIPUserAgentConfigurationManager uaConfigManager = new SIPUserAgentConfigurationManager(regExpiryDom.DocumentElement); SIPUserAgentConfiguration matchingUA = uaConfigManager.GetUserAgentConfig("Cisco-CP7960G/8.0"); Assert.IsNotNull(matchingUA, "A matching user agent entry was not found."); Assert.IsTrue(matchingUA.MaxAllowedExpiryTime == 300, "The expiry value for the Cisco ua was incorrect."); Console.WriteLine("---------------------------------"); }