public SIPSorceryConfiguration() { PersistenceStorageType = (ConfigurationManager.AppSettings[PERSISTENCE_STORAGETYPE_KEY] != null) ? StorageTypesConverter.GetStorageType(ConfigurationManager.AppSettings[PERSISTENCE_STORAGETYPE_KEY]) : StorageTypes.Unknown; PersistenceConnStr = ConfigurationManager.AppSettings[PERSISTENCE_STORAGECONNSTR_KEY]; }
static SIPSqlite() { string path = AppDomain.CurrentDomain.BaseDirectory + "Config/"; m_storageType = (AppState.GetConfigSetting(m_storageTypeKey) != null) ? StorageTypesConverter.GetStorageType(AppState.GetConfigSetting(m_storageTypeKey)) : StorageTypes.Unknown; m_connStr = AppState.GetConfigSetting(m_connStrKey); if (m_storageType == StorageTypes.SQLite) { m_connStr = string.Format(m_connStr, path); } if (m_storageType == StorageTypes.Unknown || m_connStr.IsNullOrBlank()) { Logger.Logger.Error( $"The SIP Registrar cannot start with no persistence settings:m_storageType: {m_storageType},m_connStr :{m_connStr}."); // throw new ApplicationException("The SIP Registrar cannot start with no persistence settings."); } }