From 3ff1f0f9518c7b2faf1f9ea5e3f2eb42539ba2e5 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 4 Apr 2024 11:32:51 -0700 Subject: An explicit "decline" message for P2P When declining a P2P voice call for webrtc, instead of relying on vivox to stop "ringing," we need to send an explicit decline message from the peer through the server infrastructure. --- indra/newview/llimview.cpp | 41 ++++++++++++++++++++++++++++++++++++++--- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llvoicewebrtc.cpp | 2 +- 3 files changed, 40 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 215cc4103b..2f2a6041ad 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -103,6 +103,7 @@ enum EMultiAgentChatSessionType void startConferenceCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, LLUUID otherParticipantId, LLSD agents); void startP2PCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, LLUUID otherParticipantId); +void declineP2PCoro(std::string url, LLUUID sessionID); void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvitationType invitationType); void chatterBoxHistoryCoro(std::string url, LLUUID sessionId, std::string from, std::string message, U32 timestamp); @@ -488,6 +489,27 @@ void startP2PCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID ot } } +void declineP2PCoro(std::string url, LLUUID sessionID) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceChatStart", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + + LLSD postData; + postData["method"] = "decline p2p"; + postData["session-id"] = sessionID; + + LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("LLIMModel") << "Failed to decline p2p session:" << postData << "->" << result << LL_ENDL; + } +} + void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvitationType invitationType) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -3005,10 +3027,23 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload { if (type == IM_SESSION_P2P_INVITE) { - LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(payload["voice_session_info"]); - if (call) + // create a normal IM session + LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(payload["voice_channel_info"]); + if (call) + { + call->declineInvite(); + } + else { - call->declineInvite(); + // webrtc-style decline. + LLViewerRegion *region = gAgent.getRegion(); + if (region) + { + std::string url = region->getCapability("ChatSessionRequest"); + LLCoros::instance().launch("declineP2P", + boost::bind(&declineP2PCoro, url, session_id)); + } + } } else diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f5c9e3aa98..be9e055203 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5089,7 +5089,7 @@ bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo) } if (mAudioSession) { - if (!channelInfo["sessionHandle"].asString().empty()) + if (!channelInfo["session_handle"].asString().empty()) { return mAudioSession->mHandle == channelInfo["session_handle"].asString(); } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 3cc4aa113c..dbfc28c44f 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -1360,7 +1360,7 @@ bool LLWebRTCVoiceClient::isCurrentChannel(const LLSD &channelInfo) if (mSession) { - if (!channelInfo["sessionHandle"].asString().empty()) + if (!channelInfo["session_handle"].asString().empty()) { return mSession->mHandle == channelInfo["session_handle"].asString(); } -- cgit v1.2.3 From b6f4cec7d5f771df3ed5e8f0b241b2212a6e9ffa Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 4 Apr 2024 16:13:33 -0700 Subject: checkpoint p2p im decline/accept work --- indra/newview/llimview.cpp | 85 +++++++++++++++++++++++------------------- indra/newview/llvoicechannel.h | 2 + 2 files changed, 48 insertions(+), 39 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 2f2a6041ad..ff90d75ad2 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -102,8 +102,7 @@ enum EMultiAgentChatSessionType void startConferenceCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, LLUUID otherParticipantId, LLSD agents); -void startP2PCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, LLUUID otherParticipantId); -void declineP2PCoro(std::string url, LLUUID sessionID); +void startP2PVoiceCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, LLUUID otherParticipantId); void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvitationType invitationType); void chatterBoxHistoryCoro(std::string url, LLUUID sessionId, std::string from, std::string message, U32 timestamp); @@ -457,14 +456,14 @@ void startConferenceCoro(std::string url, } } -void startP2PCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID otherParticipantId) +void startP2PVoiceCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID otherParticipantId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceChatStart", httpPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("StartP2PVoiceCoro", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLSD postData; - postData["method"] = "start p2p"; + postData["method"] = "start p2p voice"; postData["session-id"] = sessionID; postData["params"] = otherParticipantId; LLSD altParams; @@ -489,27 +488,6 @@ void startP2PCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID ot } } -void declineP2PCoro(std::string url, LLUUID sessionID) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceChatStart", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - - LLSD postData; - postData["method"] = "decline p2p"; - postData["session-id"] = sessionID; - - LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - LL_WARNS("LLIMModel") << "Failed to decline p2p session:" << postData << "->" << result << LL_ENDL; - } -} - void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvitationType invitationType) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -2147,7 +2125,7 @@ bool LLIMModel::sendStartSession( if (region) { std::string url = region->getCapability("ChatSessionRequest"); - LLCoros::instance().launch("startP2P", boost::bind(&startP2PCoro, url, temp_session_id, gAgent.getID(), other_participant_id)); + LLCoros::instance().launch("startP2PVoiceCoro", boost::bind(&startP2PVoiceCoro, url, temp_session_id, gAgent.getID(), other_participant_id)); } return true; } @@ -3027,7 +3005,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload { if (type == IM_SESSION_P2P_INVITE) { - // create a normal IM session + // decline p2p voice, either via the vivox-style call mechanism + // or via the webrtc-style "decline p2p" mechanism. LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(payload["voice_channel_info"]); if (call) { @@ -3040,24 +3019,28 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload if (region) { std::string url = region->getCapability("ChatSessionRequest"); - LLCoros::instance().launch("declineP2P", - boost::bind(&declineP2PCoro, url, session_id)); - } + LLSD data; + data["method"] = "decline p2p voice"; + data["session-id"] = session_id; + + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "P2P declined", "P2P decline failed."); + } } } else { - std::string url = gAgent.getRegion()->getCapability( - "ChatSessionRequest"); + LLViewerRegion *region = gAgent.getRegion(); + if (region) + { + std::string url = region->getCapability("ChatSessionRequest"); - LLSD data; - data["method"] = "decline invitation"; - data["session-id"] = session_id; + LLSD data; + data["method"] = "decline invitation"; + data["session-id"] = session_id; - LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, - "Invitation declined", - "Invitation decline failed."); + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "Invitation declined", "Invitation decline failed."); + } } } @@ -3607,6 +3590,30 @@ void LLIMMgr::clearPendingInvitation(const LLUUID& session_id) void LLIMMgr::processAgentListUpdates(const LLUUID& session_id, const LLSD& body) { + if (body.isMap() && body.has("agent_updates") && body["agent_updates"].isMap()) + { + LLSD::map_const_iterator update_it; + for (update_it = body["agent_updates"].beginMap(); update_it != body["agent_updates"].endMap(); ++update_it) + { + LLUUID agent_id(update_it->first); + LLSD agent_data = update_it->second; + + if (agent_data.isMap()) + { + // Is one of the participants leaving a P2P Chat? + if (agent_data.has("transition") && agent_data["transition"].asString() == "LEAVE") + { + LLVoiceChannelGroup *channelp = dynamic_cast < LLVoiceChannelGroup*>(LLVoiceChannel::getChannelByID(session_id)); + if (channelp && channelp->isP2P()) + { + endCall(session_id); + break; + } + } + } + } + } + LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); if ( im_floater ) { diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index bc22bf0df6..adc387e22d 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -147,6 +147,8 @@ public: void setChannelInfo(const LLSD &channelInfo) override; void requestChannelInfo() override; + bool isP2P() { return mIsP2P; } + protected: void setState(EState state) override; -- cgit v1.2.3 From 4ecf050439da2d16028ce3018a66424b0434005c Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sat, 6 Apr 2024 21:58:17 -0700 Subject: Tell the user the peer has declined and shut down voice channel When the server sends up a notification that a peer is not doing voice in adhoc-style p2p chat, shut down the voice call and notify the user the peer has declined. --- indra/newview/llimview.cpp | 10 +++++++--- indra/newview/llvoicewebrtc.cpp | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ff90d75ad2..f710fea3e0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3595,17 +3595,21 @@ void LLIMMgr::processAgentListUpdates(const LLUUID& session_id, const LLSD& body LLSD::map_const_iterator update_it; for (update_it = body["agent_updates"].beginMap(); update_it != body["agent_updates"].endMap(); ++update_it) { - LLUUID agent_id(update_it->first); LLSD agent_data = update_it->second; - if (agent_data.isMap()) + if (agent_data.isMap() && agent_data.has("info") && agent_data["info"].isMap()) { // Is one of the participants leaving a P2P Chat? - if (agent_data.has("transition") && agent_data["transition"].asString() == "LEAVE") + if (agent_data["info"].has("can_voice_chat") && !agent_data["info"]["can_voice_chat"].asBoolean()) { LLVoiceChannelGroup *channelp = dynamic_cast < LLVoiceChannelGroup*>(LLVoiceChannel::getChannelByID(session_id)); if (channelp && channelp->isP2P()) { + // it's an adhoc-style P2P channel, and voice is disabled / declined. notify the user + // and shut down the voice channel. + LLSD notifyArgs = LLSD::emptyMap(); + notifyArgs["VOICE_CHANNEL_NAME"] = channelp->getSessionName(); + LLNotificationsUtil::add("P2PCallDeclined", notifyArgs); endCall(session_id); break; } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index dbfc28c44f..cb01a079cc 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2368,12 +2368,14 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() if (!regionp || !regionp->capabilitiesReceived()) { LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL; + setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); return; } std::string url = regionp->getCapability("ProvisionVoiceAccountRequest"); if (url.empty()) { + setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); return; } -- cgit v1.2.3 From 34ed990fa363f3df0a9817d36ef0becdcf641e80 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 7 Apr 2024 14:13:00 -0700 Subject: Show 'decline' when peer declines p2p voice The simulator will send a chatterbox notification that voice is no longer in use for a given channel, and the viewer should take that as a case where the peer does not want voice, hence it's a decline. --- indra/llwebrtc/llwebrtc.cpp | 30 ++++++++++++++++++++++++------ indra/llwebrtc/llwebrtc_impl.h | 1 + 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 7570bb4434..57130bb734 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -26,7 +26,6 @@ #include "llwebrtc_impl.h" #include -#include #include #include "api/audio_codecs/audio_decoder_factory.h" @@ -389,7 +388,7 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) void ll_set_device_module_capture_device(rtc::scoped_refptr device_module, int16_t device) { device_module->StopRecording(); -#if LL_WINDOWS +#if WEBRTC_WIN if (device < 0) { device_module->SetRecordingDevice(webrtc::AudioDeviceModule::kDefaultDevice); @@ -442,7 +441,7 @@ void LLWebRTCImpl::setCaptureDevice(const std::string &id) void ll_set_device_module_render_device(rtc::scoped_refptr device_module, int16_t device) { device_module->StopPlayout(); -#if LL_WINDOWS +#if WEBRTC_WIN if (device < 0) { device_module->SetPlayoutDevice(webrtc::AudioDeviceModule::kDefaultDevice); @@ -501,10 +500,10 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) // updateDevices needs to happen on the worker thread. void LLWebRTCImpl::updateDevices() { - int16_t renderDeviceCount = mTuningDeviceModule->PlayoutDevices(); + int16_t renderDeviceCount = mTuningDeviceModule->PlayoutDevices(); mPlayoutDeviceList.clear(); -#if LL_WINDOWS +#if WEBRTC_WIN int16_t index = 0; #else // index zero is always "Default" for darwin/linux, @@ -516,13 +515,23 @@ void LLWebRTCImpl::updateDevices() char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; mTuningDeviceModule->PlayoutDeviceName(index, name, guid); + +#if WEBRTC_LINUX + // Linux audio implementation (pulse and alsa) + // return empty strings for the guid, so + // use the name for the guid + if (!strcmp(guid, "")) + { + strcpy(guid, name); + } +#endif // WEBRTC_LINUX mPlayoutDeviceList.emplace_back(name, guid); } int16_t captureDeviceCount = mTuningDeviceModule->RecordingDevices(); mRecordingDeviceList.clear(); -#if LL_WINDOWS +#if WEBRTC_WIN index = 0; #else // index zero is always "Default" for darwin/linux, @@ -534,6 +543,15 @@ void LLWebRTCImpl::updateDevices() char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; mTuningDeviceModule->RecordingDeviceName(index, name, guid); +#if WEBRTC_LINUX + // Linux audio implementation (pulse and alsa) + // return empty strings for the guid, so + // use the name for the guid + if (!strcmp(guid, "")) + { + strcpy(guid, name); + } +#endif // WEBRTC_LINUX mRecordingDeviceList.emplace_back(name, guid); } diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index 78ae6b4444..e1031099c7 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -35,6 +35,7 @@ #define WEBRTC_POSIX 1 #elif __linux__ #define WEBRTC_LINUX 1 +#define WEBRTC_POSIX 1 #endif #include "llwebrtc.h" -- cgit v1.2.3 From 4be63d8c1f56fb6d00f13b9a2d84f2d58e170344 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 7 Apr 2024 14:16:07 -0700 Subject: missed a file --- indra/newview/llimview.cpp | 58 +++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 26 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f710fea3e0..f01fde08d9 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2727,7 +2727,7 @@ LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : void LLIncomingCallDialog::onLifetimeExpired() { - LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(mPayload["voice_session_info"]); + LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(mPayload["voice_channel_info"]); if (call) { // restart notification's timer if call is still valid @@ -3590,33 +3590,39 @@ void LLIMMgr::clearPendingInvitation(const LLUUID& session_id) void LLIMMgr::processAgentListUpdates(const LLUUID& session_id, const LLSD& body) { - if (body.isMap() && body.has("agent_updates") && body["agent_updates"].isMap()) - { - LLSD::map_const_iterator update_it; - for (update_it = body["agent_updates"].beginMap(); update_it != body["agent_updates"].endMap(); ++update_it) - { - LLSD agent_data = update_it->second; + if (body.isMap() && body.has("agent_updates") && body["agent_updates"].isMap()) + { + LLSD::map_const_iterator update_it; + for (update_it = body["agent_updates"].beginMap(); update_it != body["agent_updates"].endMap(); ++update_it) + { + LLUUID agent_id = LLUUID(update_it->first); + LLSD agent_data = update_it->second; + if (agent_data.has("transition") && agent_data["transition"].asString() == "LEAVE") + { + // ignore actual leaves as those will be handled separately. + continue; + } - if (agent_data.isMap() && agent_data.has("info") && agent_data["info"].isMap()) - { - // Is one of the participants leaving a P2P Chat? - if (agent_data["info"].has("can_voice_chat") && !agent_data["info"]["can_voice_chat"].asBoolean()) - { - LLVoiceChannelGroup *channelp = dynamic_cast < LLVoiceChannelGroup*>(LLVoiceChannel::getChannelByID(session_id)); - if (channelp && channelp->isP2P()) - { - // it's an adhoc-style P2P channel, and voice is disabled / declined. notify the user + if (agent_id != gAgentID && agent_data.isMap() && agent_data.has("info") && agent_data["info"].isMap()) + { + // Is one of the participants leaving a P2P Chat? + if (agent_data["info"].has("can_voice_chat") && !agent_data["info"]["can_voice_chat"].asBoolean()) + { + LLVoiceChannelGroup *channelp = dynamic_cast < LLVoiceChannelGroup*>(LLVoiceChannel::getChannelByID(session_id)); + if (channelp && channelp->isP2P()) + { + // it's an adhoc-style P2P channel, and the peer has declined voice. notify the user // and shut down the voice channel. - LLSD notifyArgs = LLSD::emptyMap(); - notifyArgs["VOICE_CHANNEL_NAME"] = channelp->getSessionName(); - LLNotificationsUtil::add("P2PCallDeclined", notifyArgs); - endCall(session_id); - break; - } - } - } - } - } + LLSD notifyArgs = LLSD::emptyMap(); + notifyArgs["VOICE_CHANNEL_NAME"] = channelp->getSessionName(); + LLNotificationsUtil::add("P2PCallDeclined", notifyArgs); + endCall(session_id); + break; + } + } + } + } + } LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); if ( im_floater ) -- cgit v1.2.3 From 648741470f67120d99aec3a4aeceeaf4395cca09 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 7 Apr 2024 19:23:00 -0700 Subject: CR suggestions --- indra/llwebrtc/llwebrtc.cpp | 19 ------------------ indra/llwebrtc/llwebrtc.h | 7 ++++++- indra/newview/llimview.cpp | 48 ++++++++++++++++++++++----------------------- 3 files changed, 30 insertions(+), 44 deletions(-) (limited to 'indra') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 57130bb734..eb9bb65e67 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -515,16 +515,6 @@ void LLWebRTCImpl::updateDevices() char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; mTuningDeviceModule->PlayoutDeviceName(index, name, guid); - -#if WEBRTC_LINUX - // Linux audio implementation (pulse and alsa) - // return empty strings for the guid, so - // use the name for the guid - if (!strcmp(guid, "")) - { - strcpy(guid, name); - } -#endif // WEBRTC_LINUX mPlayoutDeviceList.emplace_back(name, guid); } @@ -543,15 +533,6 @@ void LLWebRTCImpl::updateDevices() char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; mTuningDeviceModule->RecordingDeviceName(index, name, guid); -#if WEBRTC_LINUX - // Linux audio implementation (pulse and alsa) - // return empty strings for the guid, so - // use the name for the guid - if (!strcmp(guid, "")) - { - strcpy(guid, name); - } -#endif // WEBRTC_LINUX mRecordingDeviceList.emplace_back(name, guid); } diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h index 8830799cde..ac71e0c744 100644 --- a/indra/llwebrtc/llwebrtc.h +++ b/indra/llwebrtc/llwebrtc.h @@ -78,7 +78,12 @@ class LLWebRTCVoiceDevice LLWebRTCVoiceDevice(const std::string &display_name, const std::string &id) : mDisplayName(display_name), mID(id) - {}; + { + if (mID.empty()) + { + mID = display_name; + } + }; }; typedef std::vector LLWebRTCVoiceDeviceList; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f01fde08d9..9c8fcd3283 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3005,42 +3005,42 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload { if (type == IM_SESSION_P2P_INVITE) { - // decline p2p voice, either via the vivox-style call mechanism + // decline p2p voice, either via the vivox-style call mechanism // or via the webrtc-style "decline p2p" mechanism. - LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(payload["voice_channel_info"]); - if (call) - { - call->declineInvite(); - } + LLVoiceP2PIncomingCallInterfacePtr call = LLVoiceClient::getInstance()->getIncomingCallInterface(payload["voice_channel_info"]); + if (call) + { + call->declineInvite(); + } else { // webrtc-style decline. - LLViewerRegion *region = gAgent.getRegion(); - if (region) - { - std::string url = region->getCapability("ChatSessionRequest"); + LLViewerRegion *region = gAgent.getRegion(); + if (region) + { + std::string url = region->getCapability("ChatSessionRequest"); - LLSD data; - data["method"] = "decline p2p voice"; - data["session-id"] = session_id; + LLSD data; + data["method"] = "decline p2p voice"; + data["session-id"] = session_id; - LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "P2P declined", "P2P decline failed."); - } + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "P2P declined", "P2P decline failed."); + } } } else { - LLViewerRegion *region = gAgent.getRegion(); - if (region) - { - std::string url = region->getCapability("ChatSessionRequest"); + LLViewerRegion *region = gAgent.getRegion(); + if (region) + { + std::string url = region->getCapability("ChatSessionRequest"); - LLSD data; - data["method"] = "decline invitation"; - data["session-id"] = session_id; + LLSD data; + data["method"] = "decline invitation"; + data["session-id"] = session_id; - LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "Invitation declined", "Invitation decline failed."); - } + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, data, "Invitation declined", "Invitation decline failed."); + } } } -- cgit v1.2.3