aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Voice
diff options
context:
space:
mode:
authorMelanie2010-01-29 07:20:13 +0000
committerMelanie2010-01-29 07:21:06 +0000
commita87a247f0548d39a8c39b1d28123d7da8db44598 (patch)
tree7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/OptionalModules/Avatar/Voice
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.zip
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs72
1 files changed, 20 insertions, 52 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 23ae307..b04b076 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -38,7 +38,6 @@ using System.Collections.Generic;
38using System.Reflection; 38using System.Reflection;
39using OpenMetaverse; 39using OpenMetaverse;
40using log4net; 40using log4net;
41using Mono.Addins;
42using Nini.Config; 41using Nini.Config;
43using Nwc.XmlRpc; 42using Nwc.XmlRpc;
44using OpenSim.Framework; 43using OpenSim.Framework;
@@ -54,8 +53,7 @@ using System.Text.RegularExpressions;
54 53
55namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice 54namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
56{ 55{
57 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 56 public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule
58 public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule
59 { 57 {
60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
61 59
@@ -110,8 +108,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
110 108
111 private IConfig m_config; 109 private IConfig m_config;
112 110
113 public void Initialise(IConfigSource config) 111 public void Initialise(Scene scene, IConfigSource config)
114 { 112 {
113 m_scene = scene;
115 m_config = config.Configs["FreeSwitchVoice"]; 114 m_config = config.Configs["FreeSwitchVoice"];
116 115
117 if (null == m_config) 116 if (null == m_config)
@@ -225,21 +224,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
225 return; 224 return;
226 } 225 }
227 } 226 }
228 }
229 227
230 public void AddRegion(Scene scene) 228 if (m_pluginEnabled)
231 {
232 m_scene = scene;
233 if (m_pluginEnabled)
234 { 229 {
235 // we need to capture scene in an anonymous method 230 // we need to capture scene in an anonymous method
236 // here as we need it later in the callbacks 231 // here as we need it later in the callbacks
237 scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps) 232 scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps)
238 { 233 {
239 OnRegisterCaps(scene, agentID, caps); 234 OnRegisterCaps(scene, agentID, caps);
240 }; 235 };
241 236
242 237
243 238
244 try 239 try
245 { 240 {
@@ -259,53 +254,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
259 m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); 254 m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions.");
260 } 255 }
261 } 256 }
262 257
263 } 258 }
259 }
260
261 public void PostInitialise()
262 {
264 if (m_pluginEnabled) 263 if (m_pluginEnabled)
265 { 264 {
266 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); 265 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
267 266
268 // register the voice interface for this module, so the script engine can call us 267 // register the voice interface for this module, so the script engine can call us
269 m_scene.RegisterModuleInterface<IVoiceModule>(this); 268 m_scene.RegisterModuleInterface<IVoiceModule>(this);
270 } 269 }
271 } 270 }
272 271
273 public void RegionLoaded(Scene scene)
274 {
275 }
276
277 public void RemoveRegion(Scene scene)
278 {
279 if (UseProxy)
280 {
281 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/", m_freeSwitchAPIPrefix));
282 }
283 else
284 {
285 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix));
286
287 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix));
288
289 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix));
290
291 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix));
292 }
293 scene.EventManager.OnRegisterCaps -= delegate(UUID agentID, Caps caps)
294 {
295 OnRegisterCaps(scene, agentID, caps);
296 };
297 scene.UnregisterModuleInterface<IVoiceModule>(this);
298 }
299
300 public Type ReplaceableInterface
301 {
302 get { return null; }
303 }
304
305 public void PostInitialise()
306 {
307 }
308
309 public void Close() 272 public void Close()
310 { 273 {
311 } 274 }
@@ -314,6 +277,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
314 { 277 {
315 get { return "FreeSwitchVoiceModule"; } 278 get { return "FreeSwitchVoiceModule"; }
316 } 279 }
280
281 public bool IsSharedModule
282 {
283 get { return true; }
284 }
317 285
318 // <summary> 286 // <summary>
319 // implementation of IVoiceModule, called by osSetParcelSIPAddress script function 287 // implementation of IVoiceModule, called by osSetParcelSIPAddress script function