private FreeswitchModuleConfiguration(string filename)
 {
     _fsmf = FreeSwitchModuleFile.Load(filename);
     if (_fsmf.Data == null)
     {
         _configurationSection = null;
     }
     else
     {
         _configurationSection = _fsmf.File.ConfigurationSectionString;
     }
 }
Ejemplo n.º 2
0
        public static void RegenerateModuleFile(string fileName)
        {
            FreeSwitchModuleFile fsmf = FreeSwitchModuleFile.Load(fileName);

            Lock();
            List <sDeployedModule> mods = modules;

            if (fsmf == null)
            {
                for (int x = 0; x < mods.Count; x++)
                {
                    if (mods[x].FileName == fileName)
                    {
                        mods.RemoveAt(x);
                        break;
                    }
                }
            }
            else
            {
                bool add = true;
                for (int x = 0; x < mods.Count; x++)
                {
                    if (mods[x].FileName == fileName)
                    {
                        mods[x] = new sDeployedModule(fileName, fsmf.File);
                        add     = false;
                        break;
                    }
                }
                if (add)
                {
                    mods.Add(new sDeployedModule(fileName, fsmf.File));
                }
            }
            modules = mods;
            UnLock();
            _deployer.DeployModuleFile(fileName, (fsmf == null ? null : fsmf.File));
            EventController.TriggerEvent(new ModuleDeploymentEvent(fileName, fsmf == null));
        }