aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
diff options
context:
space:
mode:
authorDr Scofield2009-04-22 09:42:44 +0000
committerDr Scofield2009-04-22 09:42:44 +0000
commit458f7eb9b38609d02980afe5a6ee88d19c7dd7f8 (patch)
treeb8d2b6c140ca373ca5604f7087541f74185ac77c /OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
parent* update example to reflect optional Well known hostname. (diff)
downloadopensim-SC_OLD-458f7eb9b38609d02980afe5a6ee88d19c7dd7f8.zip
opensim-SC_OLD-458f7eb9b38609d02980afe5a6ee88d19c7dd7f8.tar.gz
opensim-SC_OLD-458f7eb9b38609d02980afe5a6ee88d19c7dd7f8.tar.bz2
opensim-SC_OLD-458f7eb9b38609d02980afe5a6ee88d19c7dd7f8.tar.xz
cleaning up, fixing warnings
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs63
1 files changed, 27 insertions, 36 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
index 24f114d..fd384e4 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
65 65
66 foreach (DictionaryEntry item in request) 66 foreach (DictionaryEntry item in request)
67 { 67 {
68 m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); 68 m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}", item.Key, item.Value);
69 } 69 }
70 70
71 string eventCallingFunction = (string) request["Event-Calling-Function"]; 71 string eventCallingFunction = (string) request["Event-Calling-Function"];
@@ -79,44 +79,44 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
79 eventCallingFunction = "sofia_reg_parse_auth"; 79 eventCallingFunction = "sofia_reg_parse_auth";
80 } 80 }
81 81
82 if (eventCallingFunction=="sofia_reg_parse_auth") 82 if (eventCallingFunction == "sofia_reg_parse_auth")
83 { 83 {
84 string sipAuthMethod = (string)request["sip_auth_method"]; 84 string sipAuthMethod = (string)request["sip_auth_method"];
85 85
86 if (sipAuthMethod=="REGISTER") 86 if (sipAuthMethod == "REGISTER")
87 { 87 {
88 response = HandleRegister(request); 88 response = HandleRegister(request);
89 } 89 }
90 else if (sipAuthMethod=="INVITE") 90 else if (sipAuthMethod == "INVITE")
91 { 91 {
92 response = HandleInvite(request); 92 response = HandleInvite(request);
93 } 93 }
94 else 94 else
95 { 95 {
96 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod); 96 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod);
97 response["int_response_code"]=404; 97 response["int_response_code"] = 404;
98 } 98 }
99 } 99 }
100 else if (eventCallingFunction=="switch_xml_locate_user") 100 else if (eventCallingFunction == "switch_xml_locate_user")
101 { 101 {
102 response = HandleLocateUser(request); 102 response = HandleLocateUser(request);
103 } 103 }
104 else if (eventCallingFunction=="user_data_function") // gets called when an avatar to avatar call is made 104 else if (eventCallingFunction == "user_data_function") // gets called when an avatar to avatar call is made
105 { 105 {
106 response = HandleLocateUser(request); 106 response = HandleLocateUser(request);
107 } 107 }
108 else if (eventCallingFunction=="user_outgoing_channel") 108 else if (eventCallingFunction == "user_outgoing_channel")
109 { 109 {
110 response = HandleRegister(request); 110 response = HandleRegister(request);
111 } 111 }
112 else if (eventCallingFunction=="config_sofia") // happens once on freeswitch startup 112 else if (eventCallingFunction == "config_sofia") // happens once on freeswitch startup
113 { 113 {
114 response = HandleConfigSofia(request); 114 response = HandleConfigSofia(request);
115 } 115 }
116 else if (eventCallingFunction=="switch_load_network_lists") 116 else if (eventCallingFunction == "switch_load_network_lists")
117 { 117 {
118 //response = HandleLoadNetworkLists(request); 118 //response = HandleLoadNetworkLists(request);
119 response["int_response_code"]=404; 119 response["int_response_code"] = 404;
120 response["keepalive"] = false; 120 response["keepalive"] = false;
121 response["content_type"] = "text/xml"; 121 response["content_type"] = "text/xml";
122 response["str_response_string"] = ""; 122 response["str_response_string"] = "";
@@ -124,14 +124,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
124 else 124 else
125 { 125 {
126 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); 126 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction);
127 response["int_response_code"]=404; 127 response["int_response_code"] = 404;
128 response["keepalive"] = false; 128 response["keepalive"] = false;
129 response["content_type"] = "text/xml"; 129 response["content_type"] = "text/xml";
130 response["str_response_string"] = ""; 130 response["str_response_string"] = "";
131 } 131 }
132
133
134
135 return response; 132 return response;
136 } 133 }
137 134
@@ -147,7 +144,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
147 Hashtable response = new Hashtable(); 144 Hashtable response = new Hashtable();
148 response["content_type"] = "text/xml"; 145 response["content_type"] = "text/xml";
149 response["keepalive"] = false; 146 response["keepalive"] = false;
150 response["int_response_code"]=200; 147 response["int_response_code"] = 200;
151 response["str_response_string"] = String.Format( 148 response["str_response_string"] = String.Format(
152 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + 149 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
153 "<document type=\"freeswitch/xml\">\r\n" + 150 "<document type=\"freeswitch/xml\">\r\n" +
@@ -165,11 +162,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
165 "</user>\r\n" + 162 "</user>\r\n" +
166 "</domain>\r\n" + 163 "</domain>\r\n" +
167 "</section>\r\n" + 164 "</section>\r\n" +
168 "</document>\r\n" 165 "</document>\r\n",
169 , domain , user, password); 166 domain , user, password);
170 167
171 return response; 168 return response;
172
173 } 169 }
174 170
175 private Hashtable HandleInvite(Hashtable request) 171 private Hashtable HandleInvite(Hashtable request)
@@ -185,7 +181,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
185 Hashtable response = new Hashtable(); 181 Hashtable response = new Hashtable();
186 response["content_type"] = "text/xml"; 182 response["content_type"] = "text/xml";
187 response["keepalive"] = false; 183 response["keepalive"] = false;
188 response["int_response_code"]=200; 184 response["int_response_code"] = 200;
189 response["str_response_string"] = String.Format( 185 response["str_response_string"] = String.Format(
190 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + 186 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
191 "<document type=\"freeswitch/xml\">\r\n" + 187 "<document type=\"freeswitch/xml\">\r\n" +
@@ -213,8 +209,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
213 "</user>\r\n" + 209 "</user>\r\n" +
214 "</domain>\r\n" + 210 "</domain>\r\n" +
215 "</section>\r\n" + 211 "</section>\r\n" +
216 "</document>\r\n" 212 "</document>\r\n",
217 , domain , user, password,sipRequestUser); 213 domain , user, password,sipRequestUser);
218 214
219 return response; 215 return response;
220 } 216 }
@@ -231,7 +227,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
231 Hashtable response = new Hashtable(); 227 Hashtable response = new Hashtable();
232 response["content_type"] = "text/xml"; 228 response["content_type"] = "text/xml";
233 response["keepalive"] = false; 229 response["keepalive"] = false;
234 response["int_response_code"]=200; 230 response["int_response_code"] = 200;
235 response["str_response_string"] = String.Format( 231 response["str_response_string"] = String.Format(
236 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + 232 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
237 "<document type=\"freeswitch/xml\">\r\n" + 233 "<document type=\"freeswitch/xml\">\r\n" +
@@ -248,10 +244,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
248 "</user>\r\n" + 244 "</user>\r\n" +
249 "</domain>\r\n" + 245 "</domain>\r\n" +
250 "</section>\r\n" + 246 "</section>\r\n" +
251 "</document>\r\n" 247 "</document>\r\n",
252 , domain , user); 248 domain , user);
253
254
255 249
256 return response; 250 return response;
257 } 251 }
@@ -266,7 +260,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
266 Hashtable response = new Hashtable(); 260 Hashtable response = new Hashtable();
267 response["content_type"] = "text/xml"; 261 response["content_type"] = "text/xml";
268 response["keepalive"] = false; 262 response["keepalive"] = false;
269 response["int_response_code"]=200; 263 response["int_response_code"] = 200;
270 response["str_response_string"] = String.Format( 264 response["str_response_string"] = String.Format(
271 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + 265 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
272 "<document type=\"freeswitch/xml\">\r\n" + 266 "<document type=\"freeswitch/xml\">\r\n" +
@@ -303,9 +297,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
303 "</variables>\r\n"+ 297 "</variables>\r\n"+
304 "</domain>\r\n" + 298 "</domain>\r\n" +
305 "</section>\r\n" + 299 "</section>\r\n" +
306 "</document>\r\n" 300 "</document>\r\n",
307 , domain); 301 domain);
308
309 302
310 return response; 303 return response;
311 } 304 }
@@ -320,7 +313,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
320 Hashtable response = new Hashtable(); 313 Hashtable response = new Hashtable();
321 response["content_type"] = "text/xml"; 314 response["content_type"] = "text/xml";
322 response["keepalive"] = false; 315 response["keepalive"] = false;
323 response["int_response_code"]=200; 316 response["int_response_code"] = 200;
324 response["str_response_string"] = String.Format( 317 response["str_response_string"] = String.Format(
325 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + 318 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
326 "<document type=\"freeswitch/xml\">\r\n" + 319 "<document type=\"freeswitch/xml\">\r\n" +
@@ -335,13 +328,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
335 "</variables>\r\n"+ 328 "</variables>\r\n"+
336 "</domain>\r\n" + 329 "</domain>\r\n" +
337 "</section>\r\n" + 330 "</section>\r\n" +
338 "</document>\r\n" 331 "</document>\r\n",
339 , domain); 332 domain);
340 333
341 334
342 return response; 335 return response;
343 } 336 }
344
345 } 337 }
346
347} 338}