From 7fc9358ec36b40c8226a0d76fd9cb5ae70151b5e Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 8 Aug 2009 03:29:00 +0100 Subject: Patch from otakup0pe: A better solution for making the FreeSwitch module cooperate with existing installations --- .../Voice/FreeSwitchVoice/FreeSwitchDialplan.cs | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs') diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs index c05d598..b1f93e9 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs @@ -26,7 +26,9 @@ */ using log4net; +using System; using System.Reflection; +using System.Text; using System.Collections; namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice @@ -37,7 +39,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public Hashtable HandleDialplanRequest(Hashtable request) + public Hashtable HandleDialplanRequest(string Context, string Realm, Hashtable request) { m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); @@ -48,33 +50,39 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); } + string requestcontext = (string) request["Hunt-Context"]; response["content_type"] = "text/xml"; response["keepalive"] = false; - response["int_response_code"] = 200; - response["str_response_string"] = @" + response["int_response_code"] = 200; + if ( Context != String.Empty && Context != requestcontext) + { + m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); + response["str_response_string"] = ""; + } else { + response["str_response_string"] = String.Format(@"
- + " + - +/* - + */ - + @" - + - + @@ -86,7 +94,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
-
"; + ", Context, Realm); + } return response; } -- cgit v1.1