aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs39
1 files changed, 25 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index cb69411..db4869d 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
@@ -1111,25 +1115,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1111 1115
1112 doc = new XmlDocument(); 1116 doc = new XmlDocument();
1113 1117
1114 try 1118 // Let's serialize all calls to Vivox. Most of these are driven by
1119 // the clients (CAPs), when the user arrives at the region. We don't
1120 // want to issue many simultaneous http requests to Vivox, because mono
1121 // doesn't like that
1122 lock (m_Lock)
1115 { 1123 {
1116 // Otherwise prepare the request 1124 try
1117 m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); 1125 {
1126 // Otherwise prepare the request
1127 m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl);
1118 1128
1119 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); 1129 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
1120 1130
1121 // We are sending just parameters, no content 1131 // We are sending just parameters, no content
1122 req.ContentLength = 0; 1132 req.ContentLength = 0;
1123 1133
1124 // Send request and retrieve the response 1134 // Send request and retrieve the response
1125 using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse()) 1135 using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse())
1126 using (Stream s = rsp.GetResponseStream()) 1136 using (Stream s = rsp.GetResponseStream())
1127 using (XmlTextReader rdr = new XmlTextReader(s)) 1137 using (XmlTextReader rdr = new XmlTextReader(s))
1128 doc.Load(rdr); 1138 doc.Load(rdr);
1129 } 1139 }
1130 catch (Exception e) 1140 catch (Exception e)
1131 { 1141 {
1132 m_log.ErrorFormat("[VivoxVoice] Error in admin call : {0}", e.Message); 1142 m_log.ErrorFormat("[VivoxVoice] Error in admin call : {0}", e.Message);
1143 }
1133 } 1144 }
1134 1145
1135 // If we're debugging server responses, dump the whole 1146 // If we're debugging server responses, dump the whole