Ejemplo n.º 1
0
 public SIPSorceryConfiguration()
 {
     PersistenceStorageType = (ConfigurationManager.AppSettings[PERSISTENCE_STORAGETYPE_KEY] != null)
         ? StorageTypesConverter.GetStorageType(ConfigurationManager.AppSettings[PERSISTENCE_STORAGETYPE_KEY])
         : StorageTypes.Unknown;
     PersistenceConnStr = ConfigurationManager.AppSettings[PERSISTENCE_STORAGECONNSTR_KEY];
 }
Ejemplo n.º 2
0
        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.");
            }
        }