summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-07-26 19:28:40 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-30 07:31:05 +0300
commitf75735d7416b8217a93ffd3ed95c6289f5ff0c68 (patch)
treeaca716d2ce7a241c7dd447337e1189d60e5dbf65 /indra
parent7b119c01e0c179bac3dfe8b8c8ee05016099c9aa (diff)
viewer-private#255 p2p outgoing calls did not work correctly #2
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoicechannel.cpp14
-rw-r--r--indra/newview/llvoiceclient.cpp18
-rw-r--r--indra/newview/llvoiceclient.h6
-rw-r--r--indra/newview/llvoicevivox.cpp12
-rw-r--r--indra/newview/llvoicevivox.h5
-rw-r--r--indra/newview/llvoicewebrtc.cpp7
-rw-r--r--indra/newview/llvoicewebrtc.h4
7 files changed, 45 insertions, 21 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 29817ab03a..5a9c0d103f 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -122,13 +122,7 @@ void LLVoiceChannel::onChange(EStatusType type, const LLSD& channelInfo, bool pr
{
LL_DEBUGS("Voice") << "Incoming channel info: " << channelInfo << LL_ENDL;
LL_DEBUGS("Voice") << "Current channel info: " << mChannelInfo << LL_ENDL;
- if (mChannelInfo.has("channel_uri")
- && (!channelInfo.has("channel_uri") || mChannelInfo["channel_uri"] != channelInfo["channel_uri"]))
- {
- return;
- }
- if (mChannelInfo.isUndefined()
- || (mChannelInfo.isMap() && mChannelInfo.size() <= 1)) // p2p will have uri beforehand
+ if (mChannelInfo.isUndefined() || (mChannelInfo.isMap() && mChannelInfo.size() == 0))
{
mChannelInfo = channelInfo;
}
@@ -774,11 +768,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID &session_id,
mReceivedCall(FALSE),
mOutgoingCallInterface(outgoing_call_interface)
{
- std::string sip_uri = LLVoiceClient::getInstance()->sipURIFromID(other_user_id);
- if (!sip_uri.empty())
- {
- mChannelInfo["channel_uri"] = sip_uri;
- }
+ mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(other_user_id);
}
void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index c20a5ec749..0cf4a64c3d 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -826,7 +826,7 @@ void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
}
-std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const
{
if (mNonSpatialVoiceModule)
{
@@ -842,6 +842,22 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
}
}
+LLSD LLVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ if (mNonSpatialVoiceModule)
+ {
+ return mNonSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else if (mSpatialVoiceModule)
+ {
+ return mSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else
+ {
+ return LLSD();
+ }
+}
+
LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const
{
return NULL;
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index d603125759..c8a65378c6 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -281,7 +281,8 @@ public:
virtual void removeObserver(LLVoiceClientParticipantObserver* observer)=0;
//@}
- virtual std::string sipURIFromID(const LLUUID &id)=0;
+ virtual std::string sipURIFromID(const LLUUID &id) const=0;
+ virtual LLSD getP2PChannelInfoTemplate(const LLUUID& id) const=0;
//@}
};
@@ -488,7 +489,8 @@ public:
void addObserver(LLVoiceClientParticipantObserver* observer);
void removeObserver(LLVoiceClientParticipantObserver* observer);
- std::string sipURIFromID(const LLUUID &id);
+ std::string sipURIFromID(const LLUUID &id) const;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const;
//////////////////////////
/// @name Voice effects
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 9215160202..3392e4de86 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -5138,7 +5138,7 @@ bool LLVivoxVoiceClient::inProximalChannel()
return result;
}
-std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) const
{
std::string result;
result = "sip:";
@@ -5149,6 +5149,14 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
return result;
}
+LLSD LLVivoxVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ LLSD result;
+ result["channel_uri"] = sipURIFromID(id);
+ result["voice_server_type"] = VIVOX_VOICE_SERVER_TYPE;
+ return result;
+}
+
std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
{
std::string result;
@@ -5163,7 +5171,7 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
return result;
}
-std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
+std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) const
{
std::string result;
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 12e3d11eef..64c2c87db6 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -221,7 +221,8 @@ public:
void removeObserver(LLVoiceClientParticipantObserver* observer) override;
//@}
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
//@}
/// @name LLVoiceEffectInterface virtual implementations
@@ -747,7 +748,7 @@ private:
bool switchChannel(std::string uri = std::string(), bool spatial = true, bool no_reconnect = false, bool is_p2p = false, std::string hash = "");
void joinSession(const sessionStatePtr_t &session);
- std::string nameFromID(const LLUUID &id);
+ std::string nameFromID(const LLUUID &id) const;
bool IDFromName(const std::string name, LLUUID &uuid);
std::string sipURIFromAvatar(LLVOAvatar *avatar);
std::string sipURIFromName(std::string &name);
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 36e998af89..c6cc2a053a 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2066,11 +2066,16 @@ void LLWebRTCVoiceClient::avatarNameResolved(const LLUUID &id, const std::string
}
// Leftover from vivox PTSN
-std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id)
+std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id) const
{
return id.asString();
}
+LLSD LLWebRTCVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ return LLSD();
+}
+
/////////////////////////////
// LLVoiceWebRTCConnection
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 7042bbae00..624b1b9bd2 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -84,7 +84,9 @@ public:
// Returns true if WebRTC has successfully logged in and is not in error state
bool isVoiceWorking() const override;
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
+
/////////////////////
/// @name Tuning