diff options
author | Teravus Ovares | 2009-07-17 21:06:28 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-07-17 21:06:28 +0000 |
commit | eb1a6e9b87ab7fedc035127b8224147deba2d5ab (patch) | |
tree | e6f55e0237bb05250ec7406b9f0736db2e3f0d33 /OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs | |
parent | * Another attempt to remedy the 'ghost prim' situation. This time for attach... (diff) | |
download | opensim-SC-eb1a6e9b87ab7fedc035127b8224147deba2d5ab.zip opensim-SC-eb1a6e9b87ab7fedc035127b8224147deba2d5ab.tar.gz opensim-SC-eb1a6e9b87ab7fedc035127b8224147deba2d5ab.tar.bz2 opensim-SC-eb1a6e9b87ab7fedc035127b8224147deba2d5ab.tar.xz |
* Patch from otakup0pe to help freeswitch play nice with complex existing freeswitch configurations.
* Thanks! fixes mantis #3899
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs | 91 |
1 files changed, 50 insertions, 41 deletions
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 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using System; | ||
29 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Text; | ||
30 | using System.Collections; | 32 | using System.Collections; |
31 | 33 | ||
32 | namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | 34 | namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice |
33 | { | 35 | { |
34 | public class FreeSwitchDialplan | 36 | public class FreeSwitchDialplan |
35 | { | 37 | { |
36 | private static readonly ILog m_log = | 38 | private static readonly ILog m_log = |
37 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
38 | 40 | ||
39 | 41 | ||
40 | public Hashtable HandleDialplanRequest(Hashtable request) | 42 | public Hashtable HandleDialplanRequest(string Context, string Realm, Hashtable request) |
41 | { | 43 | { |
42 | m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); | 44 | m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); |
43 | 45 | ||
@@ -47,48 +49,55 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
47 | { | 49 | { |
48 | m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); | 50 | m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); |
49 | } | 51 | } |
50 | 52 | ||
53 | string requestcontext = (string) request["Hunt-Context"]; | ||
51 | response["content_type"] = "text/xml"; | 54 | response["content_type"] = "text/xml"; |
52 | response["keepalive"] = false; | 55 | response["keepalive"] = false; |
53 | response["int_response_code"] = 200; | 56 | response["int_response_code"] = 200; |
54 | response["str_response_string"] = @"<?xml version=""1.0"" encoding=""utf-8""?> | 57 | if ( Context != requestcontext ) |
55 | <document type=""freeswitch/xml""> | 58 | { |
56 | <section name=""dialplan""> | 59 | m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); |
57 | <context name=""default""> | 60 | response["str_response_string"] = ""; |
58 | 61 | } else { | |
59 | <!-- dial via SIP uri --> | 62 | response["str_response_string"] = String.Format(@"<?xml version=""1.0"" encoding=""utf-8""?> |
60 | <extension name=""sip_uri""> | 63 | <document type=""freeswitch/xml""> |
61 | <condition field=""destination_number"" expression=""^sip:(.*)$""> | 64 | <section name=""dialplan""> |
62 | <action application=""bridge"" data=""sofia/${use_profile}/$1""/> | 65 | <context name=""{0}"">" + |
63 | <!--<action application=""bridge"" data=""$1""/>--> | 66 | |
64 | </condition> | 67 | /* <!-- dial via SIP uri --> |
65 | </extension> | 68 | <extension name=""sip_uri""> |
66 | 69 | <condition field=""destination_number"" expression=""^sip:(.*)$""> | |
67 | <extension name=""opensim_conferences""> | 70 | <action application=""bridge"" data=""sofia/${use_profile}/$1""/> |
68 | <condition field=""destination_number"" expression=""^confctl-(.*)$""> | 71 | <!--<action application=""bridge"" data=""$1""/>--> |
69 | <action application=""answer""/> | 72 | </condition> |
70 | <action application=""conference"" data=""$1-${domain_name}@default""/> | 73 | </extension>*/ |
71 | </condition> | 74 | |
72 | </extension> | 75 | @"<extension name=""opensim_conferences""> |
73 | 76 | <condition field=""destination_number"" expression=""^confctl-(.*)$""> | |
74 | <extension name=""opensim_conf""> | 77 | <action application=""answer""/> |
75 | <condition field=""destination_number"" expression=""^conf-(.*)$""> | 78 | <action application=""conference"" data=""$1-{1}@grid""/> |
76 | <action application=""answer""/> | 79 | </condition> |
77 | <action application=""conference"" data=""$1-${domain_name}@default""/> | 80 | </extension> |
78 | </condition> | 81 | |
79 | </extension> | 82 | <extension name=""opensim_conf""> |
80 | 83 | <condition field=""destination_number"" expression=""^conf-(.*)$""> | |
81 | <extension name=""avatar""> | 84 | <action application=""answer""/> |
82 | <condition field=""destination_number"" expression=""^(x.*)$""> | 85 | <action application=""conference"" data=""$1-${domain_name}@default""/> |
83 | <action application=""bridge"" data=""user/$1""/> | 86 | </condition> |
84 | </condition> | 87 | </extension> |
85 | </extension> | 88 | |
86 | 89 | <extension name=""avatar""> | |
87 | </context> | 90 | <condition field=""destination_number"" expression=""^(x.*)$""> |
88 | </section> | 91 | <action application=""bridge"" data=""user/$1""/> |
89 | </document>"; | 92 | </condition> |
93 | </extension> | ||
94 | |||
95 | </context> | ||
96 | </section> | ||
97 | </document>", Context, Realm); | ||
98 | } | ||
90 | 99 | ||
91 | return response; | 100 | return response; |
92 | } | 101 | } |
93 | } | 102 | } |
94 | 103 | ||