Fix loading modules with alternate configurations and ports into ROBUST.

Make all current modules support the configuration name option
This commit is contained in:
Melanie
2009-09-29 09:56:17 +01:00
parent 13c6202da9
commit 691f1e8aa0
14 changed files with 75 additions and 55 deletions

View File

@@ -37,19 +37,23 @@ namespace OpenSim.Server.Handlers.Freeswitch
public class FreeswitchServerConnector : ServiceConnector
{
private IFreeswitchService m_FreeswitchService;
private string m_ConfigName = "FreeswitchService";
public FreeswitchServerConnector(IConfigSource config, IHttpServer server) :
base(config, server)
public FreeswitchServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
IConfig serverConfig = config.Configs["FreeswitchService"];
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception("No section 'Server' in config file");
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string freeswitchService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (freeswitchService == String.Empty)
throw new Exception("No FreeswitchService in config file");
throw new Exception("No LocalServiceModule in config file");
Object[] args = new Object[] { config };
m_FreeswitchService =