diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 45af212..c6d7fe6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -143,7 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
143 | if (String.IsNullOrEmpty(m_freeSwitchRealm) || | 143 | if (String.IsNullOrEmpty(m_freeSwitchRealm) || |
144 | String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) | 144 | String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) |
145 | { | 145 | { |
146 | m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting."); | 146 | m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting."); |
147 | return; | 147 | return; |
148 | } | 148 | } |
149 | 149 | ||
@@ -168,9 +168,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
168 | 168 | ||
169 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), | 169 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), |
170 | FreeSwitchSLVoiceBuddyHTTPHandler); | 170 | FreeSwitchSLVoiceBuddyHTTPHandler); |
171 | 171 | ||
172 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix), | 172 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix), |
173 | FreeSwitchSLVoiceWatcherHTTPHandler); | 173 | FreeSwitchSLVoiceWatcherHTTPHandler); |
174 | 174 | ||
175 | m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm); | 175 | m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm); |
176 | 176 | ||
@@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
302 | public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps) | 302 | public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps) |
303 | { | 303 | { |
304 | m_log.DebugFormat( | 304 | m_log.DebugFormat( |
305 | "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}", | 305 | "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}", |
306 | agentID, caps, scene.RegionInfo.RegionName); | 306 | agentID, caps, scene.RegionInfo.RegionName); |
307 | 307 | ||
308 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 308 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -352,7 +352,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
352 | { | 352 | { |
353 | m_log.DebugFormat( | 353 | m_log.DebugFormat( |
354 | "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param); | 354 | "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param); |
355 | 355 | ||
356 | ScenePresence avatar = scene.GetScenePresence(agentID); | 356 | ScenePresence avatar = scene.GetScenePresence(agentID); |
357 | if (avatar == null) | 357 | if (avatar == null) |
358 | { | 358 | { |
@@ -423,9 +423,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
423 | UUID agentID, Caps caps) | 423 | UUID agentID, Caps caps) |
424 | { | 424 | { |
425 | m_log.DebugFormat( | 425 | m_log.DebugFormat( |
426 | "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", | 426 | "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", |
427 | scene.RegionInfo.RegionName, agentID); | 427 | scene.RegionInfo.RegionName, agentID); |
428 | 428 | ||
429 | ScenePresence avatar = scene.GetScenePresence(agentID); | 429 | ScenePresence avatar = scene.GetScenePresence(agentID); |
430 | string avatarName = avatar.Name; | 430 | string avatarName = avatar.Name; |
431 | 431 | ||
@@ -512,7 +512,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
512 | 512 | ||
513 | m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", | 513 | m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", |
514 | avatarName, request, path, param); | 514 | avatarName, request, path, param); |
515 | 515 | ||
516 | return "<llsd>true</llsd>"; | 516 | return "<llsd>true</llsd>"; |
517 | } | 517 | } |
518 | 518 | ||
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
575 | 575 | ||
576 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) | 576 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) |
577 | { | 577 | { |
578 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceGetPreloginHTTPHandler called"); | 578 | // m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called"); |
579 | 579 | ||
580 | Hashtable response = new Hashtable(); | 580 | Hashtable response = new Hashtable(); |
581 | response["content_type"] = "text/xml"; | 581 | response["content_type"] = "text/xml"; |
@@ -610,7 +610,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
610 | public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request) | 610 | public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request) |
611 | { | 611 | { |
612 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called"); | 612 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called"); |
613 | 613 | ||
614 | Hashtable response = new Hashtable(); | 614 | Hashtable response = new Hashtable(); |
615 | response["int_response_code"] = 200; | 615 | response["int_response_code"] = 200; |
616 | response["str_response_string"] = string.Empty; | 616 | response["str_response_string"] = string.Empty; |
@@ -678,16 +678,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
678 | // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); | 678 | // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); |
679 | // | 679 | // |
680 | // m_log.DebugFormat( | 680 | // m_log.DebugFormat( |
681 | // "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}", | 681 | // "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}", |
682 | // normalizeEndLines.Replace((string)response["str_response_string"],"")); | 682 | // normalizeEndLines.Replace((string)response["str_response_string"],"")); |
683 | 683 | ||
684 | return response; | 684 | return response; |
685 | } | 685 | } |
686 | 686 | ||
687 | public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request) | 687 | public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request) |
688 | { | 688 | { |
689 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called"); | 689 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called"); |
690 | 690 | ||
691 | Hashtable response = new Hashtable(); | 691 | Hashtable response = new Hashtable(); |
692 | response["int_response_code"] = 200; | 692 | response["int_response_code"] = 200; |
693 | response["content-type"] = "text/xml"; | 693 | response["content-type"] = "text/xml"; |
@@ -700,8 +700,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
700 | 700 | ||
701 | StringBuilder resp = new StringBuilder(); | 701 | StringBuilder resp = new StringBuilder(); |
702 | resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">"); | 702 | resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">"); |
703 | 703 | ||
704 | // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't | 704 | // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't |
705 | // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop | 705 | // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop |
706 | // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply. | 706 | // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply. |
707 | // | 707 | // |
@@ -711,22 +711,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
711 | <cookie_name>lib_session</cookie_name> | 711 | <cookie_name>lib_session</cookie_name> |
712 | <cookie>{0}</cookie> | 712 | <cookie>{0}</cookie> |
713 | <auth_token>{0}</auth_token> | 713 | <auth_token>{0}</auth_token> |
714 | <body/></level0></response>", auth_token)); | 714 | <body/></level0></response>", auth_token)); |
715 | 715 | ||
716 | response["str_response_string"] = resp.ToString(); | 716 | response["str_response_string"] = resp.ToString(); |
717 | 717 | ||
718 | // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); | 718 | // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); |
719 | // | 719 | // |
720 | // m_log.DebugFormat( | 720 | // m_log.DebugFormat( |
721 | // "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}", | 721 | // "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}", |
722 | // normalizeEndLines.Replace((string)response["str_response_string"],"")); | 722 | // normalizeEndLines.Replace((string)response["str_response_string"],"")); |
723 | 723 | ||
724 | return response; | 724 | return response; |
725 | } | 725 | } |
726 | 726 | ||
727 | public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) | 727 | public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) |
728 | { | 728 | { |
729 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceSigninHTTPHandler called"); | 729 | //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called"); |
730 | // string requestbody = (string)request["body"]; | 730 | // string requestbody = (string)request["body"]; |
731 | // string uri = (string)request["uri"]; | 731 | // string uri = (string)request["uri"]; |
732 | // string contenttype = (string)request["content-type"]; | 732 | // string contenttype = (string)request["content-type"]; |
@@ -771,10 +771,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
771 | </level0> | 771 | </level0> |
772 | </response>", userid, pos, avatarName); | 772 | </response>", userid, pos, avatarName); |
773 | 773 | ||
774 | response["int_response_code"] = 200; | 774 | response["int_response_code"] = 200; |
775 | 775 | ||
776 | // m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response"); | 776 | // m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response"); |
777 | 777 | ||
778 | return response; | 778 | return response; |
779 | } | 779 | } |
780 | 780 | ||
@@ -859,23 +859,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
859 | response["keepalive"] = false; | 859 | response["keepalive"] = false; |
860 | response["int_response_code"] = 500; | 860 | response["int_response_code"] = 500; |
861 | 861 | ||
862 | Hashtable requestBody = ParseRequestBody((string)request["body"]); | 862 | Hashtable requestBody = ParseRequestBody((string)request["body"]); |
863 | 863 | ||
864 | string section = (string) requestBody["section"]; | 864 | string section = (string) requestBody["section"]; |
865 | 865 | ||
866 | if (section == "directory") | 866 | if (section == "directory") |
867 | { | 867 | { |
868 | string eventCallingFunction = (string)requestBody["Event-Calling-Function"]; | 868 | string eventCallingFunction = (string)requestBody["Event-Calling-Function"]; |
869 | m_log.DebugFormat( | 869 | m_log.DebugFormat( |
870 | "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'", | 870 | "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'", |
871 | eventCallingFunction); | 871 | eventCallingFunction); |
872 | 872 | ||
873 | response = m_FreeswitchService.HandleDirectoryRequest(requestBody); | 873 | response = m_FreeswitchService.HandleDirectoryRequest(requestBody); |
874 | } | 874 | } |
875 | else if (section == "dialplan") | 875 | else if (section == "dialplan") |
876 | { | 876 | { |
877 | m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan"); | 877 | m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan"); |
878 | 878 | ||
879 | response = m_FreeswitchService.HandleDialplanRequest(requestBody); | 879 | response = m_FreeswitchService.HandleDialplanRequest(requestBody); |
880 | } | 880 | } |
881 | else | 881 | else |