aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
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
parentChange the default for FreeSwitch Voice to disable. Most people don't have (diff)
downloadopensim-SC-c397f05be74487d18eb2e60d52dadffc496aa19e.zip
opensim-SC-c397f05be74487d18eb2e60d52dadffc496aa19e.tar.gz
opensim-SC-c397f05be74487d18eb2e60d52dadffc496aa19e.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs14
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs21
2 files changed, 26 insertions, 9 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
index 4113976..24f114d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
@@ -69,7 +69,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
69 } 69 }
70 70
71 string eventCallingFunction = (string) request["Event-Calling-Function"]; 71 string eventCallingFunction = (string) request["Event-Calling-Function"];
72 72 if (eventCallingFunction == null)
73 {
74 eventCallingFunction = "sofia_reg_parse_auth";
75 }
76
77 if (eventCallingFunction.Length == 0)
78 {
79 eventCallingFunction = "sofia_reg_parse_auth";
80 }
73 81
74 if (eventCallingFunction=="sofia_reg_parse_auth") 82 if (eventCallingFunction=="sofia_reg_parse_auth")
75 { 83 {
@@ -110,12 +118,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
110 //response = HandleLoadNetworkLists(request); 118 //response = HandleLoadNetworkLists(request);
111 response["int_response_code"]=404; 119 response["int_response_code"]=404;
112 response["keepalive"] = false; 120 response["keepalive"] = false;
121 response["content_type"] = "text/xml";
122 response["str_response_string"] = "";
113 } 123 }
114 else 124 else
115 { 125 {
116 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); 126 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction);
117 response["int_response_code"]=404; 127 response["int_response_code"]=404;
118 response["keepalive"] = false; 128 response["keepalive"] = false;
129 response["content_type"] = "text/xml";
130 response["str_response_string"] = "";
119 } 131 }
120 132
121 133
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