diff options
author | Melanie | 2010-11-21 20:59:01 +0000 |
---|---|---|
committer | Melanie | 2010-11-21 20:59:01 +0000 |
commit | 1cf8eb8a90749b215bc4e8b7beb37b927e101dce (patch) | |
tree | 016cd1d25c52af5edcea6e2c3abe4515c464e966 /OpenSim/Services | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC_OLD-1cf8eb8a90749b215bc4e8b7beb37b927e101dce.zip opensim-SC_OLD-1cf8eb8a90749b215bc4e8b7beb37b927e101dce.tar.gz opensim-SC_OLD-1cf8eb8a90749b215bc4e8b7beb37b927e101dce.tar.bz2 opensim-SC_OLD-1cf8eb8a90749b215bc4e8b7beb37b927e101dce.tar.xz |
Start implementing Freeswitch in ROBUST
Diffstat (limited to 'OpenSim/Services')
3 files changed, 48 insertions, 4 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; | |||
33 | using OpenSim.Data; | 33 | using OpenSim.Data; |
34 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using System.Collections; | ||
36 | 37 | ||
37 | namespace OpenSim.Services.FreeswitchService | 38 | namespace 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; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Services.Interfaces; | 32 | using OpenSim.Services.Interfaces; |
33 | using OpenSim.Services.Base; | 33 | using OpenSim.Services.Base; |
34 | using log4net; | ||
34 | 35 | ||
35 | namespace OpenSim.Services.FreeswitchService | 36 | namespace 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 | } |
diff --git a/OpenSim/Services/Interfaces/IFreeswitchService.cs b/OpenSim/Services/Interfaces/IFreeswitchService.cs index d1f635b..2b3ffeb 100644 --- a/OpenSim/Services/Interfaces/IFreeswitchService.cs +++ b/OpenSim/Services/Interfaces/IFreeswitchService.cs | |||
@@ -27,11 +27,13 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
30 | using System.Collections; | ||
30 | 31 | ||
31 | namespace OpenSim.Services.Interfaces | 32 | namespace OpenSim.Services.Interfaces |
32 | { | 33 | { |
33 | public interface IFreeswitchService | 34 | public interface IFreeswitchService |
34 | { | 35 | { |
35 | // Place anything the connector eeds to access here! | 36 | Hashtable HandleDirectoryRequest(Hashtable requestBody); |
37 | Hashtable HandleDialplanRequest(Hashtable requestBody); | ||
36 | } | 38 | } |
37 | } | 39 | } |