summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llvoicewebrtc.cpp29
-rw-r--r--indra/newview/llvoicewebrtc.h6
2 files changed, 27 insertions, 8 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 31ad5b7a5d..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),
@@ -2458,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--;
}
@@ -2611,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;