From cfd358f93350bf0ea487480d5c39bf48605b115b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 16 May 2024 13:34:13 -0700 Subject: WebRTC clients calling Vivox clients should handle P2P --- indra/newview/llimview.cpp | 4 +++- indra/newview/llvoiceclient.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cf25d1a650..a411329ffb 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3393,8 +3393,9 @@ LLUUID LLIMMgr::addSession( im_floater->reloadMessages(); } } + LLIMModel::LLIMSession *session = LLIMModel::getInstance()->findIMSession(session_id); - bool new_session = (LLIMModel::getInstance()->findIMSession(session_id) == NULL); + bool new_session = (session == NULL); //works only for outgoing ad-hoc sessions if (new_session && @@ -3417,6 +3418,7 @@ LLUUID LLIMMgr::addSession( //Notifies observers that the session was already added else { + session->initVoiceChannel(voiceChannelInfo); std::string session_name = LLIMModel::getInstance()->getName(session_id); LLIMMgr::getInstance()->notifyObserverSessionActivated(session_id, session_name, other_participant_id); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 8bd3897761..a4a6922fd2 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -540,9 +540,11 @@ LLVoiceP2POutgoingCallInterface *LLVoiceClient::getOutgoingCallInterface(const L LLVoiceVersionInfo versionInfo = LLVoiceClient::getInstance()->getVersion(); voice_server_type = versionInfo.internalVoiceServerType; } - if (voiceChannelInfo.has("voice_server_type")) + if (voiceChannelInfo.has("voice_server_type") && voiceChannelInfo["voice_server_type"] != voice_server_type) { - voice_server_type = voiceChannelInfo["voice_server_type"].asString(); + // there's a mismatch between what the peer is offering and what our server + // can handle, so downgrade to vivox + voice_server_type = VIVOX_VOICE_SERVER_TYPE; } LLVoiceModuleInterface *module = getVoiceModule(voice_server_type); return dynamic_cast(module); -- cgit v1.2.3