diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 6fb2c53..358f1cd 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -54,7 +54,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
54 | // Infrastructure | 54 | // Infrastructure |
55 | private static readonly ILog m_log = | 55 | private static readonly ILog m_log = |
56 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 56 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
57 | private static readonly bool DUMP = true; | ||
58 | 57 | ||
59 | // Capability string prefixes | 58 | // Capability string prefixes |
60 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; | 59 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; |
@@ -87,9 +86,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
87 | private static int m_freeSwitchEchoPort; | 86 | private static int m_freeSwitchEchoPort; |
88 | private static string m_freeSwitchDefaultWellKnownIP; | 87 | private static string m_freeSwitchDefaultWellKnownIP; |
89 | private static int m_freeSwitchDefaultTimeout; | 88 | private static int m_freeSwitchDefaultTimeout; |
90 | private static int m_freeSwitchSubscribeRetry; | 89 | // private static int m_freeSwitchSubscribeRetry; |
91 | private static string m_freeSwitchUrlResetPassword; | 90 | private static string m_freeSwitchUrlResetPassword; |
92 | private static IPEndPoint m_FreeSwitchServiceIP; | 91 | // private static IPEndPoint m_FreeSwitchServiceIP; |
93 | private int m_freeSwitchServicePort; | 92 | private int m_freeSwitchServicePort; |
94 | private string m_openSimWellKnownHTTPAddress; | 93 | private string m_openSimWellKnownHTTPAddress; |
95 | 94 | ||
@@ -132,7 +131,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
132 | string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty); | 131 | string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty); |
133 | int servicePort = m_config.GetInt("freeswitch_service_port", 80); | 132 | int servicePort = m_config.GetInt("freeswitch_service_port", 80); |
134 | IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); | 133 | IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); |
135 | m_FreeSwitchServiceIP = new IPEndPoint(serviceIPAddress, servicePort); | 134 | // m_FreeSwitchServiceIP = new IPEndPoint(serviceIPAddress, servicePort); |
136 | m_freeSwitchServicePort = servicePort; | 135 | m_freeSwitchServicePort = servicePort; |
137 | m_freeSwitchRealm = m_config.GetString("freeswitch_realm", String.Empty); | 136 | m_freeSwitchRealm = m_config.GetString("freeswitch_realm", String.Empty); |
138 | m_freeSwitchSIPProxy = m_config.GetString("freeswitch_sip_proxy", m_freeSwitchRealm); | 137 | m_freeSwitchSIPProxy = m_config.GetString("freeswitch_sip_proxy", m_freeSwitchRealm); |
@@ -143,12 +142,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
143 | m_freeSwitchDefaultWellKnownIP = m_config.GetString("freeswitch_well_known_ip", m_freeSwitchRealm); | 142 | m_freeSwitchDefaultWellKnownIP = m_config.GetString("freeswitch_well_known_ip", m_freeSwitchRealm); |
144 | m_openSimWellKnownHTTPAddress = m_config.GetString("opensim_well_known_http_address", serviceIPAddress.ToString()); | 143 | m_openSimWellKnownHTTPAddress = m_config.GetString("opensim_well_known_http_address", serviceIPAddress.ToString()); |
145 | m_freeSwitchDefaultTimeout = m_config.GetInt("freeswitch_default_timeout", 5000); | 144 | m_freeSwitchDefaultTimeout = m_config.GetInt("freeswitch_default_timeout", 5000); |
146 | m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); | 145 | // m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); |
147 | m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); | 146 | m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); |
148 | 147 | ||
149 | |||
150 | |||
151 | |||
152 | if (String.IsNullOrEmpty(m_freeSwitchServerUser) || | 148 | if (String.IsNullOrEmpty(m_freeSwitchServerUser) || |
153 | String.IsNullOrEmpty(m_freeSwitchServerPass) || | 149 | String.IsNullOrEmpty(m_freeSwitchServerPass) || |
154 | String.IsNullOrEmpty(m_freeSwitchRealm) || | 150 | String.IsNullOrEmpty(m_freeSwitchRealm) || |
@@ -163,12 +159,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
163 | // - prelogin: viv_get_prelogin.php | 159 | // - prelogin: viv_get_prelogin.php |
164 | // - signin: viv_signin.php | 160 | // - signin: viv_signin.php |
165 | scene.CommsManager.HttpServer.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), | 161 | scene.CommsManager.HttpServer.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), |
166 | FreeSwitchSLVoiceGetPreloginHTTPHandler); | 162 | FreeSwitchSLVoiceGetPreloginHTTPHandler); |
167 | 163 | ||
168 | // RestStreamHandler h = new RestStreamHandler("GET", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); | 164 | // RestStreamHandler h = new |
165 | // RestStreamHandler("GET", | ||
166 | // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); | ||
169 | // scene.CommsManager.HttpServer.AddStreamHandler(h); | 167 | // scene.CommsManager.HttpServer.AddStreamHandler(h); |
170 | |||
171 | |||
172 | 168 | ||
173 | scene.CommsManager.HttpServer.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix), | 169 | scene.CommsManager.HttpServer.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix), |
174 | FreeSwitchSLVoiceSigninHTTPHandler); | 170 | FreeSwitchSLVoiceSigninHTTPHandler); |
@@ -307,15 +303,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
307 | // XXX: we need to cache the voice credentials, as | 303 | // XXX: we need to cache the voice credentials, as |
308 | // FreeSwitch is later going to come and ask us for | 304 | // FreeSwitch is later going to come and ask us for |
309 | // those | 305 | // those |
310 | |||
311 | agentname = agentname.Replace('+', '-').Replace('/', '_'); | 306 | agentname = agentname.Replace('+', '-').Replace('/', '_'); |
312 | 307 | ||
313 | // LLSDVoiceAccountResponse voiceAccountResponse = | 308 | // LLSDVoiceAccountResponse voiceAccountResponse = |
314 | // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api"); | 309 | // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api"); |
315 | LLSDVoiceAccountResponse voiceAccountResponse = | 310 | LLSDVoiceAccountResponse voiceAccountResponse = |
316 | new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, | 311 | new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, |
317 | String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress, m_freeSwitchServicePort, | 312 | String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress, |
318 | m_freeSwitchAPIPrefix)); | 313 | m_freeSwitchServicePort, m_freeSwitchAPIPrefix)); |
319 | 314 | ||
320 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 315 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
321 | 316 | ||
@@ -346,7 +341,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
346 | UUID agentID, Caps caps) | 341 | UUID agentID, Caps caps) |
347 | { | 342 | { |
348 | ScenePresence avatar = scene.GetScenePresence(agentID); | 343 | ScenePresence avatar = scene.GetScenePresence(agentID); |
349 | string avatarName = avatar.Name; | 344 | string avatarName = avatar.Name; |
350 | 345 | ||
351 | // - check whether we have a region channel in our cache | 346 | // - check whether we have a region channel in our cache |
352 | // - if not: | 347 | // - if not: |
@@ -460,11 +455,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
460 | "<UrlPrivacyNotice>{8}</UrlPrivacyNotice>\r\n"+ | 455 | "<UrlPrivacyNotice>{8}</UrlPrivacyNotice>\r\n"+ |
461 | "<UrlEulaNotice/>\r\n"+ | 456 | "<UrlEulaNotice/>\r\n"+ |
462 | "<App.NoBottomLogo>false</App.NoBottomLogo>\r\n"+ | 457 | "<App.NoBottomLogo>false</App.NoBottomLogo>\r\n"+ |
463 | "</VCConfiguration>" | 458 | "</VCConfiguration>", |
464 | , | 459 | m_freeSwitchRealm, m_freeSwitchSIPProxy, m_freeSwitchAttemptUseSTUN, |
465 | m_freeSwitchRealm,m_freeSwitchSIPProxy,m_freeSwitchAttemptUseSTUN, | 460 | m_freeSwitchSTUNServer, m_freeSwitchEchoServer, m_freeSwitchEchoPort, |
466 | m_freeSwitchSTUNServer,m_freeSwitchEchoServer,m_freeSwitchEchoPort, | 461 | m_freeSwitchDefaultWellKnownIP, m_freeSwitchDefaultTimeout, |
467 | m_freeSwitchDefaultWellKnownIP,m_freeSwitchDefaultTimeout,m_freeSwitchUrlResetPassword,""); | 462 | m_freeSwitchUrlResetPassword, ""); |
468 | 463 | ||
469 | response["int_response_code"] = 200; | 464 | response["int_response_code"] = 200; |
470 | 465 | ||
@@ -531,12 +526,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
531 | if (s.Trim() != "") | 526 | if (s.Trim() != "") |
532 | { | 527 | { |
533 | string [] nvp = s.Split(new Char [] {'='}); | 528 | string [] nvp = s.Split(new Char [] {'='}); |
534 | bodyParams.Add(HttpUtility.UrlDecode(nvp[0]),HttpUtility.UrlDecode(nvp[1])); | 529 | bodyParams.Add(HttpUtility.UrlDecode(nvp[0]), HttpUtility.UrlDecode(nvp[1])); |
535 | } | 530 | } |
536 | } | 531 | } |
537 | 532 | ||
538 | return bodyParams; | 533 | return bodyParams; |
539 | |||
540 | } | 534 | } |
541 | 535 | ||
542 | private string ChannelUri(Scene scene, LandData land) | 536 | private string ChannelUri(Scene scene, LandData land) |