aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/FreeswitchService
diff options
context:
space:
mode:
authorMelanie2010-11-21 20:59:01 +0000
committerMelanie2010-11-21 21:29:11 +0000
commitc0ccfeebe78dc1d0136f86e5f0e9562c4804cfa9 (patch)
tree84d5075069f51f3d7f0af9f46e9274a8b1531c44 /OpenSim/Services/FreeswitchService
parentFix global region coordinates that are delivered by llRequestSimulatorData. (diff)
downloadopensim-SC_OLD-c0ccfeebe78dc1d0136f86e5f0e9562c4804cfa9.zip
opensim-SC_OLD-c0ccfeebe78dc1d0136f86e5f0e9562c4804cfa9.tar.gz
opensim-SC_OLD-c0ccfeebe78dc1d0136f86e5f0e9562c4804cfa9.tar.bz2
opensim-SC_OLD-c0ccfeebe78dc1d0136f86e5f0e9562c4804cfa9.tar.xz
Start implementing Freeswitch in ROBUST
Diffstat (limited to 'OpenSim/Services/FreeswitchService')
-rw-r--r--OpenSim/Services/FreeswitchService/FreeswitchService.cs12
-rw-r--r--OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs36
2 files changed, 45 insertions, 3 deletions
diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs
index 0a38300..109ef9b 100644
--- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs
+++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs
@@ -33,19 +33,27 @@ using OpenSim.Framework;
33using OpenSim.Data; 33using OpenSim.Data;
34using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35using OpenMetaverse; 35using OpenMetaverse;
36using System.Collections;
36 37
37namespace OpenSim.Services.FreeswitchService 38namespace OpenSim.Services.FreeswitchService
38{ 39{
39 public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService 40 public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService
40 { 41 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 43
43 public FreeswitchService(IConfigSource config) : base(config) 44 public FreeswitchService(IConfigSource config) : base(config)
44 { 45 {
45 // Perform initilialization here 46 // Perform initilialization here
46 } 47 }
47 48
49 public Hashtable HandleDirectoryRequest(Hashtable requestBody)
50 {
51 return new Hashtable();
52 }
48 53
49 // Implement IFreeswitchService here 54 public Hashtable HandleDialplanRequest(Hashtable requestBody)
55 {
56 return new Hashtable();
57 }
50 } 58 }
51} 59}
diff --git a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
index 83fecef..ebbb1b0 100644
--- a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
+++ b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
@@ -31,11 +31,28 @@ using Nini.Config;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
33using OpenSim.Services.Base; 33using OpenSim.Services.Base;
34using log4net;
34 35
35namespace OpenSim.Services.FreeswitchService 36namespace OpenSim.Services.FreeswitchService
36{ 37{
37 public class FreeswitchServiceBase : ServiceBase 38 public class FreeswitchServiceBase : ServiceBase
38 { 39 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41
42 protected string m_freeSwitchRealm;
43 protected string m_freeSwitchSIPProxy;
44 protected bool m_freeSwitchAttemptUseSTUN = false;
45 protected string m_freeSwitchEchoServer;
46 protected int m_freeSwitchEchoPort = 50505;
47 protected string m_freeSwitchDefaultWellKnownIP;
48 protected int m_freeSwitchDefaultTimeout = 5000;
49 protected string m_freeSwitchContext = "default";
50 protected string m_freeSwitchServerUser = "freeswitch";
51 protected string m_freeSwitchServerPass = "password";
52 protected readonly string m_freeSwitchAPIPrefix = "/fsapi";
53
54 protected bool m_Enabled = false;
55
39 public FreeswitchServiceBase(IConfigSource config) : base(config) 56 public FreeswitchServiceBase(IConfigSource config) : base(config)
40 { 57 {
41 // 58 //
@@ -44,7 +61,24 @@ namespace OpenSim.Services.FreeswitchService
44 IConfig freeswitchConfig = config.Configs["FreeswitchService"]; 61 IConfig freeswitchConfig = config.Configs["FreeswitchService"];
45 if (freeswitchConfig != null) 62 if (freeswitchConfig != null)
46 { 63 {
47 // Read config here !! 64 m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty);
65 if (m_freeSwitchDefaultWellKnownIP == String.Empty)
66 {
67 m_log.Error("[FREESWITCH]: No FreeswitchServerAddress given, can't continue");
68 return;
69 }
70
71 m_freeSwitchRealm = freeswitchConfig.GetString("Realm", m_freeSwitchDefaultWellKnownIP);
72 m_freeSwitchSIPProxy = freeswitchConfig.GetString("SIPProxy", m_freeSwitchDefaultWellKnownIP + ":5060");
73 m_freeSwitchEchoServer = freeswitchConfig.GetString("EchoServer", m_freeSwitchDefaultWellKnownIP);
74 m_freeSwitchEchoPort = freeswitchConfig.GetInt("EchoPort", m_freeSwitchEchoPort);
75 m_freeSwitchAttemptUseSTUN = freeswitchConfig.GetBoolean("AttemptSTUN", false); // This may not work
76 m_freeSwitchDefaultTimeout = freeswitchConfig.GetInt("DefaultTimeout", m_freeSwitchDefaultTimeout);
77 m_freeSwitchContext = freeswitchConfig.GetString("Context", m_freeSwitchContext);
78 m_freeSwitchServerUser = freeswitchConfig.GetString("UserName", m_freeSwitchServerUser);
79 m_freeSwitchServerPass = freeswitchConfig.GetString("Password", m_freeSwitchServerPass);
80
81 m_Enabled = true;
48 } 82 }
49 } 83 }
50 } 84 }