diff options
author | Melanie | 2010-11-21 22:17:25 +0000 |
---|---|---|
committer | Melanie | 2010-11-21 22:17:25 +0000 |
commit | 2b0ef9ad1d46d89e01bc9149c8689aaa0b412587 (patch) | |
tree | c6710886fc78734106049f9b5224f27afadfc256 | |
parent | Correct an error in Robust.ini.example (diff) | |
download | opensim-SC_OLD-2b0ef9ad1d46d89e01bc9149c8689aaa0b412587.zip opensim-SC_OLD-2b0ef9ad1d46d89e01bc9149c8689aaa0b412587.tar.gz opensim-SC_OLD-2b0ef9ad1d46d89e01bc9149c8689aaa0b412587.tar.bz2 opensim-SC_OLD-2b0ef9ad1d46d89e01bc9149c8689aaa0b412587.tar.xz |
Implement a method to allow regions to query the gridwide Freeswitch
configuration from ROBUST
-rw-r--r-- | OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs | 19 | ||||
-rw-r--r-- | OpenSim/Services/FreeswitchService/FreeswitchService.cs | 20 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IFreeswitchService.cs | 1 | ||||
-rw-r--r-- | prebuild.xml | 1 |
4 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs index 150df45..da56b87 100644 --- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs +++ b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs | |||
@@ -35,6 +35,8 @@ using OpenSim.Services.Interfaces; | |||
35 | using OpenSim.Framework.Servers.HttpServer; | 35 | using OpenSim.Framework.Servers.HttpServer; |
36 | using OpenSim.Server.Handlers.Base; | 36 | using OpenSim.Server.Handlers.Base; |
37 | using log4net; | 37 | using log4net; |
38 | using OpenMetaverse; | ||
39 | using OpenMetaverse.StructuredData; | ||
38 | 40 | ||
39 | namespace OpenSim.Server.Handlers.Freeswitch | 41 | namespace OpenSim.Server.Handlers.Freeswitch |
40 | { | 42 | { |
@@ -67,12 +69,16 @@ namespace OpenSim.Server.Handlers.Freeswitch | |||
67 | ServerUtils.LoadPlugin<IFreeswitchService>(freeswitchService, args); | 69 | ServerUtils.LoadPlugin<IFreeswitchService>(freeswitchService, args); |
68 | 70 | ||
69 | server.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler); | 71 | server.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler); |
72 | server.AddHTTPHandler(String.Format("{0}/region-config", m_freeSwitchAPIPrefix), RegionConfigHTTPHandler); | ||
70 | } | 73 | } |
71 | 74 | ||
72 | public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) | 75 | public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) |
73 | { | 76 | { |
74 | Hashtable response = new Hashtable(); | 77 | Hashtable response = new Hashtable(); |
75 | response["str_response_string"] = string.Empty; | 78 | response["str_response_string"] = string.Empty; |
79 | response["content_type"] = "text/plain"; | ||
80 | response["keepalive"] = false; | ||
81 | response["int_response_code"] = 500; | ||
76 | 82 | ||
77 | Hashtable requestBody = ParseRequestBody((string) request["body"]); | 83 | Hashtable requestBody = ParseRequestBody((string) request["body"]); |
78 | 84 | ||
@@ -105,5 +111,18 @@ namespace OpenSim.Server.Handlers.Freeswitch | |||
105 | 111 | ||
106 | return bodyParams; | 112 | return bodyParams; |
107 | } | 113 | } |
114 | |||
115 | public Hashtable RegionConfigHTTPHandler(Hashtable request) | ||
116 | { | ||
117 | Hashtable response = new Hashtable(); | ||
118 | response["content_type"] = "text/json"; | ||
119 | response["keepalive"] = false; | ||
120 | response["int_response_code"] = 200; | ||
121 | |||
122 | response["str_response_string"] = m_FreeswitchService.GetJsonConfig(); | ||
123 | |||
124 | return response; | ||
125 | } | ||
126 | |||
108 | } | 127 | } |
109 | } | 128 | } |
diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs index b62a65a..21518f3 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Framework; | |||
34 | using OpenSim.Data; | 34 | using OpenSim.Data; |
35 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenMetaverse.StructuredData; | ||
37 | using System.Collections; | 38 | using System.Collections; |
38 | 39 | ||
39 | namespace OpenSim.Services.FreeswitchService | 40 | namespace OpenSim.Services.FreeswitchService |
@@ -384,5 +385,24 @@ namespace OpenSim.Services.FreeswitchService | |||
384 | 385 | ||
385 | return response; | 386 | return response; |
386 | } | 387 | } |
388 | |||
389 | public string GetJsonConfig() | ||
390 | { | ||
391 | OSDMap map = new OSDMap(11); | ||
392 | |||
393 | map.Add("Realm", m_freeSwitchRealm); | ||
394 | map.Add("SIPProxy", m_freeSwitchSIPProxy); | ||
395 | map.Add("AttemptUseSTUN", m_freeSwitchAttemptUseSTUN); | ||
396 | map.Add("EchoServer", m_freeSwitchEchoServer); | ||
397 | map.Add("EchoPort", m_freeSwitchEchoPort); | ||
398 | map.Add("DefaultWellKnownIP", m_freeSwitchDefaultWellKnownIP); | ||
399 | map.Add("DefaultTimeout", m_freeSwitchDefaultTimeout); | ||
400 | map.Add("Context", m_freeSwitchContext); | ||
401 | map.Add("ServerUser", m_freeSwitchServerUser); | ||
402 | map.Add("ServerPass", m_freeSwitchServerPass); | ||
403 | map.Add("APIPrefix", m_freeSwitchAPIPrefix); | ||
404 | |||
405 | return OSDParser.SerializeJsonString(map); | ||
406 | } | ||
387 | } | 407 | } |
388 | } | 408 | } |
diff --git a/OpenSim/Services/Interfaces/IFreeswitchService.cs b/OpenSim/Services/Interfaces/IFreeswitchService.cs index 2b3ffeb..e7941d5 100644 --- a/OpenSim/Services/Interfaces/IFreeswitchService.cs +++ b/OpenSim/Services/Interfaces/IFreeswitchService.cs | |||
@@ -35,5 +35,6 @@ namespace OpenSim.Services.Interfaces | |||
35 | { | 35 | { |
36 | Hashtable HandleDirectoryRequest(Hashtable requestBody); | 36 | Hashtable HandleDirectoryRequest(Hashtable requestBody); |
37 | Hashtable HandleDialplanRequest(Hashtable requestBody); | 37 | Hashtable HandleDialplanRequest(Hashtable requestBody); |
38 | string GetJsonConfig(); | ||
38 | } | 39 | } |
39 | } | 40 | } |
diff --git a/prebuild.xml b/prebuild.xml index ac003d9..00be4f9 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1023,6 +1023,7 @@ | |||
1023 | <ReferencePath>../../../bin/</ReferencePath> | 1023 | <ReferencePath>../../../bin/</ReferencePath> |
1024 | <Reference name="System"/> | 1024 | <Reference name="System"/> |
1025 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> | 1025 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> |
1026 | <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/> | ||
1026 | <Reference name="OpenMetaverse" path="../../../bin/"/> | 1027 | <Reference name="OpenMetaverse" path="../../../bin/"/> |
1027 | <Reference name="OpenSim.Framework"/> | 1028 | <Reference name="OpenSim.Framework"/> |
1028 | <Reference name="OpenSim.Framework.Console"/> | 1029 | <Reference name="OpenSim.Framework.Console"/> |