aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
diff options
context:
space:
mode:
authorTeravus Ovares2009-04-22 06:07:39 +0000
committerTeravus Ovares2009-04-22 06:07:39 +0000
commitc397f05be74487d18eb2e60d52dadffc496aa19e (patch)
tree5cddd1cc17eb006a41bfec39b0f55c596ec402cc /OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
parentChange the default for FreeSwitch Voice to disable. Most people don't have (diff)
downloadopensim-SC_OLD-c397f05be74487d18eb2e60d52dadffc496aa19e.zip
opensim-SC_OLD-c397f05be74487d18eb2e60d52dadffc496aa19e.tar.gz
opensim-SC_OLD-c397f05be74487d18eb2e60d52dadffc496aa19e.tar.bz2
opensim-SC_OLD-c397f05be74487d18eb2e60d52dadffc496aa19e.tar.xz
* Some tweaks to the FreeSwitchModule to allow a well known hostname and avoid a double // in a path which causes account verification to fail
* The change shouldn't affect anyone who has it working currently and makes it a ton easier for everyone else to get it working. * Handle a case when there's no Event-Calling-Function but it's obviously a REGISTER method
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs21
1 files changed, 13 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index fcb1c97..6fb2c53 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -90,6 +90,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
90 private static int m_freeSwitchSubscribeRetry; 90 private static int m_freeSwitchSubscribeRetry;
91 private static string m_freeSwitchUrlResetPassword; 91 private static string m_freeSwitchUrlResetPassword;
92 private static IPEndPoint m_FreeSwitchServiceIP; 92 private static IPEndPoint m_FreeSwitchServiceIP;
93 private int m_freeSwitchServicePort;
94 private string m_openSimWellKnownHTTPAddress;
93 95
94 private FreeSwitchDirectory m_FreeSwitchDirectory; 96 private FreeSwitchDirectory m_FreeSwitchDirectory;
95 private FreeSwitchDialplan m_FreeSwitchDialplan; 97 private FreeSwitchDialplan m_FreeSwitchDialplan;
@@ -131,7 +133,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
131 int servicePort = m_config.GetInt("freeswitch_service_port", 80); 133 int servicePort = m_config.GetInt("freeswitch_service_port", 80);
132 IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); 134 IPAddress serviceIPAddress = IPAddress.Parse(serviceIP);
133 m_FreeSwitchServiceIP = new IPEndPoint(serviceIPAddress, servicePort); 135 m_FreeSwitchServiceIP = new IPEndPoint(serviceIPAddress, servicePort);
134 136 m_freeSwitchServicePort = servicePort;
135 m_freeSwitchRealm = m_config.GetString("freeswitch_realm", String.Empty); 137 m_freeSwitchRealm = m_config.GetString("freeswitch_realm", String.Empty);
136 m_freeSwitchSIPProxy = m_config.GetString("freeswitch_sip_proxy", m_freeSwitchRealm); 138 m_freeSwitchSIPProxy = m_config.GetString("freeswitch_sip_proxy", m_freeSwitchRealm);
137 m_freeSwitchAttemptUseSTUN = m_config.GetBoolean("freeswitch_attempt_stun", true); 139 m_freeSwitchAttemptUseSTUN = m_config.GetBoolean("freeswitch_attempt_stun", true);
@@ -139,6 +141,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
139 m_freeSwitchEchoServer = m_config.GetString("freeswitch_echo_server", m_freeSwitchRealm); 141 m_freeSwitchEchoServer = m_config.GetString("freeswitch_echo_server", m_freeSwitchRealm);
140 m_freeSwitchEchoPort = m_config.GetInt("freeswitch_echo_port", 50505); 142 m_freeSwitchEchoPort = m_config.GetInt("freeswitch_echo_port", 50505);
141 m_freeSwitchDefaultWellKnownIP = m_config.GetString("freeswitch_well_known_ip", m_freeSwitchRealm); 143 m_freeSwitchDefaultWellKnownIP = m_config.GetString("freeswitch_well_known_ip", m_freeSwitchRealm);
144 m_openSimWellKnownHTTPAddress = m_config.GetString("opensim_well_known_http_address", serviceIPAddress.ToString());
142 m_freeSwitchDefaultTimeout = m_config.GetInt("freeswitch_default_timeout", 5000); 145 m_freeSwitchDefaultTimeout = m_config.GetInt("freeswitch_default_timeout", 5000);
143 m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); 146 m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120);
144 m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); 147 m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty);
@@ -306,12 +309,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
306 // those 309 // those
307 310
308 agentname = agentname.Replace('+', '-').Replace('/', '_'); 311 agentname = agentname.Replace('+', '-').Replace('/', '_');
309 312
310 // LLSDVoiceAccountResponse voiceAccountResponse = 313 // LLSDVoiceAccountResponse voiceAccountResponse =
311 // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api"); 314 // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api");
312 LLSDVoiceAccountResponse voiceAccountResponse = 315 LLSDVoiceAccountResponse voiceAccountResponse =
313 new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, 316 new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm,
314 String.Format("http://{0}/{1}/", m_FreeSwitchServiceIP, 317 String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress, m_freeSwitchServicePort,
315 m_freeSwitchAPIPrefix)); 318 m_freeSwitchAPIPrefix));
316 319
317 string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); 320 string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse);
@@ -490,20 +493,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
490 493
491 public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) 494 public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request)
492 { 495 {
493 m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}",request.ToString()); 496 m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}", (string)request["body"]);
494 497
495 Hashtable response = new Hashtable(); 498 Hashtable response = new Hashtable();
496 499
497 // all the params come as NVPs in the request body 500 // all the params come as NVPs in the request body
498 Hashtable requestBody = parseRequestBody((string) request["body"]); 501 Hashtable requestBody = parseRequestBody((string) request["body"]);
499 502
500 // is this a dialplan or directory request 503 // is this a dialplan or directory request
501 string section = (string) requestBody["section"]; 504 string section = (string) requestBody["section"];
502 505
503 if (section=="directory") 506 if (section == "directory")
504 response = m_FreeSwitchDirectory.HandleDirectoryRequest(requestBody); 507 response = m_FreeSwitchDirectory.HandleDirectoryRequest(requestBody);
505 else if (section=="dialplan") 508 else if (section == "dialplan")
506 response = m_FreeSwitchDialplan.HandleDialplanRequest(requestBody); 509 response = m_FreeSwitchDialplan.HandleDialplanRequest(requestBody);
510 else
511 m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section);
507 512
508 // XXX: re-generate dialplan: 513 // XXX: re-generate dialplan:
509 // - conf == region UUID 514 // - conf == region UUID