From eb1a6e9b87ab7fedc035127b8224147deba2d5ab Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Fri, 17 Jul 2009 21:06:28 +0000
Subject: * Patch from otakup0pe to help freeswitch play nice with complex
existing freeswitch configurations. * Thanks! fixes mantis #3899
---
.../Voice/FreeSwitchVoice/FreeSwitchDialplan.cs | 91 ++++++++++++----------
1 file changed, 50 insertions(+), 41 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 ad2b7e4..d34b6f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs
@@ -26,18 +26,20 @@
*/
using log4net;
+using System;
using System.Reflection;
+using System.Text;
using System.Collections;
namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
public class FreeSwitchDialplan
{
- private static readonly ILog m_log =
- LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private static readonly ILog m_log =
+ 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());
@@ -47,48 +49,55 @@ 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"] = @"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ";
+ if ( 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(@"
+
+
+ " +
+
+/*
+
+
+
+
+
+ */
+
+ @"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ", Context, Realm);
+ }
- return response;
+ return response;
}
}
--
cgit v1.1