summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml4
-rw-r--r--indra/newview/llimview.cpp10
-rw-r--r--indra/newview/llvoicechannel.cpp9
-rw-r--r--indra/newview/llvoiceclient.cpp12
-rw-r--r--indra/newview/llvoicevivox.cpp9
-rw-r--r--indra/newview/llvoicewebrtc.cpp40
-rw-r--r--indra/newview/llvoicewebrtc.h7
7 files changed, 64 insertions, 27 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0de6db0d65..3ac1844f8e 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -15155,13 +15155,13 @@
<key>VoiceServerType</key>
<map>
<key>Comment</key>
- <string>The type of voice server to connect to.</string>
+ <string>The type of voice server to use for group, conference, and p2p calls.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
- <string>webrtc</string>
+ <string/>
</map>
<key>WLSkyDetail</key>
<map>
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 9c8fcd3283..efa8bd2109 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -424,10 +424,6 @@ void startConferenceCoro(std::string url,
postData["method"] = "start conference";
postData["session-id"] = tempSessionId;
postData["params"] = agents;
- LLSD altParams;
- altParams["voice_server_type"] = gSavedSettings.getString("VoiceServerType");
- postData["alt_params"] = altParams;
-
LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
@@ -466,10 +462,6 @@ void startP2PVoiceCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUU
postData["method"] = "start p2p voice";
postData["session-id"] = sessionID;
postData["params"] = otherParticipantId;
- LLSD altParams;
- altParams["voice_server_type"] = gSavedSettings.getString("VoiceServerType");
- postData["alt_params"] = altParams;
-
LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
@@ -2119,7 +2111,7 @@ bool LLIMModel::sendStartSession(
//we also need to wait for reply from the server in case of ad-hoc chat (we'll get new session id)
return true;
}
- else if ((dialog == IM_SESSION_P2P_INVITE) || (dialog == IM_NOTHING_SPECIAL))
+ else if (p2p_as_adhoc_call && ((dialog == IM_SESSION_P2P_INVITE) || (dialog == IM_NOTHING_SPECIAL)))
{
LLViewerRegion *region = gAgent.getRegion();
if (region)
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index f6658bbaab..92b00fe854 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -594,7 +594,14 @@ void LLVoiceChannelGroup::voiceCallCapCoro(std::string url)
postData["method"] = "call";
postData["session-id"] = mSessionID;
LLSD altParams;
- altParams["preferred_voice_server_type"] = gSavedSettings.getString("VoiceServerType");
+ std::string preferred_voice_server_type = gSavedSettings.getString("VoiceServerType");
+ if (preferred_voice_server_type.empty())
+ {
+ // default to the server type associated with the region we're on.
+ LLVoiceVersionInfo versionInfo = LLVoiceClient::getInstance()->getVersion();
+ preferred_voice_server_type = versionInfo.internalVoiceServerType;
+ }
+ altParams["preferred_voice_server_type"] = preferred_voice_server_type;
postData["alt_params"] = altParams;
LL_INFOS("Voice", "voiceCallCapCoro") << "Generic POST for " << url << LL_ENDL;
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 9dbf469ca8..6eadc3892e 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -538,12 +538,18 @@ LLVoiceP2PIncomingCallInterfacePtr LLVoiceClient::getIncomingCallInterface(const
// outgoing calls
LLVoiceP2POutgoingCallInterface *LLVoiceClient::getOutgoingCallInterface(const LLSD& voiceChannelInfo)
{
- std::string voiceServerType = gSavedSettings.getString("VoiceServerType");
+ std::string voice_server_type = gSavedSettings.getString("VoiceServerType");
+ if (voice_server_type.empty())
+ {
+ // default to the server type associated with the region we're on.
+ LLVoiceVersionInfo versionInfo = LLVoiceClient::getInstance()->getVersion();
+ voice_server_type = versionInfo.internalVoiceServerType;
+ }
if (voiceChannelInfo.has("voice_server_type"))
{
- voiceServerType = voiceChannelInfo["voice_server_type"].asString();
+ voice_server_type = voiceChannelInfo["voice_server_type"].asString();
}
- LLVoiceModuleInterface *module = getVoiceModule(voiceServerType);
+ LLVoiceModuleInterface *module = getVoiceModule(voice_server_type);
return dynamic_cast<LLVoiceP2POutgoingCallInterface *>(module);
}
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index be9e055203..88fc40e565 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -4952,6 +4952,7 @@ bool LLVivoxVoiceClient::setSpatialChannel(const LLSD& channelInfo)
void LLVivoxVoiceClient::callUser(const LLUUID &uuid)
{
std::string userURI = sipURIFromID(uuid);
+ mProcessChannels = true;
switchChannel(userURI, false, true, true);
}
@@ -4974,7 +4975,7 @@ bool LLVivoxVoiceClient::answerInvite(const std::string &sessionHandle)
session->mIsSpatial = false;
session->mReconnect = false;
session->mIsP2P = true;
-
+ mProcessChannels = true;
joinSession(session);
return true;
}
@@ -5078,7 +5079,9 @@ void LLVivoxVoiceClient::leaveNonSpatialChannel()
void LLVivoxVoiceClient::processChannels(bool process)
{
- mProcessChannels = process;
+ mCurrentParcelLocalID = -1;
+ mCurrentRegionName.clear();
+ mProcessChannels = process;
}
bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo)
@@ -5456,6 +5459,8 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled)
LLVoiceChannel::getCurrentVoiceChannel()->deactivate();
gAgent.setVoiceConnected(false);
status = LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED;
+ mCurrentParcelLocalID = -1;
+ mCurrentRegionName.clear();
}
notifyStatusObservers(status);
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 7743d6362a..c6e9d3d1ec 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -1269,6 +1269,35 @@ BOOL LLWebRTCVoiceClient::isSessionCallBackPossible(const LLUUID &session_id)
}
// Channel Management
+
+bool LLWebRTCVoiceClient::setSpatialChannel(const LLSD &channelInfo)
+{
+ LL_INFOS("Voice") << "SetSpatialChannel " << channelInfo << LL_ENDL;
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (!regionp)
+ {
+ return false;
+ }
+ LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+
+ // we don't really have credentials for a spatial channel in webrtc,
+ // it's all handled by the sim.
+ if (channelInfo.isMap() && channelInfo.has("channel_uri"))
+ {
+ bool allow_voice = !channelInfo["channel_uri"].asString().empty();
+ if (parcel)
+ {
+ parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, allow_voice);
+ parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, channelInfo["channel_uri"].asUUID() == regionp->getRegionID());
+ }
+ else
+ {
+ regionp->setRegionFlag(REGION_FLAGS_ALLOW_VOICE, allow_voice);
+ }
+ }
+ return true;
+}
+
void LLWebRTCVoiceClient::leaveNonSpatialChannel()
{
LL_DEBUGS("Voice") << "Request to leave non-spatial channel." << LL_ENDL;
@@ -2116,7 +2145,7 @@ void LLVoiceWebRTCConnection::OnIceCandidate(const llwebrtc::LLWebRTCIceCandidat
void LLVoiceWebRTCConnection::processIceUpdates()
{
mOutstandingRequests++;
- LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::requestVoiceConnectionCoro",
+ LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::processIceUpdatesCoro",
boost::bind(&LLVoiceWebRTCConnection::processIceUpdatesCoro, this));
}
@@ -2436,7 +2465,9 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection()
if (!regionp || !regionp->capabilitiesReceived())
{
LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL;
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+
+ // try again.
+ setVoiceConnectionState(VOICE_STATE_REQUEST_CONNECTION);
return;
}
@@ -2988,8 +3019,9 @@ void LLVoiceWebRTCAdHocConnection::requestVoiceConnection()
LL_DEBUGS("Voice") << "Requesting voice connection." << LL_ENDL;
if (!regionp || !regionp->capabilitiesReceived())
{
- LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL;
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+ LL_DEBUGS("Voice") << "no capabilities for voice provisioning; retrying " << LL_ENDL;
+ // try again.
+ setVoiceConnectionState(VOICE_STATE_REQUEST_CONNECTION);
return;
}
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index aa3298ec1b..67e4a4ea6f 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -144,12 +144,7 @@ public:
startAdHocSession(channelInfo, notify_on_first_join, hangup_on_last_leave);
}
- bool setSpatialChannel(const LLSD &channelInfo) override
- {
- // we don't really have credentials for a spatial channel in webrtc,
- // it's all handled by the sim.
- return true;
- }
+ bool setSpatialChannel(const LLSD &channelInfo) override;
void leaveNonSpatialChannel() override;