diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 67 |
2 files changed, 48 insertions, 37 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 0cec959..2b33084 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -326,15 +326,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
326 | "ParcelVoiceInfoRequest", | 326 | "ParcelVoiceInfoRequest", |
327 | agentID.ToString())); | 327 | agentID.ToString())); |
328 | 328 | ||
329 | caps.RegisterHandler( | 329 | //caps.RegisterHandler( |
330 | "ChatSessionRequest", | 330 | // "ChatSessionRequest", |
331 | new RestStreamHandler( | 331 | // new RestStreamHandler( |
332 | "POST", | 332 | // "POST", |
333 | capsBase + m_chatSessionRequestPath, | 333 | // capsBase + m_chatSessionRequestPath, |
334 | (request, path, param, httpRequest, httpResponse) | 334 | // (request, path, param, httpRequest, httpResponse) |
335 | => ChatSessionRequest(scene, request, path, param, agentID, caps), | 335 | // => ChatSessionRequest(scene, request, path, param, agentID, caps), |
336 | "ChatSessionRequest", | 336 | // "ChatSessionRequest", |
337 | agentID.ToString())); | 337 | // agentID.ToString())); |
338 | } | 338 | } |
339 | 339 | ||
340 | /// <summary> | 340 | /// <summary> |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index aef64d4..6ee15ad 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -117,6 +117,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
117 | 117 | ||
118 | private IConfig m_config; | 118 | private IConfig m_config; |
119 | 119 | ||
120 | private object m_Lock; | ||
121 | |||
120 | public void Initialise(IConfigSource config) | 122 | public void Initialise(IConfigSource config) |
121 | { | 123 | { |
122 | 124 | ||
@@ -128,6 +130,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
128 | if (!m_config.GetBoolean("enabled", false)) | 130 | if (!m_config.GetBoolean("enabled", false)) |
129 | return; | 131 | return; |
130 | 132 | ||
133 | m_Lock = new object(); | ||
134 | |||
131 | try | 135 | try |
132 | { | 136 | { |
133 | // retrieve configuration variables | 137 | // retrieve configuration variables |
@@ -429,15 +433,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
429 | "ParcelVoiceInfoRequest", | 433 | "ParcelVoiceInfoRequest", |
430 | agentID.ToString())); | 434 | agentID.ToString())); |
431 | 435 | ||
432 | caps.RegisterHandler( | 436 | //caps.RegisterHandler( |
433 | "ChatSessionRequest", | 437 | // "ChatSessionRequest", |
434 | new RestStreamHandler( | 438 | // new RestStreamHandler( |
435 | "POST", | 439 | // "POST", |
436 | capsBase + m_chatSessionRequestPath, | 440 | // capsBase + m_chatSessionRequestPath, |
437 | (request, path, param, httpRequest, httpResponse) | 441 | // (request, path, param, httpRequest, httpResponse) |
438 | => ChatSessionRequest(scene, request, path, param, agentID, caps), | 442 | // => ChatSessionRequest(scene, request, path, param, agentID, caps), |
439 | "ChatSessionRequest", | 443 | // "ChatSessionRequest", |
440 | agentID.ToString())); | 444 | // agentID.ToString())); |
441 | } | 445 | } |
442 | 446 | ||
443 | /// <summary> | 447 | /// <summary> |
@@ -827,11 +831,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
827 | { | 831 | { |
828 | string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", channelId, m_authToken); | 832 | string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", channelId, m_authToken); |
829 | 833 | ||
830 | if (parent != null && parent != String.Empty) | 834 | if (!string.IsNullOrEmpty(parent)) |
831 | { | 835 | { |
832 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 836 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
833 | } | 837 | } |
834 | if (description != null && description != String.Empty) | 838 | if (!string.IsNullOrEmpty(description)) |
835 | { | 839 | { |
836 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); | 840 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); |
837 | } | 841 | } |
@@ -841,7 +845,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
841 | requrl = String.Format("{0}&chan_roll_off={1}", requrl, m_vivoxChannelRollOff); | 845 | requrl = String.Format("{0}&chan_roll_off={1}", requrl, m_vivoxChannelRollOff); |
842 | requrl = String.Format("{0}&chan_dist_model={1}", requrl, m_vivoxChannelDistanceModel); | 846 | requrl = String.Format("{0}&chan_dist_model={1}", requrl, m_vivoxChannelDistanceModel); |
843 | requrl = String.Format("{0}&chan_max_range={1}", requrl, m_vivoxChannelMaximumRange); | 847 | requrl = String.Format("{0}&chan_max_range={1}", requrl, m_vivoxChannelMaximumRange); |
844 | requrl = String.Format("{0}&chan_ckamping_distance={1}", requrl, m_vivoxChannelClampingDistance); | 848 | requrl = String.Format("{0}&chan_clamping_distance={1}", requrl, m_vivoxChannelClampingDistance); |
845 | 849 | ||
846 | XmlElement resp = VivoxCall(requrl, true); | 850 | XmlElement resp = VivoxCall(requrl, true); |
847 | if (XmlFind(resp, "response.level0.body.chan_uri", out channelUri)) | 851 | if (XmlFind(resp, "response.level0.body.chan_uri", out channelUri)) |
@@ -867,7 +871,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
867 | // requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 871 | // requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
868 | // } | 872 | // } |
869 | 873 | ||
870 | if (description != null && description != String.Empty) | 874 | if (!string.IsNullOrEmpty(description)) |
871 | { | 875 | { |
872 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); | 876 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); |
873 | } | 877 | } |
@@ -1053,7 +1057,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1053 | private XmlElement VivoxDeleteChannel(string parent, string channelid) | 1057 | private XmlElement VivoxDeleteChannel(string parent, string channelid) |
1054 | { | 1058 | { |
1055 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); | 1059 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); |
1056 | if (parent != null && parent != String.Empty) | 1060 | if (!string.IsNullOrEmpty(parent)) |
1057 | { | 1061 | { |
1058 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 1062 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
1059 | } | 1063 | } |
@@ -1122,25 +1126,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1122 | 1126 | ||
1123 | doc = new XmlDocument(); | 1127 | doc = new XmlDocument(); |
1124 | 1128 | ||
1125 | try | 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 | ||
1131 | // want to issue many simultaneous http requests to Vivox, because mono | ||
1132 | // doesn't like that | ||
1133 | lock (m_Lock) | ||
1126 | { | 1134 | { |
1127 | // Otherwise prepare the request | 1135 | try |
1128 | // m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); | 1136 | { |
1137 | // Otherwise prepare the request | ||
1138 | //m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); | ||
1129 | 1139 | ||
1130 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); | 1140 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); |
1131 | 1141 | ||
1132 | // We are sending just parameters, no content | 1142 | // We are sending just parameters, no content |
1133 | req.ContentLength = 0; | 1143 | req.ContentLength = 0; |
1134 | 1144 | ||
1135 | // Send request and retrieve the response | 1145 | // Send request and retrieve the response |
1136 | using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse()) | 1146 | using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse()) |
1137 | using (Stream s = rsp.GetResponseStream()) | 1147 | using (Stream s = rsp.GetResponseStream()) |
1138 | using (XmlTextReader rdr = new XmlTextReader(s)) | 1148 | using (XmlTextReader rdr = new XmlTextReader(s)) |
1139 | doc.Load(rdr); | 1149 | doc.Load(rdr); |
1140 | } | 1150 | } |
1141 | catch (Exception e) | 1151 | catch (Exception e) |
1142 | { | 1152 | { |
1143 | m_log.ErrorFormat("[VivoxVoice] Error in admin call : {0}", e.Message); | 1153 | m_log.ErrorFormat("[VivoxVoice] Error in admin call : {0}", e.Message); |
1154 | } | ||
1144 | } | 1155 | } |
1145 | 1156 | ||
1146 | // If we're debugging server responses, dump the whole | 1157 | // If we're debugging server responses, dump the whole |