diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 82 |
2 files changed, 57 insertions, 29 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 45af212..3db0781 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -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"; |
@@ -726,7 +726,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
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"]; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index dd44564..f51527e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -121,6 +121,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
121 | 121 | ||
122 | public void Initialise(IConfigSource config) | 122 | public void Initialise(IConfigSource config) |
123 | { | 123 | { |
124 | MainConsole.Instance.Commands.AddCommand("vivox", false, "vivox debug", "vivox debug <on>|<off>", "Set vivox debugging", HandleDebug); | ||
124 | 125 | ||
125 | m_config = config.Configs["VivoxVoice"]; | 126 | m_config = config.Configs["VivoxVoice"]; |
126 | 127 | ||
@@ -196,7 +197,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
196 | break; | 197 | break; |
197 | } | 198 | } |
198 | 199 | ||
199 | m_vivoxVoiceAccountApi = String.Format("http://{0}/api2", m_vivoxServer); | 200 | m_vivoxVoiceAccountApi = String.Format("https://{0}/api2", m_vivoxServer); |
200 | 201 | ||
201 | // Admin interface required values | 202 | // Admin interface required values |
202 | if (String.IsNullOrEmpty(m_vivoxServer) || | 203 | if (String.IsNullOrEmpty(m_vivoxServer) || |
@@ -475,8 +476,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
475 | avatarName = avatar.Name; | 476 | avatarName = avatar.Name; |
476 | 477 | ||
477 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID); | 478 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID); |
478 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", | 479 | // m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", |
479 | request, path, param); | 480 | // request, path, param); |
480 | 481 | ||
481 | XmlElement resp; | 482 | XmlElement resp; |
482 | bool retry = false; | 483 | bool retry = false; |
@@ -583,7 +584,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
583 | 584 | ||
584 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 585 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
585 | 586 | ||
586 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r); | 587 | // m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r); |
587 | 588 | ||
588 | return r; | 589 | return r; |
589 | } | 590 | } |
@@ -630,24 +631,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
630 | // voice, if all do retrieve or obtain the parcel | 631 | // voice, if all do retrieve or obtain the parcel |
631 | // voice channel | 632 | // voice channel |
632 | LandData land = scene.GetLandData(avatar.AbsolutePosition); | 633 | LandData land = scene.GetLandData(avatar.AbsolutePosition); |
634 | if (land == null) | ||
635 | { | ||
636 | return "<llsd><undef /></llsd>"; | ||
637 | } | ||
633 | 638 | ||
634 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", | 639 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", |
635 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); | 640 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); |
636 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}", | 641 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}", |
637 | // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | 642 | // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); |
638 | 643 | ||
639 | // TODO: EstateSettings don't seem to get propagated... | 644 | // TODO: EstateSettings don't seem to get propagated... |
640 | if (!scene.RegionInfo.EstateSettings.AllowVoice) | 645 | if (!scene.RegionInfo.EstateSettings.AllowVoice) |
641 | { | 646 | { |
642 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", | 647 | //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", |
643 | scene.RegionInfo.RegionName); | 648 | // scene.RegionInfo.RegionName); |
644 | channel_uri = String.Empty; | 649 | channel_uri = String.Empty; |
645 | } | 650 | } |
646 | 651 | ||
647 | if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) | 652 | if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) |
648 | { | 653 | { |
649 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", | 654 | //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", |
650 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); | 655 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); |
651 | channel_uri = String.Empty; | 656 | channel_uri = String.Empty; |
652 | } | 657 | } |
653 | else | 658 | else |
@@ -662,8 +667,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
662 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); | 667 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); |
663 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); | 668 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); |
664 | 669 | ||
665 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", | 670 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", |
666 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); | 671 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); |
667 | return r; | 672 | return r; |
668 | } | 673 | } |
669 | catch (Exception e) | 674 | catch (Exception e) |
@@ -690,11 +695,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
690 | public string ChatSessionRequest(Scene scene, string request, string path, string param, | 695 | public string ChatSessionRequest(Scene scene, string request, string path, string param, |
691 | UUID agentID, Caps caps) | 696 | UUID agentID, Caps caps) |
692 | { | 697 | { |
693 | ScenePresence avatar = scene.GetScenePresence(agentID); | 698 | // ScenePresence avatar = scene.GetScenePresence(agentID); |
694 | string avatarName = avatar.Name; | 699 | // string avatarName = avatar.Name; |
695 | 700 | ||
696 | m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", | 701 | // m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", |
697 | avatarName, request, path, param); | 702 | // avatarName, request, path, param); |
698 | return "<llsd>true</llsd>"; | 703 | return "<llsd>true</llsd>"; |
699 | } | 704 | } |
700 | 705 | ||
@@ -744,7 +749,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
744 | return channelUri; | 749 | return channelUri; |
745 | } | 750 | } |
746 | 751 | ||
747 | private static readonly string m_vivoxLoginPath = "http://{0}/api2/viv_signin.php?userid={1}&pwd={2}"; | 752 | |
753 | private static readonly string m_vivoxLoginPath = "https://{0}/api2/viv_signin.php?userid={1}&pwd={2}"; | ||
748 | 754 | ||
749 | /// <summary> | 755 | /// <summary> |
750 | /// Perform administrative login for Vivox. | 756 | /// Perform administrative login for Vivox. |
@@ -756,7 +762,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
756 | return VivoxCall(requrl, false); | 762 | return VivoxCall(requrl, false); |
757 | } | 763 | } |
758 | 764 | ||
759 | private static readonly string m_vivoxLogoutPath = "http://{0}/api2/viv_signout.php?auth_token={1}"; | 765 | private static readonly string m_vivoxLogoutPath = "https://{0}/api2/viv_signout.php?auth_token={1}"; |
760 | 766 | ||
761 | /// <summary> | 767 | /// <summary> |
762 | /// Perform administrative logout for Vivox. | 768 | /// Perform administrative logout for Vivox. |
@@ -767,7 +773,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
767 | return VivoxCall(requrl, false); | 773 | return VivoxCall(requrl, false); |
768 | } | 774 | } |
769 | 775 | ||
770 | private static readonly string m_vivoxGetAccountPath = "http://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}"; | 776 | |
777 | private static readonly string m_vivoxGetAccountPath = "https://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}"; | ||
771 | 778 | ||
772 | /// <summary> | 779 | /// <summary> |
773 | /// Retrieve account information for the specified user. | 780 | /// Retrieve account information for the specified user. |
@@ -779,7 +786,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
779 | return VivoxCall(requrl, true); | 786 | return VivoxCall(requrl, true); |
780 | } | 787 | } |
781 | 788 | ||
782 | private static readonly string m_vivoxNewAccountPath = "http://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}"; | 789 | |
790 | private static readonly string m_vivoxNewAccountPath = "https://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}"; | ||
783 | 791 | ||
784 | /// <summary> | 792 | /// <summary> |
785 | /// Creates a new account. | 793 | /// Creates a new account. |
@@ -793,7 +801,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
793 | return VivoxCall(requrl, true); | 801 | return VivoxCall(requrl, true); |
794 | } | 802 | } |
795 | 803 | ||
796 | private static readonly string m_vivoxPasswordPath = "http://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}"; | 804 | |
805 | private static readonly string m_vivoxPasswordPath = "https://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}"; | ||
797 | 806 | ||
798 | /// <summary> | 807 | /// <summary> |
799 | /// Change the user's password. | 808 | /// Change the user's password. |
@@ -804,7 +813,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
804 | return VivoxCall(requrl, true); | 813 | return VivoxCall(requrl, true); |
805 | } | 814 | } |
806 | 815 | ||
807 | private static readonly string m_vivoxChannelPath = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}"; | 816 | |
817 | private static readonly string m_vivoxChannelPath = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}"; | ||
808 | 818 | ||
809 | /// <summary> | 819 | /// <summary> |
810 | /// Create a channel. | 820 | /// Create a channel. |
@@ -876,7 +886,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
876 | return false; | 886 | return false; |
877 | } | 887 | } |
878 | 888 | ||
879 | private static readonly string m_vivoxChannelSearchPath = "http://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}"; | 889 | private static readonly string m_vivoxChannelSearchPath = "https://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}"; |
880 | 890 | ||
881 | /// <summary> | 891 | /// <summary> |
882 | /// Retrieve a channel. | 892 | /// Retrieve a channel. |
@@ -1019,7 +1029,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1019 | return false; | 1029 | return false; |
1020 | } | 1030 | } |
1021 | 1031 | ||
1022 | // private static readonly string m_vivoxChannelById = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; | 1032 | // private static readonly string m_vivoxChannelById = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; |
1023 | 1033 | ||
1024 | // private XmlElement VivoxGetChannelById(string parent, string channelid) | 1034 | // private XmlElement VivoxGetChannelById(string parent, string channelid) |
1025 | // { | 1035 | // { |
@@ -1031,7 +1041,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1031 | // return VivoxCall(requrl, true); | 1041 | // return VivoxCall(requrl, true); |
1032 | // } | 1042 | // } |
1033 | 1043 | ||
1034 | private static readonly string m_vivoxChannelDel = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; | 1044 | private static readonly string m_vivoxChannelDel = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; |
1035 | 1045 | ||
1036 | /// <summary> | 1046 | /// <summary> |
1037 | /// Delete a channel. | 1047 | /// Delete a channel. |
@@ -1044,6 +1054,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1044 | /// are required in a later phase. | 1054 | /// are required in a later phase. |
1045 | /// In this case the call handles parent and description as optional values. | 1055 | /// In this case the call handles parent and description as optional values. |
1046 | /// </summary> | 1056 | /// </summary> |
1057 | |||
1047 | private XmlElement VivoxDeleteChannel(string parent, string channelid) | 1058 | private XmlElement VivoxDeleteChannel(string parent, string channelid) |
1048 | { | 1059 | { |
1049 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); | 1060 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); |
@@ -1054,11 +1065,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1054 | return VivoxCall(requrl, true); | 1065 | return VivoxCall(requrl, true); |
1055 | } | 1066 | } |
1056 | 1067 | ||
1057 | private static readonly string m_vivoxChannelSearch = "http://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; | 1068 | private static readonly string m_vivoxChannelSearch = "https://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; |
1058 | 1069 | ||
1059 | /// <summary> | 1070 | /// <summary> |
1060 | /// Return information on channels in the given directory | 1071 | /// Return information on channels in the given directory |
1061 | /// </summary> | 1072 | /// </summary> |
1073 | |||
1062 | private XmlElement VivoxListChildren(string channelid) | 1074 | private XmlElement VivoxListChildren(string channelid) |
1063 | { | 1075 | { |
1064 | string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); | 1076 | string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); |
@@ -1124,7 +1136,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1124 | try | 1136 | try |
1125 | { | 1137 | { |
1126 | // Otherwise prepare the request | 1138 | // Otherwise prepare the request |
1127 | m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); | 1139 | //m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); |
1128 | 1140 | ||
1129 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); | 1141 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); |
1130 | 1142 | ||
@@ -1324,5 +1336,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1324 | result = String.Empty; | 1336 | result = String.Empty; |
1325 | return false; | 1337 | return false; |
1326 | } | 1338 | } |
1339 | |||
1340 | private void HandleDebug(string module, string[] cmd) | ||
1341 | { | ||
1342 | if (cmd.Length < 3) | ||
1343 | { | ||
1344 | MainConsole.Instance.Output("Error: missing on/off flag"); | ||
1345 | return; | ||
1346 | } | ||
1347 | |||
1348 | if (cmd[2] == "on") | ||
1349 | m_dumpXml = true; | ||
1350 | else if (cmd[2] == "off") | ||
1351 | m_dumpXml = false; | ||
1352 | else | ||
1353 | MainConsole.Instance.Output("Error: only on and off are supported"); | ||
1354 | } | ||
1327 | } | 1355 | } |
1328 | } | 1356 | } |