From 231a3bf147315a9284140476d2b09e13c3fee1c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 May 2012 01:45:49 +0100 Subject: Implement optional name and description on http stream handlers so that we can relate a slow request to what the handler actually does and the agent it serves, if applicable. This is most useful for capabilities where the url is not self-describing. --- .../Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 53 +++++++++++---------- .../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 54 ++++++++++++---------- 2 files changed, 59 insertions(+), 48 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar') diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 05678c0..be8873d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -306,30 +306,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice agentID, caps, scene.RegionInfo.RegionName); string capsBase = "/CAPS/" + caps.CapsObjectPath; - caps.RegisterHandler("ProvisionVoiceAccountRequest", - new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ProvisionVoiceAccountRequest(scene, request, path, param, - agentID, caps); - })); - caps.RegisterHandler("ParcelVoiceInfoRequest", - new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ParcelVoiceInfoRequest(scene, request, path, param, - agentID, caps); - })); - caps.RegisterHandler("ChatSessionRequest", - new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ChatSessionRequest(scene, request, path, param, - agentID, caps); - })); + caps.RegisterHandler( + "ProvisionVoiceAccountRequest", + new RestStreamHandler( + "POST", + capsBase + m_provisionVoiceAccountRequestPath, + (request, path, param, httpRequest, httpResponse) + => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps), + "ProvisionVoiceAccountRequest", + agentID.ToString())); + + caps.RegisterHandler( + "ParcelVoiceInfoRequest", + new RestStreamHandler( + "POST", + capsBase + m_parcelVoiceInfoRequestPath, + (request, path, param, httpRequest, httpResponse) + => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps), + "ParcelVoiceInfoRequest", + agentID.ToString())); + + caps.RegisterHandler( + "ChatSessionRequest", + new RestStreamHandler( + "POST", + capsBase + m_chatSessionRequestPath, + (request, path, param, httpRequest, httpResponse) + => ChatSessionRequest(scene, request, path, param, agentID, caps), + "ChatSessionRequest", + agentID.ToString())); } /// diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 738133c..a36fd74 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -406,30 +406,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice m_log.DebugFormat("[VivoxVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); string capsBase = "/CAPS/" + caps.CapsObjectPath; - caps.RegisterHandler("ProvisionVoiceAccountRequest", - new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ProvisionVoiceAccountRequest(scene, request, path, param, - agentID, caps); - })); - caps.RegisterHandler("ParcelVoiceInfoRequest", - new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ParcelVoiceInfoRequest(scene, request, path, param, - agentID, caps); - })); - caps.RegisterHandler("ChatSessionRequest", - new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, - delegate(string request, string path, string param, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) - { - return ChatSessionRequest(scene, request, path, param, - agentID, caps); - })); + + caps.RegisterHandler( + "ProvisionVoiceAccountRequest", + new RestStreamHandler( + "POST", + capsBase + m_provisionVoiceAccountRequestPath, + (request, path, param, httpRequest, httpResponse) + => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps), + "ProvisionVoiceAccountRequest", + agentID.ToString())); + + caps.RegisterHandler( + "ParcelVoiceInfoRequest", + new RestStreamHandler( + "POST", + capsBase + m_parcelVoiceInfoRequestPath, + (request, path, param, httpRequest, httpResponse) + => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps), + "ParcelVoiceInfoRequest", + agentID.ToString())); + + caps.RegisterHandler( + "ChatSessionRequest", + new RestStreamHandler( + "POST", + capsBase + m_chatSessionRequestPath, + (request, path, param, httpRequest, httpResponse) + => ChatSessionRequest(scene, request, path, param, agentID, caps), + "ChatSessionRequest", + agentID.ToString())); } /// -- cgit v1.1