diff options
author | Adam Frisby | 2008-04-30 21:43:47 +0000 |
---|---|---|
committer | Adam Frisby | 2008-04-30 21:43:47 +0000 |
commit | be20f41637b6c06ce3ab16bc25851b6e43468e12 (patch) | |
tree | c41081329891f4c24de704fc760fb9012954ac9d /OpenSim/Region/Environment/Modules/Avatar/Voice | |
parent | * Sometimes you know, you do something really stupid. (diff) | |
download | opensim-SC-be20f41637b6c06ce3ab16bc25851b6e43468e12.zip opensim-SC-be20f41637b6c06ce3ab16bc25851b6e43468e12.tar.gz opensim-SC-be20f41637b6c06ce3ab16bc25851b6e43468e12.tar.bz2 opensim-SC-be20f41637b6c06ce3ab16bc25851b6e43468e12.tar.xz |
* Cruft removal step #1. Cleaning Modules directory.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Voice')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs | 81 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs | 47 |
2 files changed, 68 insertions, 60 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs index 0d7de78..44d67e6 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs | |||
@@ -44,40 +44,43 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
44 | { | 44 | { |
45 | public class AsteriskVoiceModule : IRegionModule | 45 | public class AsteriskVoiceModule : IRegionModule |
46 | { | 46 | { |
47 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
48 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private Scene m_scene; | 50 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; |
51 | private IConfig m_config; | 51 | private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; |
52 | |||
52 | private string m_asterisk; | 53 | private string m_asterisk; |
53 | private string m_asterisk_password; | 54 | private string m_asterisk_password; |
54 | private string m_asterisk_salt; | 55 | private string m_asterisk_salt; |
55 | private int m_asterisk_timeout; | 56 | private int m_asterisk_timeout; |
56 | private string m_sipDomain; | ||
57 | private string m_confDomain; | 57 | private string m_confDomain; |
58 | private IConfig m_config; | ||
59 | private Scene m_scene; | ||
60 | private string m_sipDomain; | ||
58 | 61 | ||
59 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; | 62 | #region IRegionModule Members |
60 | private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; | ||
61 | 63 | ||
62 | public void Initialise(Scene scene, IConfigSource config) | 64 | public void Initialise(Scene scene, IConfigSource config) |
63 | { | 65 | { |
64 | m_scene = scene; | 66 | m_scene = scene; |
65 | m_config = config.Configs["AsteriskVoice"]; | 67 | m_config = config.Configs["AsteriskVoice"]; |
66 | 68 | ||
67 | if (null == m_config) | 69 | if (null == m_config) |
68 | { | 70 | { |
69 | m_log.Info("[ASTERISKVOICE] no config found, plugin disabled"); | 71 | m_log.Info("[ASTERISKVOICE] no config found, plugin disabled"); |
70 | return; | 72 | return; |
71 | } | 73 | } |
72 | 74 | ||
73 | if (!m_config.GetBoolean("enabled", false)) | 75 | if (!m_config.GetBoolean("enabled", false)) |
74 | { | 76 | { |
75 | m_log.Info("[ASTERISKVOICE] plugin disabled by configuration"); | 77 | m_log.Info("[ASTERISKVOICE] plugin disabled by configuration"); |
76 | return; | 78 | return; |
77 | } | 79 | } |
78 | m_log.Info("[ASTERISKVOICE] plugin enabled"); | 80 | m_log.Info("[ASTERISKVOICE] plugin enabled"); |
79 | 81 | ||
80 | try { | 82 | try |
83 | { | ||
81 | m_sipDomain = m_config.GetString("sip_domain", String.Empty); | 84 | m_sipDomain = m_config.GetString("sip_domain", String.Empty); |
82 | m_log.InfoFormat("[ASTERISKVOICE] using SIP domain {0}", m_sipDomain); | 85 | m_log.InfoFormat("[ASTERISKVOICE] using SIP domain {0}", m_sipDomain); |
83 | 86 | ||
@@ -91,17 +94,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
91 | if (String.IsNullOrEmpty(m_asterisk)) throw new Exception("missing asterisk_frontend config parameter"); | 94 | if (String.IsNullOrEmpty(m_asterisk)) throw new Exception("missing asterisk_frontend config parameter"); |
92 | if (String.IsNullOrEmpty(m_asterisk_password)) throw new Exception("missing asterisk_password config parameter"); | 95 | if (String.IsNullOrEmpty(m_asterisk_password)) throw new Exception("missing asterisk_password config parameter"); |
93 | m_log.InfoFormat("[ASTERISKVOICE] using asterisk front end {0}", m_asterisk); | 96 | m_log.InfoFormat("[ASTERISKVOICE] using asterisk front end {0}", m_asterisk); |
94 | 97 | ||
95 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 98 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
96 | } | 99 | } |
97 | catch (Exception e) | 100 | catch (Exception e) |
98 | { | 101 | { |
99 | m_log.ErrorFormat("[ASTERISKVOICE] plugin initialization failed: {0}", e.Message); | 102 | m_log.ErrorFormat("[ASTERISKVOICE] plugin initialization failed: {0}", e.Message); |
100 | m_log.DebugFormat("[ASTERISKVOICE] plugin initialization failed: {0}", e.ToString()); | 103 | m_log.DebugFormat("[ASTERISKVOICE] plugin initialization failed: {0}", e.ToString()); |
101 | return; | 104 | return; |
102 | } | 105 | } |
103 | } | 106 | } |
104 | 107 | ||
105 | public void PostInitialise() | 108 | public void PostInitialise() |
106 | { | 109 | { |
107 | } | 110 | } |
@@ -120,15 +123,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
120 | get { return false; } | 123 | get { return false; } |
121 | } | 124 | } |
122 | 125 | ||
123 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 126 | #endregion |
127 | |||
128 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | ||
124 | { | 129 | { |
125 | m_log.DebugFormat("[ASTERISKVOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); | 130 | m_log.DebugFormat("[ASTERISKVOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); |
126 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 131 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
127 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 132 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
128 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 133 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
129 | delegate(string request, string path, string param) | 134 | delegate(string request, string path, string param) |
130 | { | 135 | { |
131 | return ParcelVoiceInfoRequest(request, path, param, | 136 | return ParcelVoiceInfoRequest(request, path, param, |
132 | agentID, caps); | 137 | agentID, caps); |
133 | })); | 138 | })); |
134 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 139 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
@@ -139,7 +144,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
139 | agentID, caps); | 144 | agentID, caps); |
140 | })); | 145 | })); |
141 | } | 146 | } |
142 | 147 | ||
143 | /// <summary> | 148 | /// <summary> |
144 | /// Callback for a client request for ParcelVoiceInfo | 149 | /// Callback for a client request for ParcelVoiceInfo |
145 | /// </summary> | 150 | /// </summary> |
@@ -149,30 +154,30 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
149 | /// <param name="agentID"></param> | 154 | /// <param name="agentID"></param> |
150 | /// <param name="caps"></param> | 155 | /// <param name="caps"></param> |
151 | /// <returns></returns> | 156 | /// <returns></returns> |
152 | public string ParcelVoiceInfoRequest(string request, string path, string param, | 157 | public string ParcelVoiceInfoRequest(string request, string path, string param, |
153 | LLUUID agentID, Caps caps) | 158 | LLUUID agentID, Caps caps) |
154 | { | 159 | { |
155 | // we need to do: | 160 | // we need to do: |
156 | // - send channel_uri: as "sip:regionID@m_sipDomain" | 161 | // - send channel_uri: as "sip:regionID@m_sipDomain" |
157 | try | 162 | try |
158 | { | 163 | { |
159 | m_log.DebugFormat("[ASTERISKVOICE][PARCELVOICE]: request: {0}, path: {1}, param: {2}", | 164 | m_log.DebugFormat("[ASTERISKVOICE][PARCELVOICE]: request: {0}, path: {1}, param: {2}", |
160 | request, path, param); | 165 | request, path, param); |
161 | 166 | ||
162 | 167 | ||
163 | // setup response to client | 168 | // setup response to client |
164 | Hashtable creds = new Hashtable(); | 169 | Hashtable creds = new Hashtable(); |
165 | creds["channel_uri"] = String.Format("sip:{0}@{1}", | 170 | creds["channel_uri"] = String.Format("sip:{0}@{1}", |
166 | m_scene.RegionInfo.RegionID, m_sipDomain); | 171 | m_scene.RegionInfo.RegionID, m_sipDomain); |
167 | 172 | ||
168 | string regionName = m_scene.RegionInfo.RegionName; | 173 | string regionName = m_scene.RegionInfo.RegionName; |
169 | ScenePresence avatar = m_scene.GetScenePresence(agentID); | 174 | ScenePresence avatar = m_scene.GetScenePresence(agentID); |
170 | if (null == m_scene.LandChannel) throw new Exception("land data not yet available"); | 175 | if (null == m_scene.LandChannel) throw new Exception("land data not yet available"); |
171 | LandData land = m_scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 176 | LandData land = m_scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
172 | 177 | ||
173 | LLSDParcelVoiceInfoResponse parcelVoiceInfo = | 178 | LLSDParcelVoiceInfoResponse parcelVoiceInfo = |
174 | new LLSDParcelVoiceInfoResponse(regionName, land.localID, creds); | 179 | new LLSDParcelVoiceInfoResponse(regionName, land.localID, creds); |
175 | 180 | ||
176 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); | 181 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); |
177 | 182 | ||
178 | 183 | ||
@@ -183,17 +188,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
183 | if (!String.IsNullOrEmpty(m_confDomain)) | 188 | if (!String.IsNullOrEmpty(m_confDomain)) |
184 | { | 189 | { |
185 | requestData["region"] += String.Format("@{0}", m_confDomain); | 190 | requestData["region"] += String.Format("@{0}", m_confDomain); |
186 | } | 191 | } |
187 | 192 | ||
188 | ArrayList SendParams = new ArrayList(); | 193 | ArrayList SendParams = new ArrayList(); |
189 | SendParams.Add(requestData); | 194 | SendParams.Add(requestData); |
190 | XmlRpcRequest updateAccountRequest = new XmlRpcRequest("region_update", SendParams); | 195 | XmlRpcRequest updateAccountRequest = new XmlRpcRequest("region_update", SendParams); |
191 | XmlRpcResponse updateAccountResponse = updateAccountRequest.Send(m_asterisk, m_asterisk_timeout); | 196 | XmlRpcResponse updateAccountResponse = updateAccountRequest.Send(m_asterisk, m_asterisk_timeout); |
192 | Hashtable responseData = (Hashtable)updateAccountResponse.Value; | 197 | Hashtable responseData = (Hashtable) updateAccountResponse.Value; |
193 | 198 | ||
194 | if (!responseData.ContainsKey("success")) throw new Exception("region_update call failed"); | 199 | if (!responseData.ContainsKey("success")) throw new Exception("region_update call failed"); |
195 | 200 | ||
196 | bool success = Convert.ToBoolean((string)responseData["success"]); | 201 | bool success = Convert.ToBoolean((string) responseData["success"]); |
197 | if (!success) throw new Exception("region_update failed"); | 202 | if (!success) throw new Exception("region_update failed"); |
198 | 203 | ||
199 | 204 | ||
@@ -218,8 +223,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
218 | /// <param name="agentID"></param> | 223 | /// <param name="agentID"></param> |
219 | /// <param name="caps"></param> | 224 | /// <param name="caps"></param> |
220 | /// <returns></returns> | 225 | /// <returns></returns> |
221 | public string ProvisionVoiceAccountRequest(string request, string path, string param, | 226 | public string ProvisionVoiceAccountRequest(string request, string path, string param, |
222 | LLUUID agentID, Caps caps) | 227 | LLUUID agentID, Caps caps) |
223 | { | 228 | { |
224 | // we need to | 229 | // we need to |
225 | // - get user data from UserProfileCacheService | 230 | // - get user data from UserProfileCacheService |
@@ -232,7 +237,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
232 | // send account details back to client | 237 | // send account details back to client |
233 | try | 238 | try |
234 | { | 239 | { |
235 | m_log.DebugFormat("[ASTERISKVOICE][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", | 240 | m_log.DebugFormat("[ASTERISKVOICE][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", |
236 | request, path, param); | 241 | request, path, param); |
237 | 242 | ||
238 | // get user data & prepare voice account response | 243 | // get user data & prepare voice account response |
@@ -244,7 +249,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
244 | 249 | ||
245 | // we generate a nonce everytime | 250 | // we generate a nonce everytime |
246 | string voicePassword = "$1$" + Util.Md5Hash(DateTime.UtcNow.ToLongTimeString() + m_asterisk_salt); | 251 | string voicePassword = "$1$" + Util.Md5Hash(DateTime.UtcNow.ToLongTimeString() + m_asterisk_salt); |
247 | LLSDVoiceAccountResponse voiceAccountResponse = | 252 | LLSDVoiceAccountResponse voiceAccountResponse = |
248 | new LLSDVoiceAccountResponse(voiceUser, voicePassword); | 253 | new LLSDVoiceAccountResponse(voiceUser, voicePassword); |
249 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 254 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
250 | m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r); | 255 | m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r); |
@@ -257,18 +262,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice | |||
257 | if (!String.IsNullOrEmpty(m_sipDomain)) | 262 | if (!String.IsNullOrEmpty(m_sipDomain)) |
258 | { | 263 | { |
259 | requestData["username"] += String.Format("@{0}", m_sipDomain); | 264 | requestData["username"] += String.Format("@{0}", m_sipDomain); |
260 | } | 265 | } |
261 | requestData["password"] = voicePassword; | 266 | requestData["password"] = voicePassword; |
262 | 267 | ||
263 | ArrayList SendParams = new ArrayList(); | 268 | ArrayList SendParams = new ArrayList(); |
264 | SendParams.Add(requestData); | 269 | SendParams.Add(requestData); |
265 | XmlRpcRequest updateAccountRequest = new XmlRpcRequest("account_update", SendParams); | 270 | XmlRpcRequest updateAccountRequest = new XmlRpcRequest("account_update", SendParams); |
266 | XmlRpcResponse updateAccountResponse = updateAccountRequest.Send(m_asterisk, m_asterisk_timeout); | 271 | XmlRpcResponse updateAccountResponse = updateAccountRequest.Send(m_asterisk, m_asterisk_timeout); |
267 | Hashtable responseData = (Hashtable)updateAccountResponse.Value; | 272 | Hashtable responseData = (Hashtable) updateAccountResponse.Value; |
268 | 273 | ||
269 | if (!responseData.ContainsKey("success")) throw new Exception("account_update call failed"); | 274 | if (!responseData.ContainsKey("success")) throw new Exception("account_update call failed"); |
270 | 275 | ||
271 | bool success = Convert.ToBoolean((string)responseData["success"]); | 276 | bool success = Convert.ToBoolean((string) responseData["success"]); |
272 | if (!success) throw new Exception("account_update failed"); | 277 | if (!success) throw new Exception("account_update failed"); |
273 | 278 | ||
274 | return r; | 279 | return r; |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs index 8b7c3d0..8d9ba6f 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs | |||
@@ -43,22 +43,23 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
43 | { | 43 | { |
44 | public class SIPVoiceModule : IRegionModule | 44 | public class SIPVoiceModule : IRegionModule |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private Scene m_scene; | 49 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; |
50 | private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; | ||
50 | private IConfig m_config; | 51 | private IConfig m_config; |
52 | private Scene m_scene; | ||
51 | private string m_sipDomain; | 53 | private string m_sipDomain; |
52 | 54 | ||
53 | private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; | 55 | #region IRegionModule Members |
54 | private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; | ||
55 | 56 | ||
56 | public void Initialise(Scene scene, IConfigSource config) | 57 | public void Initialise(Scene scene, IConfigSource config) |
57 | { | 58 | { |
58 | m_scene = scene; | 59 | m_scene = scene; |
59 | m_config = config.Configs["Voice"]; | 60 | m_config = config.Configs["Voice"]; |
60 | 61 | ||
61 | if (null == m_config || !m_config.GetBoolean("enabled", false)) | 62 | if (null == m_config || !m_config.GetBoolean("enabled", false)) |
62 | { | 63 | { |
63 | m_log.Info("[VOICE] plugin disabled"); | 64 | m_log.Info("[VOICE] plugin disabled"); |
64 | return; | 65 | return; |
@@ -95,15 +96,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
95 | get { return false; } | 96 | get { return false; } |
96 | } | 97 | } |
97 | 98 | ||
98 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 99 | #endregion |
100 | |||
101 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | ||
99 | { | 102 | { |
100 | m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); | 103 | m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); |
101 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 104 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
102 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 105 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
103 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 106 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
104 | delegate(string request, string path, string param) | 107 | delegate(string request, string path, string param) |
105 | { | 108 | { |
106 | return ParcelVoiceInfoRequest(request, path, param, | 109 | return ParcelVoiceInfoRequest(request, path, param, |
107 | agentID, caps); | 110 | agentID, caps); |
108 | })); | 111 | })); |
109 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 112 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
@@ -114,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
114 | agentID, caps); | 117 | agentID, caps); |
115 | })); | 118 | })); |
116 | } | 119 | } |
117 | 120 | ||
118 | /// <summary> | 121 | /// <summary> |
119 | /// Callback for a client request for ParcelVoiceInfo | 122 | /// Callback for a client request for ParcelVoiceInfo |
120 | /// </summary> | 123 | /// </summary> |
@@ -124,8 +127,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
124 | /// <param name="agentID"></param> | 127 | /// <param name="agentID"></param> |
125 | /// <param name="caps"></param> | 128 | /// <param name="caps"></param> |
126 | /// <returns></returns> | 129 | /// <returns></returns> |
127 | public string ParcelVoiceInfoRequest(string request, string path, string param, | 130 | public string ParcelVoiceInfoRequest(string request, string path, string param, |
128 | LLUUID agentID, Caps caps) | 131 | LLUUID agentID, Caps caps) |
129 | { | 132 | { |
130 | try | 133 | try |
131 | { | 134 | { |
@@ -135,15 +138,15 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
135 | Hashtable creds = new Hashtable(); | 138 | Hashtable creds = new Hashtable(); |
136 | 139 | ||
137 | creds["channel_uri"] = String.Format("sip:{0}@{1}", agentID, m_sipDomain); | 140 | creds["channel_uri"] = String.Format("sip:{0}@{1}", agentID, m_sipDomain); |
138 | 141 | ||
139 | string regionName = m_scene.RegionInfo.RegionName; | 142 | string regionName = m_scene.RegionInfo.RegionName; |
140 | ScenePresence avatar = m_scene.GetScenePresence(agentID); | 143 | ScenePresence avatar = m_scene.GetScenePresence(agentID); |
141 | if (null == m_scene.LandChannel) throw new Exception("land data not yet available"); | 144 | if (null == m_scene.LandChannel) throw new Exception("land data not yet available"); |
142 | LandData land = m_scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 145 | LandData land = m_scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
143 | 146 | ||
144 | LLSDParcelVoiceInfoResponse parcelVoiceInfo = | 147 | LLSDParcelVoiceInfoResponse parcelVoiceInfo = |
145 | new LLSDParcelVoiceInfoResponse(regionName, land.localID, creds); | 148 | new LLSDParcelVoiceInfoResponse(regionName, land.localID, creds); |
146 | 149 | ||
147 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); | 150 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); |
148 | m_log.DebugFormat("[VOICE][PARCELVOICE]: {0}", r); | 151 | m_log.DebugFormat("[VOICE][PARCELVOICE]: {0}", r); |
149 | 152 | ||
@@ -153,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
153 | { | 156 | { |
154 | m_log.ErrorFormat("[CAPS]: {0}, try again later", e.ToString()); | 157 | m_log.ErrorFormat("[CAPS]: {0}, try again later", e.ToString()); |
155 | } | 158 | } |
156 | 159 | ||
157 | return null; | 160 | return null; |
158 | } | 161 | } |
159 | 162 | ||
@@ -166,12 +169,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
166 | /// <param name="agentID"></param> | 169 | /// <param name="agentID"></param> |
167 | /// <param name="caps"></param> | 170 | /// <param name="caps"></param> |
168 | /// <returns></returns> | 171 | /// <returns></returns> |
169 | public string ProvisionVoiceAccountRequest(string request, string path, string param, | 172 | public string ProvisionVoiceAccountRequest(string request, string path, string param, |
170 | LLUUID agentID, Caps caps) | 173 | LLUUID agentID, Caps caps) |
171 | { | 174 | { |
172 | try | 175 | try |
173 | { | 176 | { |
174 | m_log.DebugFormat("[VOICE][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", | 177 | m_log.DebugFormat("[VOICE][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", |
175 | request, path, param); | 178 | request, path, param); |
176 | 179 | ||
177 | string voiceUser = "x" + Convert.ToBase64String(agentID.GetBytes()); | 180 | string voiceUser = "x" + Convert.ToBase64String(agentID.GetBytes()); |
@@ -180,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice | |||
180 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID); | 183 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID); |
181 | if (null == userInfo) throw new Exception("cannot get user details"); | 184 | if (null == userInfo) throw new Exception("cannot get user details"); |
182 | 185 | ||
183 | LLSDVoiceAccountResponse voiceAccountResponse = | 186 | LLSDVoiceAccountResponse voiceAccountResponse = |
184 | new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.PasswordHash); | 187 | new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.PasswordHash); |
185 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 188 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
186 | m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r); | 189 | m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r); |