mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
Start implementing Freeswitch in ROBUST
This commit is contained in:
@@ -31,11 +31,28 @@ using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Services.Base;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Services.FreeswitchService
|
||||
{
|
||||
public class FreeswitchServiceBase : ServiceBase
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected string m_freeSwitchRealm;
|
||||
protected string m_freeSwitchSIPProxy;
|
||||
protected bool m_freeSwitchAttemptUseSTUN = false;
|
||||
protected string m_freeSwitchEchoServer;
|
||||
protected int m_freeSwitchEchoPort = 50505;
|
||||
protected string m_freeSwitchDefaultWellKnownIP;
|
||||
protected int m_freeSwitchDefaultTimeout = 5000;
|
||||
protected string m_freeSwitchContext = "default";
|
||||
protected string m_freeSwitchServerUser = "freeswitch";
|
||||
protected string m_freeSwitchServerPass = "password";
|
||||
protected readonly string m_freeSwitchAPIPrefix = "/fsapi";
|
||||
|
||||
protected bool m_Enabled = false;
|
||||
|
||||
public FreeswitchServiceBase(IConfigSource config) : base(config)
|
||||
{
|
||||
//
|
||||
@@ -44,7 +61,24 @@ namespace OpenSim.Services.FreeswitchService
|
||||
IConfig freeswitchConfig = config.Configs["FreeswitchService"];
|
||||
if (freeswitchConfig != null)
|
||||
{
|
||||
// Read config here !!
|
||||
m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty);
|
||||
if (m_freeSwitchDefaultWellKnownIP == String.Empty)
|
||||
{
|
||||
m_log.Error("[FREESWITCH]: No FreeswitchServerAddress given, can't continue");
|
||||
return;
|
||||
}
|
||||
|
||||
m_freeSwitchRealm = freeswitchConfig.GetString("Realm", m_freeSwitchDefaultWellKnownIP);
|
||||
m_freeSwitchSIPProxy = freeswitchConfig.GetString("SIPProxy", m_freeSwitchDefaultWellKnownIP + ":5060");
|
||||
m_freeSwitchEchoServer = freeswitchConfig.GetString("EchoServer", m_freeSwitchDefaultWellKnownIP);
|
||||
m_freeSwitchEchoPort = freeswitchConfig.GetInt("EchoPort", m_freeSwitchEchoPort);
|
||||
m_freeSwitchAttemptUseSTUN = freeswitchConfig.GetBoolean("AttemptSTUN", false); // This may not work
|
||||
m_freeSwitchDefaultTimeout = freeswitchConfig.GetInt("DefaultTimeout", m_freeSwitchDefaultTimeout);
|
||||
m_freeSwitchContext = freeswitchConfig.GetString("Context", m_freeSwitchContext);
|
||||
m_freeSwitchServerUser = freeswitchConfig.GetString("UserName", m_freeSwitchServerUser);
|
||||
m_freeSwitchServerPass = freeswitchConfig.GetString("Password", m_freeSwitchServerPass);
|
||||
|
||||
m_Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user