summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRoxanne Skelly <roxie@lindenlab.com>2024-03-24 22:14:41 -0700
committerGitHub <noreply@github.com>2024-03-24 22:14:41 -0700
commit07ac9ac5874b88d46735d48dcccb196b65332329 (patch)
treedddf352fa69cd8bce253bdeaed06a7799fb63bde /indra/newview
parent32e3a39e277d5cdf9085627a9f5b3dd3cbc11376 (diff)
parente272e387d3ce2111d2a045f79671b3ebc3819267 (diff)
Merge pull request #1039 from secondlife/roxie/webrtc-voice
WebRTC: Throw 'area full' message when voice server indicates the channel is at capacity.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoicewebrtc.cpp35
-rw-r--r--indra/newview/llvoicewebrtc.h6
2 files changed, 29 insertions, 12 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 80e7323b6f..72d343598b 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -837,18 +837,20 @@ void LLWebRTCVoiceClient::OnConnectionShutDown(const std::string &channelID, con
}
}
}
-void LLWebRTCVoiceClient::OnConnectionFailure(const std::string &channelID, const LLUUID &regionID)
+void LLWebRTCVoiceClient::OnConnectionFailure(const std::string &channelID,
+ const LLUUID &regionID,
+ LLVoiceClientStatusObserver::EStatusType status_type)
{
LL_DEBUGS("Voice") << "A connection failed. channel:" << channelID << LL_ENDL;
if (gAgent.getRegion()->getRegionID() == regionID)
{
if (mNextSession && mNextSession->mChannelID == channelID)
{
- LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::ERROR_UNKNOWN);
+ LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(status_type);
}
else if (mSession && mSession->mChannelID == channelID)
{
- LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::ERROR_UNKNOWN);
+ LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(status_type);
}
}
}
@@ -2030,6 +2032,7 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s
mWebRTCAudioInterface(nullptr),
mWebRTCDataInterface(nullptr),
mVoiceConnectionState(VOICE_STATE_START_SESSION),
+ mCurrentStatus(LLVoiceClientStatusObserver::STATUS_VOICE_ENABLED),
mMuted(true),
mShutDown(false),
mIceCompleted(false),
@@ -2374,7 +2377,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro()
LLSD body;
body["logout"] = TRUE;
body["viewer_session"] = mViewerSession;
- body["voice_server_type"] = REPORTED_VOICE_SERVER_TYPE;
+ body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(
new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::breakVoiceConnection",
@@ -2437,9 +2440,7 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection()
LLSD body;
LLSD jsep;
jsep["type"] = "offer";
- {
- jsep["sdp"] = mChannelSDP;
- }
+ jsep["sdp"] = mChannelSDP;
body["jsep"] = jsep;
if (mParcelLocalID != INVALID_PARCEL_ID)
{
@@ -2460,13 +2461,25 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection()
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- if (!status)
+ if (status)
{
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+ OnVoiceConnectionRequestSuccess(result);
}
else
{
- OnVoiceConnectionRequestSuccess(result);
+ switch (status.getType())
+ {
+ case HTTP_CONFLICT:
+ mCurrentStatus = LLVoiceClientStatusObserver::ERROR_CHANNEL_FULL;
+ break;
+ case HTTP_UNAUTHORIZED:
+ mCurrentStatus = LLVoiceClientStatusObserver::ERROR_CHANNEL_LOCKED;
+ break;
+ default:
+ mCurrentStatus = LLVoiceClientStatusObserver::ERROR_UNKNOWN;
+ break;
+ }
+ setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
}
mOutstandingRequests--;
}
@@ -2613,7 +2626,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
if (mRetryWaitPeriod++ * UPDATE_THROTTLE_SECONDS > mRetryWaitSecs)
{
// something went wrong, so notify that the connection has failed.
- LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID);
+ LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID, mCurrentStatus);
setVoiceConnectionState(VOICE_STATE_DISCONNECT);
mRetryWaitPeriod = 0;
if (mRetryWaitSecs < MAX_RETRY_WAIT_SECONDS)
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index f6ddc6dbe7..4fe0e756a7 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -203,7 +203,9 @@ public:
void OnConnectionEstablished(const std::string& channelID, const LLUUID& regionID);
void OnConnectionShutDown(const std::string &channelID, const LLUUID &regionID);
- void OnConnectionFailure(const std::string &channelID, const LLUUID& regionID);
+ void OnConnectionFailure(const std::string &channelID,
+ const LLUUID &regionID,
+ LLVoiceClientStatusObserver::EStatusType status_type = LLVoiceClientStatusObserver::ERROR_UNKNOWN);
void sendPositionUpdate(bool force);
void updateOwnVolume();
@@ -675,6 +677,8 @@ class LLVoiceWebRTCConnection :
void breakVoiceConnectionCoro();
+ LLVoiceClientStatusObserver::EStatusType mCurrentStatus;
+
LLUUID mRegionID;
LLUUID mViewerSession;
std::string mChannelID;