diff options
author | Diva Canto | 2010-11-21 17:19:45 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-21 17:19:45 -0800 |
commit | 0fec29c849044ff1aaa75bd4ba93eaa3d41cf9fa (patch) | |
tree | 09a0c5bc899a61ba38320a14861f656e86f7b73b /OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs | |
parent | Added creator info across the board -- TaskInventoryItems and InventoryItems ... (diff) | |
parent | Add the remote connector for freeswitch config retrieval (diff) | |
download | opensim-SC-0fec29c849044ff1aaa75bd4ba93eaa3d41cf9fa.zip opensim-SC-0fec29c849044ff1aaa75bd4ba93eaa3d41cf9fa.tar.gz opensim-SC-0fec29c849044ff1aaa75bd4ba93eaa3d41cf9fa.tar.bz2 opensim-SC-0fec29c849044ff1aaa75bd4ba93eaa3d41cf9fa.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs')
-rw-r--r-- | OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs | 36 |
1 files changed, 35 insertions, 1 deletions
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 | } |