aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Voice
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-05 19:07:37 +0000
committerMelanie Thielker2017-01-05 19:07:37 +0000
commitb16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch)
tree6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Region/OptionalModules/Avatar/Voice
parentMake it possible to disable the bakes module in the way it is described in co... (diff)
downloadopensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz
Massive tab and trailing space cleanup
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs60
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs118
2 files changed, 89 insertions, 89 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 3db0781..c6d7fe6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -143,7 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
143 if (String.IsNullOrEmpty(m_freeSwitchRealm) || 143 if (String.IsNullOrEmpty(m_freeSwitchRealm) ||
144 String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) 144 String.IsNullOrEmpty(m_freeSwitchAPIPrefix))
145 { 145 {
146 m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting."); 146 m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting.");
147 return; 147 return;
148 } 148 }
149 149
@@ -168,9 +168,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
168 168
169 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), 169 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix),
170 FreeSwitchSLVoiceBuddyHTTPHandler); 170 FreeSwitchSLVoiceBuddyHTTPHandler);
171 171
172 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix), 172 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix),
173 FreeSwitchSLVoiceWatcherHTTPHandler); 173 FreeSwitchSLVoiceWatcherHTTPHandler);
174 174
175 m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm); 175 m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm);
176 176
@@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
302 public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps) 302 public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps)
303 { 303 {
304 m_log.DebugFormat( 304 m_log.DebugFormat(
305 "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}", 305 "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}",
306 agentID, caps, scene.RegionInfo.RegionName); 306 agentID, caps, scene.RegionInfo.RegionName);
307 307
308 string capsBase = "/CAPS/" + caps.CapsObjectPath; 308 string capsBase = "/CAPS/" + caps.CapsObjectPath;
@@ -352,7 +352,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
352 { 352 {
353 m_log.DebugFormat( 353 m_log.DebugFormat(
354 "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param); 354 "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param);
355 355
356 ScenePresence avatar = scene.GetScenePresence(agentID); 356 ScenePresence avatar = scene.GetScenePresence(agentID);
357 if (avatar == null) 357 if (avatar == null)
358 { 358 {
@@ -423,9 +423,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
423 UUID agentID, Caps caps) 423 UUID agentID, Caps caps)
424 { 424 {
425 m_log.DebugFormat( 425 m_log.DebugFormat(
426 "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", 426 "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}",
427 scene.RegionInfo.RegionName, agentID); 427 scene.RegionInfo.RegionName, agentID);
428 428
429 ScenePresence avatar = scene.GetScenePresence(agentID); 429 ScenePresence avatar = scene.GetScenePresence(agentID);
430 string avatarName = avatar.Name; 430 string avatarName = avatar.Name;
431 431
@@ -512,7 +512,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
512 512
513 m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", 513 m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}",
514 avatarName, request, path, param); 514 avatarName, request, path, param);
515 515
516 return "<llsd>true</llsd>"; 516 return "<llsd>true</llsd>";
517 } 517 }
518 518
@@ -610,7 +610,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
610 public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request) 610 public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request)
611 { 611 {
612 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called"); 612 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called");
613 613
614 Hashtable response = new Hashtable(); 614 Hashtable response = new Hashtable();
615 response["int_response_code"] = 200; 615 response["int_response_code"] = 200;
616 response["str_response_string"] = string.Empty; 616 response["str_response_string"] = string.Empty;
@@ -678,16 +678,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
678// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); 678// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);
679// 679//
680// m_log.DebugFormat( 680// m_log.DebugFormat(
681// "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}", 681// "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}",
682// normalizeEndLines.Replace((string)response["str_response_string"],"")); 682// normalizeEndLines.Replace((string)response["str_response_string"],""));
683 683
684 return response; 684 return response;
685 } 685 }
686 686
687 public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request) 687 public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request)
688 { 688 {
689 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called"); 689 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called");
690 690
691 Hashtable response = new Hashtable(); 691 Hashtable response = new Hashtable();
692 response["int_response_code"] = 200; 692 response["int_response_code"] = 200;
693 response["content-type"] = "text/xml"; 693 response["content-type"] = "text/xml";
@@ -700,8 +700,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
700 700
701 StringBuilder resp = new StringBuilder(); 701 StringBuilder resp = new StringBuilder();
702 resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">"); 702 resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">");
703 703
704 // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't 704 // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't
705 // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop 705 // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop
706 // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply. 706 // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply.
707 // 707 //
@@ -711,19 +711,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
711 <cookie_name>lib_session</cookie_name> 711 <cookie_name>lib_session</cookie_name>
712 <cookie>{0}</cookie> 712 <cookie>{0}</cookie>
713 <auth_token>{0}</auth_token> 713 <auth_token>{0}</auth_token>
714 <body/></level0></response>", auth_token)); 714 <body/></level0></response>", auth_token));
715 715
716 response["str_response_string"] = resp.ToString(); 716 response["str_response_string"] = resp.ToString();
717 717
718// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); 718// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);
719// 719//
720// m_log.DebugFormat( 720// m_log.DebugFormat(
721// "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}", 721// "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}",
722// normalizeEndLines.Replace((string)response["str_response_string"],"")); 722// normalizeEndLines.Replace((string)response["str_response_string"],""));
723 723
724 return response; 724 return response;
725 } 725 }
726 726
727 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) 727 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request)
728 { 728 {
729 //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called"); 729 //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called");
@@ -771,10 +771,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
771 </level0> 771 </level0>
772 </response>", userid, pos, avatarName); 772 </response>", userid, pos, avatarName);
773 773
774 response["int_response_code"] = 200; 774 response["int_response_code"] = 200;
775 775
776// m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response"); 776// m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response");
777 777
778 return response; 778 return response;
779 } 779 }
780 780
@@ -859,23 +859,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
859 response["keepalive"] = false; 859 response["keepalive"] = false;
860 response["int_response_code"] = 500; 860 response["int_response_code"] = 500;
861 861
862 Hashtable requestBody = ParseRequestBody((string)request["body"]); 862 Hashtable requestBody = ParseRequestBody((string)request["body"]);
863 863
864 string section = (string) requestBody["section"]; 864 string section = (string) requestBody["section"];
865 865
866 if (section == "directory") 866 if (section == "directory")
867 { 867 {
868 string eventCallingFunction = (string)requestBody["Event-Calling-Function"]; 868 string eventCallingFunction = (string)requestBody["Event-Calling-Function"];
869 m_log.DebugFormat( 869 m_log.DebugFormat(
870 "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'", 870 "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'",
871 eventCallingFunction); 871 eventCallingFunction);
872 872
873 response = m_FreeswitchService.HandleDirectoryRequest(requestBody); 873 response = m_FreeswitchService.HandleDirectoryRequest(requestBody);
874 } 874 }
875 else if (section == "dialplan") 875 else if (section == "dialplan")
876 { 876 {
877 m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan"); 877 m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan");
878 878
879 response = m_FreeswitchService.HandleDialplanRequest(requestBody); 879 response = m_FreeswitchService.HandleDialplanRequest(requestBody);
880 } 880 }
881 else 881 else
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 5ea4a31..57930d7 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
114 114
115 private static Dictionary<string,string> m_parents = new Dictionary<string,string>(); 115 private static Dictionary<string,string> m_parents = new Dictionary<string,string>();
116 private static bool m_dumpXml; 116 private static bool m_dumpXml;
117 117
118 private IConfig m_config; 118 private IConfig m_config;
119 119
120 private object m_Lock; 120 private object m_Lock;
@@ -153,22 +153,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
153 // Validate against constraints and default if necessary 153 // Validate against constraints and default if necessary
154 if (m_vivoxChannelRollOff < CHAN_ROLL_OFF_MIN || m_vivoxChannelRollOff > CHAN_ROLL_OFF_MAX) 154 if (m_vivoxChannelRollOff < CHAN_ROLL_OFF_MIN || m_vivoxChannelRollOff > CHAN_ROLL_OFF_MAX)
155 { 155 {
156 m_log.WarnFormat("[VivoxVoice] Invalid value for roll off ({0}), reset to {1}.", 156 m_log.WarnFormat("[VivoxVoice] Invalid value for roll off ({0}), reset to {1}.",
157 m_vivoxChannelRollOff, CHAN_ROLL_OFF_DEFAULT); 157 m_vivoxChannelRollOff, CHAN_ROLL_OFF_DEFAULT);
158 m_vivoxChannelRollOff = CHAN_ROLL_OFF_DEFAULT; 158 m_vivoxChannelRollOff = CHAN_ROLL_OFF_DEFAULT;
159 } 159 }
160 160
161 if (m_vivoxChannelMaximumRange < CHAN_MAX_RANGE_MIN || m_vivoxChannelMaximumRange > CHAN_MAX_RANGE_MAX) 161 if (m_vivoxChannelMaximumRange < CHAN_MAX_RANGE_MIN || m_vivoxChannelMaximumRange > CHAN_MAX_RANGE_MAX)
162 { 162 {
163 m_log.WarnFormat("[VivoxVoice] Invalid value for maximum range ({0}), reset to {1}.", 163 m_log.WarnFormat("[VivoxVoice] Invalid value for maximum range ({0}), reset to {1}.",
164 m_vivoxChannelMaximumRange, CHAN_MAX_RANGE_DEFAULT); 164 m_vivoxChannelMaximumRange, CHAN_MAX_RANGE_DEFAULT);
165 m_vivoxChannelMaximumRange = CHAN_MAX_RANGE_DEFAULT; 165 m_vivoxChannelMaximumRange = CHAN_MAX_RANGE_DEFAULT;
166 } 166 }
167 167
168 if (m_vivoxChannelClampingDistance < CHAN_CLAMPING_DISTANCE_MIN || 168 if (m_vivoxChannelClampingDistance < CHAN_CLAMPING_DISTANCE_MIN ||
169 m_vivoxChannelClampingDistance > CHAN_CLAMPING_DISTANCE_MAX) 169 m_vivoxChannelClampingDistance > CHAN_CLAMPING_DISTANCE_MAX)
170 { 170 {
171 m_log.WarnFormat("[VivoxVoice] Invalid value for clamping distance ({0}), reset to {1}.", 171 m_log.WarnFormat("[VivoxVoice] Invalid value for clamping distance ({0}), reset to {1}.",
172 m_vivoxChannelClampingDistance, CHAN_CLAMPING_DISTANCE_DEFAULT); 172 m_vivoxChannelClampingDistance, CHAN_CLAMPING_DISTANCE_DEFAULT);
173 m_vivoxChannelClampingDistance = CHAN_CLAMPING_DISTANCE_DEFAULT; 173 m_vivoxChannelClampingDistance = CHAN_CLAMPING_DISTANCE_DEFAULT;
174 } 174 }
@@ -180,7 +180,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
180 case "presentation" : break; 180 case "presentation" : break;
181 case "auditorium" : break; 181 case "auditorium" : break;
182 default : 182 default :
183 m_log.WarnFormat("[VivoxVoice] Invalid value for channel mode ({0}), reset to {1}.", 183 m_log.WarnFormat("[VivoxVoice] Invalid value for channel mode ({0}), reset to {1}.",
184 m_vivoxChannelMode, CHAN_MODE_DEFAULT); 184 m_vivoxChannelMode, CHAN_MODE_DEFAULT);
185 m_vivoxChannelMode = CHAN_MODE_DEFAULT; 185 m_vivoxChannelMode = CHAN_MODE_DEFAULT;
186 break; 186 break;
@@ -191,7 +191,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
191 case "positional" : break; 191 case "positional" : break;
192 case "channel" : break; 192 case "channel" : break;
193 default : 193 default :
194 m_log.WarnFormat("[VivoxVoice] Invalid value for channel type ({0}), reset to {1}.", 194 m_log.WarnFormat("[VivoxVoice] Invalid value for channel type ({0}), reset to {1}.",
195 m_vivoxChannelType, CHAN_TYPE_DEFAULT); 195 m_vivoxChannelType, CHAN_TYPE_DEFAULT);
196 m_vivoxChannelType = CHAN_TYPE_DEFAULT; 196 m_vivoxChannelType = CHAN_TYPE_DEFAULT;
197 break; 197 break;
@@ -230,7 +230,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
230 230
231 public void AddRegion(Scene scene) 231 public void AddRegion(Scene scene)
232 { 232 {
233 if (m_pluginEnabled) 233 if (m_pluginEnabled)
234 { 234 {
235 lock (vlock) 235 lock (vlock)
236 { 236 {
@@ -238,13 +238,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
238 238
239 string sceneUUID = scene.RegionInfo.RegionID.ToString(); 239 string sceneUUID = scene.RegionInfo.RegionID.ToString();
240 string sceneName = scene.RegionInfo.RegionName; 240 string sceneName = scene.RegionInfo.RegionName;
241 241
242 // Make sure that all local channels are deleted. 242 // Make sure that all local channels are deleted.
243 // So we have to search for the children, and then do an 243 // So we have to search for the children, and then do an
244 // iteration over the set of chidren identified. 244 // iteration over the set of chidren identified.
245 // This assumes that there is just one directory per 245 // This assumes that there is just one directory per
246 // region. 246 // region.
247 247
248 if (VivoxTryGetDirectory(sceneUUID + "D", out channelId)) 248 if (VivoxTryGetDirectory(sceneUUID + "D", out channelId))
249 { 249 {
250 m_log.DebugFormat("[VivoxVoice]: region {0}: uuid {1}: located directory id {2}", 250 m_log.DebugFormat("[VivoxVoice]: region {0}: uuid {1}: located directory id {2}",
@@ -263,7 +263,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
263 { 263 {
264 if (!IsOK(VivoxDeleteChannel(channelId, id))) 264 if (!IsOK(VivoxDeleteChannel(channelId, id)))
265 m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id); 265 m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id);
266 } 266 }
267 } 267 }
268 } 268 }
269 } 269 }
@@ -311,7 +311,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
311 311
312 public void RemoveRegion(Scene scene) 312 public void RemoveRegion(Scene scene)
313 { 313 {
314 if (m_pluginEnabled) 314 if (m_pluginEnabled)
315 { 315 {
316 lock (vlock) 316 lock (vlock)
317 { 317 {
@@ -319,7 +319,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
319 319
320 string sceneUUID = scene.RegionInfo.RegionID.ToString(); 320 string sceneUUID = scene.RegionInfo.RegionID.ToString();
321 string sceneName = scene.RegionInfo.RegionName; 321 string sceneName = scene.RegionInfo.RegionName;
322 322
323 // Make sure that all local channels are deleted. 323 // Make sure that all local channels are deleted.
324 // So we have to search for the children, and then do an 324 // So we have to search for the children, and then do an
325 // iteration over the set of chidren identified. 325 // iteration over the set of chidren identified.
@@ -343,7 +343,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
343 { 343 {
344 if (!IsOK(VivoxDeleteChannel(channelId, id))) 344 if (!IsOK(VivoxDeleteChannel(channelId, id)))
345 m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id); 345 m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id);
346 } 346 }
347 } 347 }
348 } 348 }
349 } 349 }
@@ -353,7 +353,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
353 353
354 // Remove the channel umbrella entry 354 // Remove the channel umbrella entry
355 355
356 lock (m_parents) 356 lock (m_parents)
357 { 357 {
358 if (m_parents.ContainsKey(sceneUUID)) 358 if (m_parents.ContainsKey(sceneUUID))
359 { 359 {
@@ -375,7 +375,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
375 VivoxLogout(); 375 VivoxLogout();
376 } 376 }
377 377
378 public Type ReplaceableInterface 378 public Type ReplaceableInterface
379 { 379 {
380 get { return null; } 380 get { return null; }
381 } 381 }
@@ -396,11 +396,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
396 // (login, region crossing). We contribute two capabilities to 396 // (login, region crossing). We contribute two capabilities to
397 // the set of capabilities handed back to the client: 397 // the set of capabilities handed back to the client:
398 // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. 398 // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest.
399 // 399 //
400 // ProvisionVoiceAccountRequest allows the client to obtain 400 // ProvisionVoiceAccountRequest allows the client to obtain
401 // the voice account credentials for the avatar it is 401 // the voice account credentials for the avatar it is
402 // controlling (e.g., user name, password, etc). 402 // controlling (e.g., user name, password, etc).
403 // 403 //
404 // ParcelVoiceInfoRequest is invoked whenever the client 404 // ParcelVoiceInfoRequest is invoked whenever the client
405 // changes from one region or parcel to another. 405 // changes from one region or parcel to another.
406 // 406 //
@@ -493,9 +493,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
493 493
494 if (XmlFind(resp, "response.level0.status", out code)) 494 if (XmlFind(resp, "response.level0.status", out code))
495 { 495 {
496 if (code != "OK") 496 if (code != "OK")
497 { 497 {
498 if (XmlFind(resp, "response.level0.body.code", out code)) 498 if (XmlFind(resp, "response.level0.body.code", out code))
499 { 499 {
500 // If the request was recognized, then this should be set to something 500 // If the request was recognized, then this should be set to something
501 switch (code) 501 switch (code)
@@ -530,27 +530,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
530 switch (code) 530 switch (code)
531 { 531 {
532 case "201" : // Account expired 532 case "201" : // Account expired
533 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : expired credentials", 533 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : expired credentials",
534 avatarName); 534 avatarName);
535 m_adminConnected = false; 535 m_adminConnected = false;
536 retry = DoAdminLogin(); 536 retry = DoAdminLogin();
537 break; 537 break;
538 538
539 case "202" : // Missing credentials 539 case "202" : // Missing credentials
540 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : missing credentials", 540 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : missing credentials",
541 avatarName); 541 avatarName);
542 break; 542 break;
543 543
544 case "212" : // Not authorized 544 case "212" : // Not authorized
545 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : not authorized", 545 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : not authorized",
546 avatarName); 546 avatarName);
547 break; 547 break;
548 548
549 case "300" : // Required parameter missing 549 case "300" : // Required parameter missing
550 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : parameter missing", 550 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : parameter missing",
551 avatarName); 551 avatarName);
552 break; 552 break;
553 553
554 case "400" : // Create failed 554 case "400" : // Create failed
555 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : create failed", 555 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : create failed",
556 avatarName); 556 avatarName);
@@ -558,7 +558,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
558 } 558 }
559 } 559 }
560 break; 560 break;
561 561
562 case "404" : // Failed to retrieve account 562 case "404" : // Failed to retrieve account
563 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Get account information failed : retrieve failed"); 563 m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Get account information failed : retrieve failed");
564 // [AMW] Sleep and retry for a fixed period? Or just abandon? 564 // [AMW] Sleep and retry for a fixed period? Or just abandon?
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
575 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: Get Account Request failed for \"{0}\"", avatarName); 575 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: Get Account Request failed for \"{0}\"", avatarName);
576 throw new Exception("Unable to execute request"); 576 throw new Exception("Unable to execute request");
577 } 577 }
578 578
579 // Unconditionally change the password on each request 579 // Unconditionally change the password on each request
580 VivoxPassword(agentname, password); 580 VivoxPassword(agentname, password);
581 581
@@ -613,7 +613,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
613 string avatarName = avatar.Name; 613 string avatarName = avatar.Name;
614 614
615 // - check whether we have a region channel in our cache 615 // - check whether we have a region channel in our cache
616 // - if not: 616 // - if not:
617 // create it and cache it 617 // create it and cache it
618 // - send it to the client 618 // - send it to the client
619 // - send channel_uri: as "sip:regionID@m_sipDomain" 619 // - send channel_uri: as "sip:regionID@m_sipDomain"
@@ -622,7 +622,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
622 LLSDParcelVoiceInfoResponse parcelVoiceInfo; 622 LLSDParcelVoiceInfoResponse parcelVoiceInfo;
623 string channel_uri; 623 string channel_uri;
624 624
625 if (null == scene.LandChannel) 625 if (null == scene.LandChannel)
626 throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available", 626 throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available",
627 scene.RegionInfo.RegionName, avatarName)); 627 scene.RegionInfo.RegionName, avatarName));
628 628
@@ -667,15 +667,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
667 parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); 667 parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds);
668 string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); 668 string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo);
669 669
670// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", 670// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}",
671// scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); 671// scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r);
672 return r; 672 return r;
673 } 673 }
674 catch (Exception e) 674 catch (Exception e)
675 { 675 {
676 m_log.ErrorFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later", 676 m_log.ErrorFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later",
677 scene.RegionInfo.RegionName, avatarName, e.Message); 677 scene.RegionInfo.RegionName, avatarName, e.Message);
678 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed", 678 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed",
679 scene.RegionInfo.RegionName, avatarName, e.ToString()); 679 scene.RegionInfo.RegionName, avatarName, e.ToString());
680 680
681 return "<llsd><undef /></llsd>"; 681 return "<llsd><undef /></llsd>";
@@ -721,17 +721,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
721 { 721 {
722 landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name); 722 landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name);
723 landUUID = land.GlobalID.ToString(); 723 landUUID = land.GlobalID.ToString();
724 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", 724 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
725 landName, land.LocalID, landUUID); 725 landName, land.LocalID, landUUID);
726 } 726 }
727 else 727 else
728 { 728 {
729 landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName); 729 landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName);
730 landUUID = scene.RegionInfo.RegionID.ToString(); 730 landUUID = scene.RegionInfo.RegionID.ToString();
731 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", 731 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
732 landName, land.LocalID, landUUID); 732 landName, land.LocalID, landUUID);
733 } 733 }
734 734
735 lock (vlock) 735 lock (vlock)
736 { 736 {
737 // Added by Adam to help debug channel not availible errors. 737 // Added by Adam to help debug channel not availible errors.
@@ -742,7 +742,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
742 else 742 else
743 throw new Exception("vivox channel uri not available"); 743 throw new Exception("vivox channel uri not available");
744 744
745 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ", 745 m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ",
746 landName, parentId, channelUri); 746 landName, parentId, channelUri);
747 } 747 }
748 748
@@ -817,14 +817,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
817 817
818 /// <summary> 818 /// <summary>
819 /// Create a channel. 819 /// Create a channel.
820 /// Once again, there a multitude of options possible. In the simplest case 820 /// Once again, there a multitude of options possible. In the simplest case
821 /// we specify only the name and get a non-persistent cannel in return. Non 821 /// we specify only the name and get a non-persistent cannel in return. Non
822 /// persistent means that the channel gets deleted if no-one uses it for 822 /// persistent means that the channel gets deleted if no-one uses it for
823 /// 5 hours. To accomodate future requirements, it may be a good idea to 823 /// 5 hours. To accomodate future requirements, it may be a good idea to
824 /// initially create channels under the umbrella of a parent ID based upon 824 /// initially create channels under the umbrella of a parent ID based upon
825 /// the region name. That way we have a context for side channels, if those 825 /// the region name. That way we have a context for side channels, if those
826 /// are required in a later phase. 826 /// are required in a later phase.
827 /// 827 ///
828 /// In this case the call handles parent and description as optional values. 828 /// In this case the call handles parent and description as optional values.
829 /// </summary> 829 /// </summary>
830 private bool VivoxTryCreateChannel(string parent, string channelId, string description, out string channelUri) 830 private bool VivoxTryCreateChannel(string parent, string channelId, string description, out string channelUri)
@@ -846,7 +846,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
846 requrl = String.Format("{0}&chan_dist_model={1}", requrl, m_vivoxChannelDistanceModel); 846 requrl = String.Format("{0}&chan_dist_model={1}", requrl, m_vivoxChannelDistanceModel);
847 requrl = String.Format("{0}&chan_max_range={1}", requrl, m_vivoxChannelMaximumRange); 847 requrl = String.Format("{0}&chan_max_range={1}", requrl, m_vivoxChannelMaximumRange);
848 requrl = String.Format("{0}&chan_clamping_distance={1}", requrl, m_vivoxChannelClampingDistance); 848 requrl = String.Format("{0}&chan_clamping_distance={1}", requrl, m_vivoxChannelClampingDistance);
849 849
850 XmlElement resp = VivoxCall(requrl, true); 850 XmlElement resp = VivoxCall(requrl, true);
851 if (XmlFind(resp, "response.level0.body.chan_uri", out channelUri)) 851 if (XmlFind(resp, "response.level0.body.chan_uri", out channelUri))
852 return true; 852 return true;
@@ -889,7 +889,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
889 889
890 /// <summary> 890 /// <summary>
891 /// Retrieve a channel. 891 /// Retrieve a channel.
892 /// Once again, there a multitude of options possible. In the simplest case 892 /// Once again, there a multitude of options possible. In the simplest case
893 /// we specify only the name and get a non-persistent cannel in return. Non 893 /// we specify only the name and get a non-persistent cannel in return. Non
894 /// persistent means that the channel gets deleted if no-one uses it for 894 /// persistent means that the channel gets deleted if no-one uses it for
895 /// 5 hours. To accomodate future requirements, it may be a good idea to 895 /// 5 hours. To accomodate future requirements, it may be a good idea to
@@ -898,7 +898,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
898 /// are required in a later phase. 898 /// are required in a later phase.
899 /// In this case the call handles parent and description as optional values. 899 /// In this case the call handles parent and description as optional values.
900 /// </summary> 900 /// </summary>
901 private bool VivoxTryGetChannel(string channelParent, string channelName, 901 private bool VivoxTryGetChannel(string channelParent, string channelName,
902 out string channelId, out string channelUri) 902 out string channelId, out string channelUri)
903 { 903 {
904 string count; 904 string count;
@@ -1006,7 +1006,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1006 string type; 1006 string type;
1007 1007
1008 // skip if not a directory 1008 // skip if not a directory
1009 if (!XmlFind(resp, "response.level0.channel-search.channels.channels.level4.type", i, out type) || 1009 if (!XmlFind(resp, "response.level0.channel-search.channels.channels.level4.type", i, out type) ||
1010 type != "dir") 1010 type != "dir")
1011 continue; 1011 continue;
1012 1012
@@ -1044,7 +1044,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1044 1044
1045 /// <summary> 1045 /// <summary>
1046 /// Delete a channel. 1046 /// Delete a channel.
1047 /// Once again, there a multitude of options possible. In the simplest case 1047 /// Once again, there a multitude of options possible. In the simplest case
1048 /// we specify only the name and get a non-persistent cannel in return. Non 1048 /// we specify only the name and get a non-persistent cannel in return. Non
1049 /// persistent means that the channel gets deleted if no-one uses it for 1049 /// persistent means that the channel gets deleted if no-one uses it for
1050 /// 5 hours. To accomodate future requirements, it may be a good idea to 1050 /// 5 hours. To accomodate future requirements, it may be a good idea to
@@ -1098,7 +1098,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1098 // return VivoxGetChannelById(null, id); 1098 // return VivoxGetChannelById(null, id);
1099 // } 1099 // }
1100 // } 1100 // }
1101 // } 1101 // }
1102 // } 1102 // }
1103 // } 1103 // }
1104 1104
@@ -1106,12 +1106,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1106 // return VivoxGetChannel(null, Guid.NewGuid().ToString()); 1106 // return VivoxGetChannel(null, Guid.NewGuid().ToString());
1107 1107
1108 // } 1108 // }
1109 1109
1110 /// <summary> 1110 /// <summary>
1111 /// This method handles the WEB side of making a request over the 1111 /// This method handles the WEB side of making a request over the
1112 /// Vivox interface. The returned values are tansferred to a has 1112 /// Vivox interface. The returned values are tansferred to a has
1113 /// table which is returned as the result. 1113 /// table which is returned as the result.
1114 /// The outcome of the call can be determined by examining the 1114 /// The outcome of the call can be determined by examining the
1115 /// status value in the hash table. 1115 /// status value in the hash table.
1116 /// </summary> 1116 /// </summary>
1117 private XmlElement VivoxCall(string requrl, bool admin) 1117 private XmlElement VivoxCall(string requrl, bool admin)
@@ -1127,7 +1127,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1127 doc = new XmlDocument(); 1127 doc = new XmlDocument();
1128 1128
1129 // Let's serialize all calls to Vivox. Most of these are driven by 1129 // Let's serialize all calls to Vivox. Most of these are driven by
1130 // the clients (CAPs), when the user arrives at the region. We don't 1130 // the clients (CAPs), when the user arrives at the region. We don't
1131 // want to issue many simultaneous http requests to Vivox, because mono 1131 // want to issue many simultaneous http requests to Vivox, because mono
1132 // doesn't like that 1132 // doesn't like that
1133 lock (m_Lock) 1133 lock (m_Lock)
@@ -1173,7 +1173,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1173 1173
1174 /// <summary> 1174 /// <summary>
1175 /// Login has been factored in this way because it gets called 1175 /// Login has been factored in this way because it gets called
1176 /// from several places in the module, and we want it to work 1176 /// from several places in the module, and we want it to work
1177 /// the same way each time. 1177 /// the same way each time.
1178 /// </summary> 1178 /// </summary>
1179 private bool DoAdminLogin() 1179 private bool DoAdminLogin()
@@ -1188,15 +1188,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1188 XmlElement resp = null; 1188 XmlElement resp = null;
1189 1189
1190 resp = VivoxLogin(m_vivoxAdminUser, m_vivoxAdminPassword); 1190 resp = VivoxLogin(m_vivoxAdminUser, m_vivoxAdminPassword);
1191 1191
1192 if (XmlFind(resp, "response.level0.body.status", out status)) 1192 if (XmlFind(resp, "response.level0.body.status", out status))
1193 { 1193 {
1194 if (status == "Ok") 1194 if (status == "Ok")
1195 { 1195 {
1196 m_log.Info("[VivoxVoice] Admin connection established"); 1196 m_log.Info("[VivoxVoice] Admin connection established");
1197 if (XmlFind(resp, "response.level0.body.auth_token", out m_authToken)) 1197 if (XmlFind(resp, "response.level0.body.auth_token", out m_authToken))
1198 { 1198 {
1199 if (m_dumpXml) m_log.DebugFormat("[VivoxVoice] Auth Token <{0}>", 1199 if (m_dumpXml) m_log.DebugFormat("[VivoxVoice] Auth Token <{0}>",
1200 m_authToken); 1200 m_authToken);
1201 m_adminConnected = true; 1201 m_adminConnected = true;
1202 } 1202 }
@@ -1215,9 +1215,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1215 1215
1216 /// <summary> 1216 /// <summary>
1217 /// The XmlScan routine is provided to aid in the 1217 /// The XmlScan routine is provided to aid in the
1218 /// reverse engineering of incompletely 1218 /// reverse engineering of incompletely
1219 /// documented packets returned by the Vivox 1219 /// documented packets returned by the Vivox
1220 /// voice server. It is only called if the 1220 /// voice server. It is only called if the
1221 /// m_dumpXml switch is set. 1221 /// m_dumpXml switch is set.
1222 /// </summary> 1222 /// </summary>
1223 private void XmlScanl(XmlElement e, int index) 1223 private void XmlScanl(XmlElement e, int index)
@@ -1262,7 +1262,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1262 private bool XmlFind(XmlElement root, string tag, int nth, out string result) 1262 private bool XmlFind(XmlElement root, string tag, int nth, out string result)
1263 { 1263 {
1264 if (root == null || tag == null || tag == String.Empty) 1264 if (root == null || tag == null || tag == String.Empty)
1265 { 1265 {
1266 result = String.Empty; 1266 result = String.Empty;
1267 return false; 1267 return false;
1268 } 1268 }
@@ -1273,7 +1273,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1273 { 1273 {
1274 int nth = 0; 1274 int nth = 0;
1275 if (root == null || tag == null || tag == String.Empty) 1275 if (root == null || tag == null || tag == String.Empty)
1276 { 1276 {
1277 result = String.Empty; 1277 result = String.Empty;
1278 return false; 1278 return false;
1279 } 1279 }
@@ -1284,7 +1284,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1284 /// XmlSearch is initially called by XmlFind, and then 1284 /// XmlSearch is initially called by XmlFind, and then
1285 /// recursively called by itself until the document 1285 /// recursively called by itself until the document
1286 /// supplied to XmlFind is either exhausted or the name hierarchy 1286 /// supplied to XmlFind is either exhausted or the name hierarchy
1287 /// is matched. 1287 /// is matched.
1288 /// 1288 ///
1289 /// If the hierarchy is matched, the value is returned in 1289 /// If the hierarchy is matched, the value is returned in
1290 /// result, and true returned as the function's 1290 /// result, and true returned as the function's
@@ -1298,7 +1298,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1298 result = String.Empty; 1298 result = String.Empty;
1299 return false; 1299 return false;
1300 } 1300 }
1301 1301
1302 if (tags.Length-index == 1) 1302 if (tags.Length-index == 1)
1303 { 1303 {
1304 if (nth == 0) 1304 if (nth == 0)