diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-12-24 20:50:08 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:36 -0800 |
commit | 28b3e530821f06df6c447e139bae57a976f10b7e (patch) | |
tree | 23c0b2f9a4fd4de86e0a063de2c5ce5fb05d9575 | |
parent | af5cc7bd7098ddeffd2ed4765ba433f3a1961644 (diff) |
Add viewer-visible session ID to allow multiple sessions under same agent id
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llvoicewebrtc.h | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 99061c00da..305868e415 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -414,6 +414,10 @@ void LLWebRTCVoiceClient::OnConnectionEstablished(const std::string& channelID, { if (mNextAudioSession && mNextAudioSession->mChannelID == channelID) { + if (mAudioSession) + { + mAudioSession->shutdownAllConnections(); + } mAudioSession = mNextAudioSession; mNextAudioSession.reset(); LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN); @@ -2593,6 +2597,8 @@ void LLVoiceWebRTCConnection::processIceUpdates() iceCompleted = mIceCompleted; mIceCompleted = false; } + + body["viewer_session"] = mViewerSession; LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( @@ -2663,9 +2669,10 @@ void LLVoiceWebRTCConnection::OnVoiceConnectionRequestSuccess(const LLSD &result } LLVoiceWebRTCStats::getInstance()->provisionAttemptEnd(true); - if (result.has("jsep") && result["jsep"].has("type") && result["jsep"]["type"] == "answer" && result["jsep"].has("sdp")) + if (result.has("viewer_session") && result.has("jsep") && result["jsep"].has("type") && result["jsep"]["type"] == "answer" && result["jsep"].has("sdp")) { mRemoteChannelSDP = result["jsep"]["sdp"].asString(); + mViewerSession = result["viewer_session"]; } else { @@ -2673,13 +2680,9 @@ void LLVoiceWebRTCConnection::OnVoiceConnectionRequestSuccess(const LLSD &result mOutstandingRequests--; return; } - std::string voiceAccountServerUri; - std::string voiceUserName = gAgent.getID().asString(); - std::string voicePassword = ""; // no password for now. LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response" - << " user " << (voiceUserName.empty() ? "not set" : "set") << " password " - << (voicePassword.empty() ? "not set" : "set") << " channel sdp " << mRemoteChannelSDP << LL_ENDL; + << " channel sdp " << mRemoteChannelSDP << LL_ENDL; mWebRTCPeerConnection->AnswerAvailable(mRemoteChannelSDP); mOutstandingRequests--; @@ -2819,8 +2822,9 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() } -void LLVoiceWebRTCConnection::sendData(const std::string& data) { - if (mWebRTCDataInterface) +void LLVoiceWebRTCConnection::sendData(const std::string& data) { + + if (getVoiceConnectionState() == VOICE_STATE_SESSION_UP && mWebRTCDataInterface) { mWebRTCDataInterface->sendData(data, false); } @@ -2858,6 +2862,7 @@ bool LLVoiceWebRTCConnection::breakVoiceConnection(bool corowait) LLVoiceWebRTCStats::getInstance()->provisionAttemptStart(); LLSD body; body["logout"] = TRUE; + body["viewer_session"] = mViewerSession; LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost( url, diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index f042ecca85..c8ba3ee115 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -829,6 +829,8 @@ protected: std::string mChannelSDP; std::string mRemoteChannelSDP; + LLUUID mViewerSession; + std::string mChannelID; LLUUID mRegionID; S32 mParcelLocalID; |