diff options
author | Jonathan Freedman | 2010-11-21 20:01:48 -0800 |
---|---|---|
committer | Jonathan Freedman | 2010-11-21 20:01:48 -0800 |
commit | b7f5e8284360f92e0e102b9546076573c57d9397 (patch) | |
tree | 132663da8c1882e524241b55a739ef2758ef8958 /OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs | |
parent | Merge https://github.com/opensim/opensim into mantis5110 (diff) | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
download | opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.zip opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.gz opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.bz2 opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.xz |
Merge branch 'master-core' into mantis5110
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 | } |