summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-03-10 00:11:43 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-03-10 00:11:43 -0800
commitfc462b2b0f7ee153626d162bd97a05110f0804b7 (patch)
treefcedcd57f5c35115f6c3fccb009d87166c99aa95 /indra/newview/llvoicevivox.cpp
parent7714850fbe2ad4c2dc914798971d82cbb82f7832 (diff)
Remove trailing spaces. Other code cleanup.
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp1002
1 files changed, 493 insertions, 509 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 1454342083..9a1fb925eb 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1,25 +1,25 @@
- /**
+ /**
* @file LLVivoxVoiceClient.cpp
* @brief Implementation of LLVivoxVoiceClient class which is the interface to the voice client process.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -96,7 +96,7 @@ namespace {
// Don't send positional updates more frequently than this:
const F32 UPDATE_THROTTLE_SECONDS = 0.5f;
- // Timeout for connection to Vivox
+ // Timeout for connection to Vivox
const F32 CONNECT_ATTEMPT_TIMEOUT = 300.0f;
const F32 CONNECT_DNS_TIMEOUT = 5.0f;
const int CONNECT_RETRY_MAX = 3;
@@ -115,8 +115,8 @@ namespace {
const F32 SESSION_JOIN_TIMEOUT = 30.0f;
// Defines the maximum number of times(in a row) "stateJoiningSession" case for spatial channel is reached in stateMachine()
- // which is treated as normal. The is the number of frames to wait for a channel join before giving up. This was changed
- // from the original count of 50 for two reason. Modern PCs have higher frame rates and sometimes the SLVoice process
+ // which is treated as normal. The is the number of frames to wait for a channel join before giving up. This was changed
+ // from the original count of 50 for two reason. Modern PCs have higher frame rates and sometimes the SLVoice process
// backs up processing join requests. There is a log statement that records when channel joins take longer than 100 frames.
const int MAX_NORMAL_JOINING_SPATIAL_NUM = 1500;
@@ -135,17 +135,17 @@ namespace {
static int scale_mic_volume(float volume)
{
- // incoming volume has the range [0.0 ... 2.0], with 1.0 as the default.
- // Map it to Vivox levels as follows: 0.0 -> 30, 1.0 -> 50, 2.0 -> 70
+ // incoming volume has the range [0.0 ... 2.0], with 1.0 as the default.
+ // Map it to Vivox levels as follows: 0.0 -> 30, 1.0 -> 50, 2.0 -> 70
return 30 + (int)(volume * 20.0f);
}
static int scale_speaker_volume(float volume)
{
- // incoming volume has the range [0.0 ... 1.0], with 0.5 as the default.
- // Map it to Vivox levels as follows: 0.0 -> 30, 0.5 -> 50, 1.0 -> 70
+ // incoming volume has the range [0.0 ... 1.0], with 0.5 as the default.
+ // Map it to Vivox levels as follows: 0.0 -> 30, 0.5 -> 50, 1.0 -> 70
return 30 + (int)(volume * 40.0f);
-
+
}
@@ -364,18 +364,18 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mVoiceVersion.minorVersion = 0;
mVoiceVersion.mBuildVersion = "";
mVoiceVersion.serverVersion = "";
-
+
// gMuteListp isn't set up at this point, so we defer this until later.
// gMuteListp->addObserver(&mutelist_listener);
-
+
#if LL_DARWIN || LL_LINUX
// HACK: THIS DOES NOT BELONG HERE
// When the vivox daemon dies, the next write attempt on our socket generates a SIGPIPE, which kills us.
// This should cause us to ignore SIGPIPE and handle the error through proper channels.
// This should really be set up elsewhere. Where should it go?
signal(SIGPIPE, SIG_IGN);
-
+
// Since we're now launching the gateway with fork/exec instead of system(), we need to deal with zombie processes.
// Ignoring SIGCHLD should prevent zombies from being created. Alternately, we could use wait(), but I'd rather not do that.
signal(SIGCHLD, SIG_IGN);
@@ -415,13 +415,13 @@ void LLVivoxVoiceClient::terminate()
return;
}
- // needs to be done manually here since we will not get another pass in
+ // needs to be done manually here since we will not get another pass in
// coroutines... that mechanism is long since gone.
if (mIsLoggedIn)
{
logoutOfVivox(false);
}
-
+
if(sConnected)
{
breakVoiceConnection(false);
@@ -442,7 +442,7 @@ void LLVivoxVoiceClient::terminate()
void LLVivoxVoiceClient::cleanUp()
{
LL_DEBUGS("Voice") << LL_ENDL;
-
+
deleteAllSessions();
deleteAllVoiceFonts();
deleteVoiceFontTemplates();
@@ -484,7 +484,7 @@ bool LLVivoxVoiceClient::writeString(const std::string &str)
apr_status_t err;
apr_size_t size = (apr_size_t)str.size();
apr_size_t written = size;
-
+
//MARK: Turn this on to log outgoing XML
// LL_DEBUGS("Voice") << "sending: " << str << LL_ENDL;
@@ -493,7 +493,7 @@ bool LLVivoxVoiceClient::writeString(const std::string &str)
mSocket->getSocket(),
(const char*)str.data(),
&written);
-
+
if(err == 0 && written == size)
{
// Success.
@@ -516,7 +516,7 @@ bool LLVivoxVoiceClient::writeString(const std::string &str)
daemonDied();
}
}
-
+
return result;
}
@@ -527,7 +527,7 @@ void LLVivoxVoiceClient::connectorCreate()
{
std::ostringstream stream;
std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
-
+
// Transition to stateConnectorStarted when the connector handle comes back.
std::string vivoxLogLevel = gSavedSettings.getString("VivoxDebugLevel");
if ( vivoxLogLevel.empty() )
@@ -535,8 +535,8 @@ void LLVivoxVoiceClient::connectorCreate()
vivoxLogLevel = "0";
}
LL_DEBUGS("Voice") << "creating connector with log level " << vivoxLogLevel << LL_ENDL;
-
- stream
+
+ stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Connector.Create.1\">"
<< "<ClientName>V2 SDK</ClientName>"
<< "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>"
@@ -552,7 +552,7 @@ void LLVivoxVoiceClient::connectorCreate()
//<< "<Application></Application>" //Name can cause problems per vivox.
<< "<MaxCalls>12</MaxCalls>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
@@ -566,10 +566,10 @@ void LLVivoxVoiceClient::connectorShutdown()
<< "<ConnectorHandle>" << LLVivoxSecurity::getInstance()->connectorHandle() << "</ConnectorHandle>"
<< "</Request>"
<< "\n\n\n";
-
+
mShutdownComplete = false;
mConnectorEstablished = false;
-
+
writeString(stream.str());
}
else
@@ -601,7 +601,7 @@ void LLVivoxVoiceClient::setLoginInfo(
{
// Already logged in.
LL_WARNS("Voice") << "Called while already logged in." << LL_ENDL;
-
+
// Don't process another login.
return;
}
@@ -616,14 +616,14 @@ void LLVivoxVoiceClient::setLoginInfo(
}
std::string debugSIPURIHostName = gSavedSettings.getString("VivoxDebugSIPURIHostName");
-
+
if( !debugSIPURIHostName.empty() )
{
LL_INFOS("Voice") << "Overriding account server based on VivoxDebugSIPURIHostName: "
<< debugSIPURIHostName << LL_ENDL;
mVoiceSIPURIHostName = debugSIPURIHostName;
}
-
+
if( mVoiceSIPURIHostName.empty() )
{
// we have an empty account server name
@@ -643,7 +643,7 @@ void LLVivoxVoiceClient::setLoginInfo(
<< mVoiceSIPURIHostName << LL_ENDL;
}
-
+
std::string debugAccountServerURI = gSavedSettings.getString("VivoxDebugVoiceAccountServerURI");
if( !debugAccountServerURI.empty() )
@@ -652,11 +652,11 @@ void LLVivoxVoiceClient::setLoginInfo(
<< debugAccountServerURI << LL_ENDL;
mVoiceAccountServerURI = debugAccountServerURI;
}
-
+
if( mVoiceAccountServerURI.empty() )
{
// If the account server URI isn't specified, construct it from the SIP URI hostname
- mVoiceAccountServerURI = "https://www." + mVoiceSIPURIHostName + "/api2/";
+ mVoiceAccountServerURI = "https://www." + mVoiceSIPURIHostName + "/api2/";
LL_INFOS("Voice") << "Inferring account server based on SIP URI Host name: "
<< mVoiceAccountServerURI << LL_ENDL;
}
@@ -667,11 +667,11 @@ void LLVivoxVoiceClient::idle(void* user_data)
}
//=========================================================================
-// the following are methods to support the coroutine implementation of the
-// voice connection and processing. They should only be called in the context
+// the following are methods to support the coroutine implementation of the
+// voice connection and processing. They should only be called in the context
// of a coroutine.
-//
-//
+//
+//
typedef enum e_voice_control_coro_state
{
@@ -820,7 +820,7 @@ void LLVivoxVoiceClient::voiceControlStateMachine(S32 &coro_state)
case VOICE_STATE_SESSION_ESTABLISHED:
{
- // enable/disable the automatic VAD and explicitly set the initial values of
+ // enable/disable the automatic VAD and explicitly set the initial values of
// the VAD variables ourselves when it is off - see SL-15072 for more details
// note: we set the other parameters too even if the auto VAD is on which is ok
unsigned int vad_auto = gSavedSettings.getU32("VivoxVadAuto");
@@ -995,7 +995,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
{
LLFile::rename(new_log, old_log);
}
-
+
std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout");
if (!shutdown_timeout.empty())
{
@@ -1076,7 +1076,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
llcoro::suspendUntilTimeout(DAEMON_CONNECT_THROTTLE_SECONDS);
}
}
-
+
//---------------------------------------------------------------------
if (sShuttingDown && !sConnected)
{
@@ -1094,7 +1094,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
{
return false;
}
-
+
// MBW -- Note to self: pumps and pipes examples in
// indra/test/io.cpp
// indra/test/llpipeutil.{cpp|h}
@@ -1132,7 +1132,7 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
// *TODO* Pump a message for wake up.
llcoro::suspend();
}
-
+
if (sShuttingDown)
{
return false;
@@ -1184,7 +1184,7 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
else
{
provisioned = true;
- }
+ }
} while (!provisioned && ++retryCount <= PROVISION_RETRY_MAX && !sShuttingDown);
if (sShuttingDown && !provisioned)
@@ -1208,7 +1208,7 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
{
voiceSipUriHostname = result["voice_sip_uri_hostname"].asString();
}
-
+
// this key is actually misnamed -- it will be an entire URI, not just a hostname.
if (result.has("voice_account_server_name"))
{
@@ -1239,7 +1239,7 @@ bool LLVivoxVoiceClient::establishVoiceConnection()
{
return false;
}
-
+
LLSD result;
bool connected(false);
bool giving_up(false);
@@ -1358,7 +1358,7 @@ bool LLVivoxVoiceClient::loginToVivox()
bool account_login(false);
bool send_login(true);
- do
+ do
{
mIsLoggingIn = true;
if (send_login)
@@ -1366,7 +1366,7 @@ bool LLVivoxVoiceClient::loginToVivox()
loginSendMessage();
send_login = false;
}
-
+
LLSD result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, LOGIN_ATTEMPT_TIMEOUT, timeoutResult);
if (sShuttingDown)
@@ -1406,7 +1406,7 @@ bool LLVivoxVoiceClient::loginToVivox()
// tell the user there is a problem
LL_WARNS("Voice") << "login " << loginresp << " will retry login in " << timeout << " seconds." << LL_ENDL;
-
+
if (!sShuttingDown)
{
// Todo: this is way to long, viewer can get stuck waiting during shutdown
@@ -1511,7 +1511,7 @@ bool LLVivoxVoiceClient::retrieveVoiceFonts()
mIsWaitingForFonts = true;
LLSD result;
- do
+ do
{
result = llcoro::suspendUntilEventOn(mVivoxPump);
@@ -1546,7 +1546,7 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo()
LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest capability not available in this region" << LL_ENDL;
return false;
}
-
+
// update the parcel
checkParcelChanged(true);
@@ -1606,7 +1606,7 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo()
}
}
- // set the spatial channel. If no voice credentials or uri are
+ // set the spatial channel. If no voice credentials or uri are
// available, then we simply drop out of voice spatially.
return setSpatialChannel(result["voice_credentials"]);
}
@@ -1661,7 +1661,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED);
LL_WARNS() << "There seems to be problem with connection to voice server. Disabling voice chat abilities." << LL_ENDL;
}
-
+
// Increase mSpatialJoiningNum only for spatial sessions- it's normal to reach this case for
// example for p2p many times while waiting for response, so it can't be used to detect errors
if (mAudioSession && mAudioSession->mIsSpatial)
@@ -1703,8 +1703,8 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LLSD timeoutResult(LLSDMap("session", "timeout"));
- // We are about to start a whole new session. Anything that MIGHT still be in our
- // maildrop is going to be stale and cause us much wailing and gnashing of teeth.
+ // We are about to start a whole new session. Anything that MIGHT still be in our
+ // maildrop is going to be stale and cause us much wailing and gnashing of teeth.
// Just flush it all out and start new.
mVivoxPump.discard();
@@ -1747,25 +1747,25 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
}
else if ((message == "failed") || (message == "removed") || (message == "timeout"))
{ // we will get a removed message if a voice call is declined.
-
- if (message == "failed")
+
+ if (message == "failed")
{
int reason = result["reason"].asInteger();
LL_WARNS("Voice") << "Add and join failed for reason " << reason << LL_ENDL;
-
+
if ( (reason == ERROR_VIVOX_NOT_LOGGED_IN)
|| (reason == ERROR_VIVOX_OBJECT_NOT_FOUND))
{
LL_DEBUGS("Voice") << "Requesting reprovision and login." << LL_ENDL;
requestRelog();
- }
+ }
}
else
{
LL_WARNS("Voice") << "session '" << message << "' "
<< LL_ENDL;
}
-
+
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
mIsJoiningSession = false;
return false;
@@ -1784,8 +1784,8 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
// Events that need to happen when a session is joined could go here.
// send an initial positional information immediately upon joining.
- //
- // do an initial update for position and the camera position, then send a
+ //
+ // do an initial update for position and the camera position, then send a
// positional update.
updatePosition();
enforceTether();
@@ -1892,7 +1892,7 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
// Always reset the terminate request flag when we get here.
- // Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves
+ // Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves
// the region chat.
mSessionTerminateRequested = false;
@@ -1927,7 +1927,7 @@ bool LLVivoxVoiceClient::waitForChannel()
EVoiceWaitForChannelState state = VOICE_CHANNEL_STATE_LOGIN;
- do
+ do
{
if (sShuttingDown)
{
@@ -2117,10 +2117,10 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
LL_DEBUGS("Voice") << "runSession terminate requested " << LL_ENDL;
terminateAudioSession(true);
}
- // if a relog has been requested then addAndJoineSession
+ // if a relog has been requested then addAndJoineSession
// failed in a spectacular way and we need to back out.
// If this is not the case then we were simply trying to
- // make a call and the other party rejected it.
+ // make a call and the other party rejected it.
return !mRelogRequested;
}
@@ -2156,7 +2156,7 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
mAudioSession->mParticipantsChanged = false;
notifyParticipantObservers();
}
-
+
if (!inSpatialChannel())
{
// When in a non-spatial channel, never send positional updates.
@@ -2168,9 +2168,9 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
if (checkParcelChanged())
{
- // *RIDER: I think I can just return here if the parcel has changed
+ // *RIDER: I think I can just return here if the parcel has changed
// and grab the new voice channel from the outside loop.
- //
+ //
// if the parcel has changed, attempted to request the
// cap for the parcel voice info. If we can't request it
// then we don't have the cap URL so we do nothing and will
@@ -2213,7 +2213,7 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
LL_DEBUGS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL;
}
if (result.has("session"))
- {
+ {
if (result.has("handle"))
{
if (!mAudioSession)
@@ -2318,7 +2318,7 @@ void LLVivoxVoiceClient::recordingAndPlaybackMode()
int LLVivoxVoiceClient::voiceRecordBuffer()
{
- LLSD timeoutResult(LLSDMap("recplay", "stop"));
+ LLSD timeoutResult(LLSDMap("recplay", "stop"));
LL_INFOS("Voice") << "Recording voice buffer" << LL_ENDL;
@@ -2441,7 +2441,7 @@ void LLVivoxVoiceClient::logout()
// Ensure that we'll re-request provisioning before logging in again
mAccountPassword.clear();
mVoiceAccountServerURI.clear();
-
+
logoutSendMessage();
}
@@ -2466,7 +2466,7 @@ void LLVivoxVoiceClient::logoutSendMessage()
void LLVivoxVoiceClient::sessionGroupCreateSendMessage()
{
if(mAccountLoggedIn)
- {
+ {
std::ostringstream stream;
LL_DEBUGS("Voice") << "creating session group" << LL_ENDL;
@@ -2535,7 +2535,7 @@ void LLVivoxVoiceClient::sessionGroupAddSessionSendMessage(const sessionStatePtr
{
session->mMediaConnectInProgress = true;
}
-
+
std::string password;
if(!session->mHash.empty())
{
@@ -2560,7 +2560,7 @@ void LLVivoxVoiceClient::sessionGroupAddSessionSendMessage(const sessionStatePtr
<< "<PasswordHashAlgorithm>SHA1UserName</PasswordHashAlgorithm>"
<< "</Request>\n\n\n"
;
-
+
writeString(stream.str());
}
@@ -2572,7 +2572,7 @@ void LLVivoxVoiceClient::sessionMediaConnectSendMessage(const sessionStatePtr_t
<< LL_ENDL;
session->mMediaConnectInProgress = true;
-
+
std::ostringstream stream;
stream
@@ -2589,7 +2589,7 @@ void LLVivoxVoiceClient::sessionMediaConnectSendMessage(const sessionStatePtr_t
void LLVivoxVoiceClient::sessionTextConnectSendMessage(const sessionStatePtr_t &session)
{
LL_DEBUGS("Voice") << "connecting text to session handle: " << session->mHandle << LL_ENDL;
-
+
std::ostringstream stream;
stream
@@ -2630,7 +2630,7 @@ void LLVivoxVoiceClient::leaveAudioSession()
time_t now = time(NULL);
const size_t BUF_SIZE = 64;
char time_str[BUF_SIZE]; /* Flawfinder: ignore */
-
+
strftime(time_str, BUF_SIZE, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now));
savepath += time_str;
}
@@ -2641,7 +2641,7 @@ void LLVivoxVoiceClient::leaveAudioSession()
}
else
{
- LL_WARNS("Voice") << "called with no session handle" << LL_ENDL;
+ LL_WARNS("Voice") << "called with no session handle" << LL_ENDL;
}
}
else
@@ -2658,12 +2658,12 @@ void LLVivoxVoiceClient::sessionTerminateSendMessage(const sessionStatePtr_t &se
sessionGroupTerminateSendMessage(session);
return;
/*
- LL_DEBUGS("Voice") << "Sending Session.Terminate with handle " << session->mHandle << LL_ENDL;
+ LL_DEBUGS("Voice") << "Sending Session.Terminate with handle " << session->mHandle << LL_ENDL;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Session.Terminate.1\">"
<< "<SessionHandle>" << session->mHandle << "</SessionHandle>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
*/
}
@@ -2671,13 +2671,13 @@ void LLVivoxVoiceClient::sessionTerminateSendMessage(const sessionStatePtr_t &se
void LLVivoxVoiceClient::sessionGroupTerminateSendMessage(const sessionStatePtr_t &session)
{
std::ostringstream stream;
-
- LL_DEBUGS("Voice") << "Sending SessionGroup.Terminate with handle " << session->mGroupHandle << LL_ENDL;
+
+ LL_DEBUGS("Voice") << "Sending SessionGroup.Terminate with handle " << session->mGroupHandle << LL_ENDL;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.Terminate.1\">"
<< "<SessionGroupHandle>" << session->mGroupHandle << "</SessionGroupHandle>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
@@ -2687,17 +2687,17 @@ void LLVivoxVoiceClient::sessionMediaDisconnectSendMessage(const sessionStatePtr
sessionGroupTerminateSendMessage(session);
return;
/*
- LL_DEBUGS("Voice") << "Sending Session.MediaDisconnect with handle " << session->mHandle << LL_ENDL;
+ LL_DEBUGS("Voice") << "Sending Session.MediaDisconnect with handle " << session->mHandle << LL_ENDL;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Session.MediaDisconnect.1\">"
<< "<SessionGroupHandle>" << session->mGroupHandle << "</SessionGroupHandle>"
<< "<SessionHandle>" << session->mHandle << "</SessionHandle>"
<< "<Media>Audio</Media>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
*/
-
+
}
@@ -2707,7 +2707,7 @@ void LLVivoxVoiceClient::getCaptureDevicesSendMessage()
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.GetCaptureDevices.1\">"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
@@ -2717,7 +2717,7 @@ void LLVivoxVoiceClient::getRenderDevicesSendMessage()
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.GetRenderDevices.1\">"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
@@ -2745,7 +2745,7 @@ void LLVivoxVoiceClient::setCaptureDevice(const std::string& name)
if(!mCaptureDevice.empty())
{
mCaptureDevice.clear();
- mCaptureDeviceDirty = true;
+ mCaptureDeviceDirty = true;
}
}
else
@@ -2753,7 +2753,7 @@ void LLVivoxVoiceClient::setCaptureDevice(const std::string& name)
if(mCaptureDevice != name)
{
mCaptureDevice = name;
- mCaptureDeviceDirty = true;
+ mCaptureDeviceDirty = true;
}
}
}
@@ -2763,7 +2763,7 @@ void LLVivoxVoiceClient::setDevicesListUpdated(bool state)
}
void LLVivoxVoiceClient::clearRenderDevices()
-{
+{
LL_DEBUGS("Voice") << "called" << LL_ENDL;
mRenderDevices.clear();
}
@@ -2786,7 +2786,7 @@ void LLVivoxVoiceClient::setRenderDevice(const std::string& name)
if(!mRenderDevice.empty())
{
mRenderDevice.clear();
- mRenderDeviceDirty = true;
+ mRenderDeviceDirty = true;
}
}
else
@@ -2794,10 +2794,10 @@ void LLVivoxVoiceClient::setRenderDevice(const std::string& name)
if(mRenderDevice != name)
{
mRenderDevice = name;
- mRenderDeviceDirty = true;
+ mRenderDeviceDirty = true;
}
}
-
+
}
void LLVivoxVoiceClient::tuningStart()
@@ -2830,7 +2830,7 @@ bool LLVivoxVoiceClient::inTuningMode()
}
void LLVivoxVoiceClient::tuningRenderStartSendMessage(const std::string& name, bool loop)
-{
+{
mTuningAudioFile = name;
std::ostringstream stream;
stream
@@ -2838,7 +2838,7 @@ void LLVivoxVoiceClient::tuningRenderStartSendMessage(const std::string& name, b
<< "<SoundFilePath>" << mTuningAudioFile << "</SoundFilePath>"
<< "<Loop>" << (loop?"1":"0") << "</Loop>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
@@ -2849,33 +2849,33 @@ void LLVivoxVoiceClient::tuningRenderStopSendMessage()
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.RenderAudioStop.1\">"
<< "<SoundFilePath>" << mTuningAudioFile << "</SoundFilePath>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
void LLVivoxVoiceClient::tuningCaptureStartSendMessage(int loop)
{
LL_DEBUGS("Voice") << "sending CaptureAudioStart" << LL_ENDL;
-
+
std::ostringstream stream;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.CaptureAudioStart.1\">"
<< "<Duration>-1</Duration>"
<< "<LoopToRenderDevice>" << loop << "</LoopToRenderDevice>"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
}
void LLVivoxVoiceClient::tuningCaptureStopSendMessage()
{
LL_DEBUGS("Voice") << "sending CaptureAudioStop" << LL_ENDL;
-
+
std::ostringstream stream;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.CaptureAudioStop.1\">"
<< "</Request>\n\n\n";
-
+
writeString(stream.str());
mTuningEnergy = 0.0f;
@@ -2894,7 +2894,7 @@ void LLVivoxVoiceClient::tuningSetMicVolume(float volume)
void LLVivoxVoiceClient::tuningSetSpeakerVolume(float volume)
{
- int scaled_volume = scale_speaker_volume(volume);
+ int scaled_volume = scale_speaker_volume(volume);
if(scaled_volume != mTuningSpeakerVolume)
{
@@ -2902,7 +2902,7 @@ void LLVivoxVoiceClient::tuningSetSpeakerVolume(float volume)
mTuningSpeakerVolumeDirty = true;
}
}
-
+
float LLVivoxVoiceClient::tuningGetEnergy(void)
{
return mTuningEnergy;
@@ -2911,13 +2911,13 @@ float LLVivoxVoiceClient::tuningGetEnergy(void)
bool LLVivoxVoiceClient::deviceSettingsAvailable()
{
bool result = true;
-
+
if(!sConnected)
result = false;
-
+
if(mRenderDevices.empty())
result = false;
-
+
return result;
}
bool LLVivoxVoiceClient::deviceSettingsUpdated()
@@ -2928,7 +2928,7 @@ bool LLVivoxVoiceClient::deviceSettingsUpdated()
// a hot swap event or a polling of the audio devices has been parsed since the last redraw of the input and output device panel.
mDevicesListUpdated = false; // toggle the setting
}
- return updated;
+ return updated;
}
void LLVivoxVoiceClient::refreshDeviceLists(bool clearCurrentList)
@@ -2961,9 +2961,9 @@ void LLVivoxVoiceClient::giveUp()
static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVector3d &pos, LLVector3 &vel)
{
F32 nat[3], nup[3], nl[3]; // the new at, up, left vectors and the new position and velocity
-// F32 nvel[3];
+// F32 nvel[3];
F64 npos[3];
-
+
// The original XML command was sent like this:
/*
<< "<Position>"
@@ -3021,7 +3021,7 @@ static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVe
left.mV[i] = nl[i];
pos.mdV[i] = npos[i];
}
-
+
// This was the original transform done in the SDK
nat[0] = at.mV[2];
nat[1] = 0; // y component of at vector is always 0, this was up[2]
@@ -3075,7 +3075,7 @@ static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVe
left.mV[i] = nl[i];
pos.mdV[i] = npos[i];
}
-
+
#endif
}
@@ -3085,7 +3085,7 @@ void LLVivoxVoiceClient::setHidden(bool hidden)
if (mHidden && inSpatialChannel())
{
- // get out of the channel entirely
+ // get out of the channel entirely
leaveAudioSession();
}
else
@@ -3095,20 +3095,20 @@ void LLVivoxVoiceClient::setHidden(bool hidden)
}
void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
-{
+{
std::ostringstream stream;
-
+
if (mSpatialCoordsDirty && inSpatialChannel())
{
LLVector3 l, u, a, vel;
LLVector3d pos;
mSpatialCoordsDirty = false;
-
+
// Always send both speaker and listener positions together.
- stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Session.Set3DPosition.1\">"
+ stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Session.Set3DPosition.1\">"
<< "<SessionHandle>" << getAudioSessionHandle() << "</SessionHandle>";
-
+
stream << "<SpeakerPosition>";
LLMatrix3 avatarRot = mAvatarRot.getMatrix3();
@@ -3124,7 +3124,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
// SLIM SDK: the old SDK was doing a transform on the passed coordinates that the new one doesn't do anymore.
// The old transform is replicated by this function.
oldSDKTransform(l, u, a, pos, vel);
-
+
if (mHidden)
{
for (int i=0;i<3;++i)
@@ -3132,7 +3132,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
pos.mdV[i] = VX_NULL_POSITION;
}
}
-
+
stream
<< "<Position>"
<< "<X>" << pos.mdV[VX] << "</X>"
@@ -3160,7 +3160,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
<< "<Z>" << l.mV [VZ] << "</Z>"
<< "</LeftOrientation>"
;
-
+
stream << "</SpeakerPosition>";
stream << "<ListenerPosition>";
@@ -3168,7 +3168,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
LLVector3d earPosition;
LLVector3 earVelocity;
LLMatrix3 earRot;
-
+
switch(mEarLocation)
{
case earLocCamera:
@@ -3177,13 +3177,13 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
earVelocity = mCameraVelocity;
earRot = mCameraRot;
break;
-
+
case earLocAvatar:
earPosition = mAvatarPosition;
earVelocity = mAvatarVelocity;
earRot = avatarRot;
break;
-
+
case earLocMixed:
earPosition = mAvatarPosition;
earVelocity = mAvatarVelocity;
@@ -3198,9 +3198,9 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
pos = earPosition;
vel = earVelocity;
-
+
oldSDKTransform(l, u, a, pos, vel);
-
+
if (mHidden)
{
for (int i=0;i<3;++i)
@@ -3208,7 +3208,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
pos.mdV[i] = VX_NULL_POSITION;
}
}
-
+
stream
<< "<Position>"
<< "<X>" << pos.mdV[VX] << "</X>"
@@ -3241,19 +3241,19 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
stream << "<ReqDispositionType>1</ReqDispositionType>"; //do not generate responses for update requests
stream << "</Request>\n\n\n";
- }
-
+ }
+
if(mAudioSession && (mAudioSession->mVolumeDirty || mAudioSession->mMuteDirty))
{
participantMap::iterator iter = mAudioSession->mParticipantsByURI.begin();
mAudioSession->mVolumeDirty = false;
mAudioSession->mMuteDirty = false;
-
+
for(; iter != mAudioSession->mParticipantsByURI.end(); iter++)
{
participantStatePtr_t p(iter->second);
-
+
if(p->mVolumeDirty)
{
// Can't set volume/mute for yourself
@@ -3262,7 +3262,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
// scale from the range 0.0-1.0 to vivox volume in the range 0-100
S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX);
bool mute = p->mOnMuteList;
-
+
if(mute)
{
// SetParticipantMuteForMe doesn't work in p2p sessions.
@@ -3273,16 +3273,16 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
// changing it to 0, so that we can return to it when unmuting.
p->mVolumeSet = true;
}
-
+
if(volume == 0)
{
mute = true;
}
LL_DEBUGS("Voice") << "Setting volume/mute for avatar " << p->mAvatarID << " to " << volume << (mute?"/true":"/false") << LL_ENDL;
-
+
// SLIM SDK: Send both volume and mute commands.
-
+
// Send a "volume for me" command for the user.
stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Session.SetParticipantVolumeForMe.1\">"
<< "<SessionHandle>" << getAudioSessionHandle() << "</SessionHandle>"
@@ -3302,7 +3302,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
<< "</Request>\n\n\n";
}
}
-
+
p->mVolumeDirty = false;
}
}
@@ -3322,13 +3322,13 @@ void LLVivoxVoiceClient::buildSetCaptureDevice(std::ostringstream &stream)
if(mCaptureDeviceDirty)
{
LL_DEBUGS("Voice") << "Setting input device = \"" << mCaptureDevice << "\"" << LL_ENDL;
-
- stream
+
+ stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.SetCaptureDevice.1\">"
<< "<CaptureDeviceSpecifier>" << mCaptureDevice << "</CaptureDeviceSpecifier>"
<< "</Request>"
<< "\n\n\n";
-
+
mCaptureDeviceDirty = false;
}
}
@@ -3420,7 +3420,7 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates()
* Because of the recurring voice cutout issues (SL-15072) we are going to try
* to disable the automatic VAD (Voice Activity Detection) and set the associated
* parameters directly. We will expose them via Debug Settings and that should
- * let us iterate on a collection of values that work for us. Hopefully!
+ * let us iterate on a collection of values that work for us. Hopefully!
*
* From the VIVOX Docs:
*
@@ -3430,16 +3430,16 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates()
* for the VAD to switch back to silence from speech mode after the last speech
* frame has been detected.
*
- * VadNoiseFloor: A dimensionless value between 0 and
+ * VadNoiseFloor: A dimensionless value between 0 and
* 20000 (default 576) that controls the maximum level at which the noise floor
* may be set at by the VAD's noise tracking. Too low of a value will make noise
- * tracking ineffective (A value of 0 disables noise tracking and the VAD then
- * relies purely on the sensitivity property). Too high of a value will make
+ * tracking ineffective (A value of 0 disables noise tracking and the VAD then
+ * relies purely on the sensitivity property). Too high of a value will make
* long speech classifiable as noise.
*
- * VadSensitivity: A dimensionless value between 0 and
+ * VadSensitivity: A dimensionless value between 0 and
* 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds
- * to decreasing the sensitivity of the VAD (i.e. '0' is most sensitive,
+ * to decreasing the sensitivity of the VAD (i.e. '0' is most sensitive,
* while 100 is 'least sensitive')
*/
void LLVivoxVoiceClient::setupVADParams(unsigned int vad_auto,
@@ -3487,7 +3487,7 @@ void LLVivoxVoiceClient::onVADSettingsChange()
// Response/Event handlers
void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &statusString, std::string &connectorHandle, std::string &versionID)
-{
+{
LLSD result = LLSD::emptyMap();
if(statusCode == 0)
@@ -3521,7 +3521,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
// this is usually fatal, but a long timeout might work
result["connector"] = LLSD::Boolean(false);
result["retry"] = LLSD::Real(CONNECT_ATTEMPT_TIMEOUT);
-
+
LL_WARNS("Voice") << "Voice connection failed" << LL_ENDL;
}
else if (statusCode == 10006) // name resolution failure - a shorter retry may work
@@ -3529,7 +3529,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
// some networks have slower DNS, but a short timeout might let it catch up
result["connector"] = LLSD::Boolean(false);
result["retry"] = LLSD::Real(CONNECT_DNS_TIMEOUT);
-
+
LL_WARNS("Voice") << "Voice connection DNS lookup failed" << LL_ENDL;
}
else // unknown failure - give up
@@ -3543,13 +3543,13 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
}
void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString, std::string &accountHandle, int numberOfAliases)
-{
+{
LLSD result = LLSD::emptyMap();
LL_DEBUGS("Voice") << "Account.Login response (" << statusCode << "): " << statusString << LL_ENDL;
-
+
// Status code of 20200 means "bad password". We may want to special-case that at some point.
-
+
if ( statusCode == HTTP_UNAUTHORIZED )
{
// Login failure which is probably caused by the delay after a user's password being updated.
@@ -3574,20 +3574,20 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString
}
void LLVivoxVoiceClient::sessionCreateResponse(std::string &requestId, int statusCode, std::string &statusString, std::string &sessionHandle)
-{
+{
sessionStatePtr_t session(findSessionBeingCreatedByURI(requestId));
-
+
if(session)
{
session->mCreateInProgress = false;
}
-
+
if(statusCode != 0)
{
LL_WARNS("Voice") << "Session.Create response failure (" << statusCode << "): " << statusString << LL_ENDL;
if(session)
{
- session->mErrorStatusCode = statusCode;
+ session->mErrorStatusCode = statusCode;
session->mErrorStatusString = statusString;
if(session == mAudioSession)
{
@@ -3618,20 +3618,20 @@ void LLVivoxVoiceClient::sessionCreateResponse(std::string &requestId, int statu
}
void LLVivoxVoiceClient::sessionGroupAddSessionResponse(std::string &requestId, int statusCode, std::string &statusString, std::string &sessionHandle)
-{
+{
sessionStatePtr_t session(findSessionBeingCreatedByURI(requestId));
-
+
if(session)
{
session->mCreateInProgress = false;
}
-
+
if(statusCode != 0)
{
LL_WARNS("Voice") << "SessionGroup.AddSession response failure (" << statusCode << "): " << statusString << LL_ENDL;
if(session)
{
- session->mErrorStatusCode = statusCode;
+ session->mErrorStatusCode = statusCode;
session->mErrorStatusString = statusString;
if(session == mAudioSession)
{
@@ -3692,7 +3692,7 @@ void LLVivoxVoiceClient::sessionConnectResponse(std::string &requestId, int stat
}
void LLVivoxVoiceClient::logoutResponse(int statusCode, std::string &statusString)
-{
+{
if(statusCode != 0)
{
LL_WARNS("Voice") << "Account.Logout response failure: " << statusString << LL_ENDL;
@@ -3710,21 +3710,21 @@ void LLVivoxVoiceClient::connectorShutdownResponse(int statusCode, std::string &
LL_WARNS("Voice") << "Connector.InitiateShutdown response failure: " << statusString << LL_ENDL;
// Should this ever fail? do we care if it does?
}
-
+
sConnected = false;
mShutdownComplete = true;
-
+
LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));
mVivoxPump.post(vivoxevent);
}
void LLVivoxVoiceClient::sessionAddedEvent(
- std::string &uriString,
- std::string &alias,
- std::string &sessionHandle,
- std::string &sessionGroupHandle,
- bool isChannel,
+ std::string &uriString,
+ std::string &alias,
+ std::string &sessionHandle,
+ std::string &sessionGroupHandle,
+ bool isChannel,
bool incoming,
std::string &nameString,
std::string &applicationString)
@@ -3732,7 +3732,7 @@ void LLVivoxVoiceClient::sessionAddedEvent(
sessionStatePtr_t session;
LL_INFOS("Voice") << "session " << uriString << ", alias " << alias << ", name " << nameString << " handle " << sessionHandle << LL_ENDL;
-
+
session = addSession(uriString, sessionHandle);
if(session)
{
@@ -3740,19 +3740,19 @@ void LLVivoxVoiceClient::sessionAddedEvent(
session->mIsChannel = isChannel;
session->mIncoming = incoming;
session->mAlias = alias;
-
+
// Generate a caller UUID -- don't need to do this for channels
if(!session->mIsChannel)
{
if(IDFromName(session->mSIPURI, session->mCallerID))
{
- // Normal URI(base64-encoded UUID)
+ // Normal URI(base64-encoded UUID)
}
else if(!session->mAlias.empty() && IDFromName(session->mAlias, session->mCallerID))
{
// Wrong URI, but an alias is available. Stash the incoming URI as an alternate
session->mAlternateSIPURI = session->mSIPURI;
-
+
// and generate a proper URI from the ID.
setSessionURI(session, sipURIFromID(session->mCallerID));
}
@@ -3761,7 +3761,7 @@ void LLVivoxVoiceClient::sessionAddedEvent(
LL_INFOS("Voice") << "Could not generate caller id from uri, using hash of uri " << session->mSIPURI << LL_ENDL;
session->mCallerID.generate(session->mSIPURI);
session->mSynthesizedCallerID = true;
-
+
// Can't look up the name in this case -- we have to extract it from the URI.
std::string namePortion = nameFromsipURI(session->mSIPURI);
if(namePortion.empty())
@@ -3769,14 +3769,14 @@ void LLVivoxVoiceClient::sessionAddedEvent(
// Didn't seem to be a SIP URI, just use the whole provided name.
namePortion = nameString;
}
-
+
// Some incoming names may be separated with an underscore instead of a space. Fix this.
LLStringUtil::replaceChar(namePortion, '_', ' ');
-
+
// Act like we just finished resolving the name (this stores it in all the right places)
avatarNameResolved(session->mCallerID, namePortion);
}
-
+
LL_INFOS("Voice") << "caller ID: " << session->mCallerID << LL_ENDL;
if(!session->mSynthesizedCallerID)
@@ -3791,7 +3791,7 @@ void LLVivoxVoiceClient::sessionAddedEvent(
void LLVivoxVoiceClient::sessionGroupAddedEvent(std::string &sessionGroupHandle)
{
LL_DEBUGS("Voice") << "handle " << sessionGroupHandle << LL_ENDL;
-
+
#if USE_SESSION_GROUPS
if(mMainSessionGroupHandle.empty())
{
@@ -3818,7 +3818,7 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
// The old session may now need to be deleted.
reapSession(oldSession);
}
-
+
// This is the session we're joining.
if(mIsJoiningSession)
{
@@ -3834,10 +3834,10 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
participant->mIsSelf = true;
lookupName(participant->mAvatarID);
- LL_INFOS("Voice") << "added self as participant \"" << participant->mAccountName
+ LL_INFOS("Voice") << "added self as participant \"" << participant->mAccountName
<< "\" (" << participant->mAvatarID << ")"<< LL_ENDL;
}
-
+
if(!session->mIsChannel)
{
// this is a p2p session. Make sure the other end is added as a participant.
@@ -3853,9 +3853,9 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
participant->mDisplayName = session->mName;
avatarNameResolved(participant->mAvatarID, session->mName);
}
-
+
// TODO: Question: Do we need to set up mAvatarID/mAvatarIDValid here?
- LL_INFOS("Voice") << "added caller as participant \"" << participant->mAccountName
+ LL_INFOS("Voice") << "added caller as participant \"" << participant->mAccountName
<< "\" (" << participant->mAvatarID << ")"<< LL_ENDL;
}
}
@@ -3863,11 +3863,11 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
}
void LLVivoxVoiceClient::sessionRemovedEvent(
- std::string &sessionHandle,
+ std::string &sessionHandle,
std::string &sessionGroupHandle)
{
LL_INFOS("Voice") << "handle " << sessionHandle << LL_ENDL;
-
+
sessionStatePtr_t session(findSession(sessionHandle));
if(session)
{
@@ -3875,15 +3875,15 @@ void LLVivoxVoiceClient::sessionRemovedEvent(
// This message invalidates the session's handle. Set it to empty.
clearSessionHandle(session);
-
+
// This also means that the session's session group is now empty.
// Terminate the session group so it doesn't leak.
sessionGroupTerminateSendMessage(session);
-
+
// Reset the media state (we now have no info)
session->mMediaStreamState = streamStateUnknown;
//session->mTextStreamState = streamStateUnknown;
-
+
// Conditionally delete the session
reapSession(session);
}
@@ -3899,7 +3899,7 @@ void LLVivoxVoiceClient::reapSession(const sessionStatePtr_t &session)
{
if(session)
{
-
+
if(session->mCreateInProgress)
{
LL_DEBUGS("Voice") << "NOT deleting session " << session->mSIPURI << " (create in progress)" << LL_ENDL;
@@ -3921,7 +3921,7 @@ void LLVivoxVoiceClient::reapSession(const sessionStatePtr_t &session)
// We don't have a reason to keep tracking this session, so just delete it.
LL_DEBUGS("Voice") << "deleting session " << session->mSIPURI << LL_ENDL;
deleteSession(session);
- }
+ }
}
else
{
@@ -3933,32 +3933,32 @@ void LLVivoxVoiceClient::reapSession(const sessionStatePtr_t &session)
bool LLVivoxVoiceClient::sessionNeedsRelog(const sessionStatePtr_t &session)
{
bool result = false;
-
+
if(session)
{
// Only make this check for spatial channels (so it won't happen for group or p2p calls)
if(session->mIsSpatial)
- {
+ {
std::string::size_type atsign;
-
+
atsign = session->mSIPURI.find("@");
-
+
if(atsign != std::string::npos)
{
std::string urihost = session->mSIPURI.substr(atsign + 1);
if(stricmp(urihost.c_str(), mVoiceSIPURIHostName.c_str()))
{
// The hostname in this URI is different from what we expect. This probably means we need to relog.
-
+
// We could make a ProvisionVoiceAccountRequest and compare the result with the current values of
// mVoiceSIPURIHostName and mVoiceAccountServerURI to be really sure, but this is a pretty good indicator.
-
+
result = true;
}
}
}
}
-
+
return result;
}
@@ -3974,9 +3974,9 @@ void LLVivoxVoiceClient::leftAudioSession(const sessionStatePtr_t &session)
}
void LLVivoxVoiceClient::accountLoginStateChangeEvent(
- std::string &accountHandle,
- int statusCode,
- std::string &statusString,
+ std::string &accountHandle,
+ int statusCode,
+ std::string &statusString,
int state)
{
LLSD levent = LLSD::emptyMap();
@@ -3988,9 +3988,9 @@ void LLVivoxVoiceClient::accountLoginStateChangeEvent(
login_state_logging_in = 2,
login_state_logging_out = 3,
login_state_resetting = 4,
- login_state_error=100
+ login_state_error=100
*/
-
+
LL_DEBUGS("Voice") << "state change event: " << state << LL_ENDL;
switch(state)
{
@@ -4020,7 +4020,7 @@ void LLVivoxVoiceClient::accountLoginStateChangeEvent(
mVivoxPump.post(levent);
break;
-
+
default:
//Used to be a commented out warning
LL_WARNS("Voice") << "unknown account state event: " << state << LL_ENDL;
@@ -4057,24 +4057,24 @@ void LLVivoxVoiceClient::mediaCompletionEvent(std::string &sessionGroupHandle, s
}
void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
- std::string &sessionHandle,
- std::string &sessionGroupHandle,
- int statusCode,
- std::string &statusString,
- int state,
+ std::string &sessionHandle,
+ std::string &sessionGroupHandle,
+ int statusCode,
+ std::string &statusString,
+ int state,
bool incoming)
{
sessionStatePtr_t session(findSession(sessionHandle));
-
+
LL_DEBUGS("Voice") << "session " << sessionHandle << ", status code " << statusCode << ", string \"" << statusString << "\"" << LL_ENDL;
-
+
if(session)
{
// We know about this session
-
+
// Save the state for later use
session->mMediaStreamState = state;
-
+
switch(statusCode)
{
case 0:
@@ -4102,9 +4102,9 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
session->mVoiceActive = true;
session->mMediaConnectInProgress = false;
joinedAudioSession(session);
- case streamStateConnecting: // do nothing, but prevents a warning getting into the logs.
+ case streamStateConnecting: // do nothing, but prevents a warning getting into the logs.
break;
-
+
case streamStateRinging:
if(incoming)
{
@@ -4123,13 +4123,13 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
}
}
break;
-
+
default:
LL_WARNS("Voice") << "unknown state " << state << LL_ENDL;
break;
-
+
}
-
+
}
else
{
@@ -4139,12 +4139,12 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
}
void LLVivoxVoiceClient::participantAddedEvent(
- std::string &sessionHandle,
- std::string &sessionGroupHandle,
- std::string &uriString,
- std::string &alias,
- std::string &nameString,
- std::string &displayNameString,
+ std::string &sessionHandle,
+ std::string &sessionGroupHandle,
+ std::string &uriString,
+ std::string &alias,
+ std::string &nameString,
+ std::string &displayNameString,
int participantType)
{
sessionStatePtr_t session(findSession(sessionHandle));
@@ -4155,7 +4155,7 @@ void LLVivoxVoiceClient::participantAddedEvent(
{
participant->mAccountName = nameString;
- LL_DEBUGS("Voice") << "added participant \"" << participant->mAccountName
+ LL_DEBUGS("Voice") << "added participant \"" << participant->mAccountName
<< "\" (" << participant->mAvatarID << ")"<< LL_ENDL;
if(participant->mAvatarIDValid)
@@ -4177,7 +4177,7 @@ void LLVivoxVoiceClient::participantAddedEvent(
// Problems with both of the above, fall back to the account name
namePortion = nameString;
}
-
+
// Set the display name (which is a hint to the active speakers window not to do its own lookup)
participant->mDisplayName = namePortion;
avatarNameResolved(participant->mAvatarID, namePortion);
@@ -4187,10 +4187,10 @@ void LLVivoxVoiceClient::participantAddedEvent(
}
void LLVivoxVoiceClient::participantRemovedEvent(
- std::string &sessionHandle,
- std::string &sessionGroupHandle,
- std::string &uriString,
- std::string &alias,
+ std::string &sessionHandle,
+ std::string &sessionGroupHandle,
+ std::string &uriString,
+ std::string &alias,
std::string &nameString)
{
sessionStatePtr_t session(findSession(sessionHandle));
@@ -4215,20 +4215,20 @@ void LLVivoxVoiceClient::participantRemovedEvent(
void LLVivoxVoiceClient::participantUpdatedEvent(
- std::string &sessionHandle,
- std::string &sessionGroupHandle,
- std::string &uriString,
- std::string &alias,
- bool isModeratorMuted,
- bool isSpeaking,
- int volume,
+ std::string &sessionHandle,
+ std::string &sessionGroupHandle,
+ std::string &uriString,
+ std::string &alias,
+ bool isModeratorMuted,
+ bool isSpeaking,
+ int volume,
F32 energy)
{
sessionStatePtr_t session(findSession(sessionHandle));
if(session)
{
participantStatePtr_t participant(session->findParticipant(uriString));
-
+
if(participant)
{
//LL_INFOS("Voice") << "Participant Update for " << participant->mDisplayName << LL_ENDL;
@@ -4253,25 +4253,25 @@ void LLVivoxVoiceClient::participantUpdatedEvent(
{
participant->mVolume = (F32)volume * VOLUME_SCALE_VIVOX;
}
-
- // *HACK: mantipov: added while working on EXT-3544
- /*
- Sometimes LLVoiceClient::participantUpdatedEvent callback is called BEFORE
- LLViewerChatterBoxSessionAgentListUpdates::post() sometimes AFTER.
-
- participantUpdatedEvent updates voice participant state in particular participantState::mIsModeratorMuted
- Originally we wanted to update session Speaker Manager to fire LLSpeakerVoiceModerationEvent to fix the EXT-3544 bug.
- Calling of the LLSpeakerMgr::update() method was added into LLIMMgr::processAgentListUpdates.
-
- But in case participantUpdatedEvent() is called after LLViewerChatterBoxSessionAgentListUpdates::post()
- voice participant mIsModeratorMuted is changed after speakers are updated in Speaker Manager
- and event is not fired.
-
- So, we have to call LLSpeakerMgr::update() here.
+
+ // *HACK: mantipov: added while working on EXT-3544
+ /*
+ Sometimes LLVoiceClient::participantUpdatedEvent callback is called BEFORE
+ LLViewerChatterBoxSessionAgentListUpdates::post() sometimes AFTER.
+
+ participantUpdatedEvent updates voice participant state in particular participantState::mIsModeratorMuted
+ Originally we wanted to update session Speaker Manager to fire LLSpeakerVoiceModerationEvent to fix the EXT-3544 bug.
+ Calling of the LLSpeakerMgr::update() method was added into LLIMMgr::processAgentListUpdates.
+
+ But in case participantUpdatedEvent() is called after LLViewerChatterBoxSessionAgentListUpdates::post()
+ voice participant mIsModeratorMuted is changed after speakers are updated in Speaker Manager
+ and event is not fired.
+
+ So, we have to call LLSpeakerMgr::update() here.
*/
LLVoiceChannel* voice_cnl = LLVoiceChannel::getCurrentVoiceChannel();
-
- // ignore session ID of local chat
+
+ // ignore session ID of local chat
if (voice_cnl && voice_cnl->getSessionID().notNull())
{
LLSpeakerMgr* speaker_manager = LLIMModel::getInstance()->getSpeakerManager(voice_cnl->getSessionID());
@@ -4300,10 +4300,10 @@ void LLVivoxVoiceClient::participantUpdatedEvent(
}
void LLVivoxVoiceClient::messageEvent(
- std::string &sessionHandle,
- std::string &uriString,
- std::string &alias,
- std::string &messageHeader,
+ std::string &sessionHandle,
+ std::string &uriString,
+ std::string &alias,
+ std::string &messageHeader,
std::string &messageBody,
std::string &applicationString)
{
@@ -4324,7 +4324,7 @@ void LLVivoxVoiceClient::messageEvent(
const std::string endSpan = "</span>";
std::string::size_type start;
std::string::size_type end;
-
+
// Default to displaying the raw string, so the message gets through.
message = messageBody;
@@ -4336,38 +4336,38 @@ void LLVivoxVoiceClient::messageEvent(
if(start != std::string::npos)
{
start += startMarker2.size();
-
+
if(end != std::string::npos)
end -= start;
-
+
message.assign(messageBody, start, end);
}
- else
+ else
{
// Didn't find a <body>, try looking for a <span> instead.
start = messageBody.find(startSpan);
start = messageBody.find(startMarker2, start);
end = messageBody.find(endSpan);
-
+
if(start != std::string::npos)
{
start += startMarker2.size();
-
+
if(end != std::string::npos)
end -= start;
-
+
message.assign(messageBody, start, end);
- }
+ }
}
- }
-
+ }
+
// LL_DEBUGS("Voice") << " raw message = \n" << message << LL_ENDL;
// strip formatting tags
{
std::string::size_type start;
std::string::size_type end;
-
+
while((start = message.find('<')) != std::string::npos)
{
if((end = message.find('>', start + 1)) != std::string::npos)
@@ -4382,7 +4382,7 @@ void LLVivoxVoiceClient::messageEvent(
}
}
}
-
+
// Decode ampersand-escaped chars
{
std::string::size_type mark = 0;
@@ -4394,14 +4394,14 @@ void LLVivoxVoiceClient::messageEvent(
message.replace(mark, 4, "<");
mark += 1;
}
-
+
mark = 0;
while((mark = message.find("&gt;", mark)) != std::string::npos)
{
message.replace(mark, 4, ">");
mark += 1;
}
-
+
mark = 0;
while((mark = message.find("&amp;", mark)) != std::string::npos)
{
@@ -4409,12 +4409,12 @@ void LLVivoxVoiceClient::messageEvent(
mark += 1;
}
}
-
+
// strip leading/trailing whitespace (since we always seem to get a couple newlines)
LLStringUtil::trim(message);
-
+
// LL_DEBUGS("Voice") << " stripped message = \n" << message << LL_ENDL;
-
+
sessionStatePtr_t session(findSession(sessionHandle));
if(session)
{
@@ -4424,7 +4424,7 @@ void LLVivoxVoiceClient::messageEvent(
LLChat chat;
chat.mMuted = is_muted && !is_linden;
-
+
if(!chat.mMuted)
{
chat.mFromID = session->mCallerID;
@@ -4435,7 +4435,7 @@ void LLVivoxVoiceClient::messageEvent(
{
// TODO: Question: Return do not disturb mode response here? Or maybe when session is started instead?
}
-
+
LL_DEBUGS("Voice") << "adding message, name " << session->mName << " session " << session->mIMSessionID << ", target " << session->mCallerID << LL_ENDL;
LLIMMgr::getInstance()->addMessage(session->mIMSessionID,
session->mCallerID,
@@ -4448,14 +4448,14 @@ void LLVivoxVoiceClient::messageEvent(
LLUUID::null, // default arg
LLVector3::zero); // default arg
}
- }
+ }
}
}
void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string &notificationType)
{
sessionStatePtr_t session(findSession(sessionHandle));
-
+
if(session)
{
participantStatePtr_t participant(session->findParticipant(uriString));
@@ -4518,11 +4518,11 @@ void LLVivoxVoiceClient::muteListChanged()
if(mAudioSession)
{
participantMap::iterator iter = mAudioSession->mParticipantsByURI.begin();
-
+
for(; iter != mAudioSession->mParticipantsByURI.end(); iter++)
{
participantStatePtr_t p(iter->second);
-
+
// Check to see if this participant is on the mute list already
if(p->updateMuteState())
mAudioSession->mVolumeDirty = true;
@@ -4532,18 +4532,18 @@ void LLVivoxVoiceClient::muteListChanged()
/////////////////////////////
// Managing list of participants
-LLVivoxVoiceClient::participantState::participantState(const std::string &uri) :
- mURI(uri),
- mPTT(false),
- mIsSpeaking(false),
- mIsModeratorMuted(false),
- mLastSpokeTimestamp(0.f),
- mPower(0.f),
- mVolume(LLVoiceClient::VOLUME_DEFAULT),
+LLVivoxVoiceClient::participantState::participantState(const std::string &uri) :
+ mURI(uri),
+ mPTT(false),
+ mIsSpeaking(false),
+ mIsModeratorMuted(false),
+ mLastSpokeTimestamp(0.f),
+ mPower(0.f),
+ mVolume(LLVoiceClient::VOLUME_DEFAULT),
mUserVolume(0),
- mOnMuteList(false),
+ mOnMuteList(false),
mVolumeSet(false),
- mVolumeDirty(false),
+ mVolumeDirty(false),
mAvatarIDValid(false),
mIsSelf(false)
{
@@ -4553,7 +4553,7 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::addP
{
participantStatePtr_t result;
bool useAlternateURI = false;
-
+
// Note: this is mostly the body of LLVivoxVoiceClient::sessionState::findParticipant(), but since we need to know if it
// matched the alternate SIP URI (so we can add it properly), we need to reproduce it here.
{
@@ -4575,14 +4575,14 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::addP
result = iter->second;
}
}
-
+
if(!result)
{
// participant isn't already in one list or the other.
result.reset(new participantState(useAlternateURI?mSIPURI:uri));
mParticipantsByURI.insert(participantMap::value_type(result->mURI, result));
mParticipantsChanged = true;
-
+
// Try to do a reverse transform on the URI to get the GUID back.
{
LLUUID id;
@@ -4598,12 +4598,12 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::addP
result->mAvatarID.generate(uri);
}
}
-
+
if(result->updateMuteState())
{
mMuteDirty = true;
}
-
+
mParticipantsByUUID.insert(participantUUIDMap::value_type(result->mAvatarID, result));
if (LLSpeakerVolumeStorage::getInstance()->getSpeakerVolume(result->mAvatarID, result->mVolume))
@@ -4611,10 +4611,10 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::addP
result->mVolumeDirty = true;
mVolumeDirty = true;
}
-
+
LL_DEBUGS("Voice") << "participant \"" << result->mURI << "\" added." << LL_ENDL;
}
-
+
return result;
}
@@ -4643,9 +4643,9 @@ void LLVivoxVoiceClient::sessionState::removeParticipant(const LLVivoxVoiceClien
{
participantMap::iterator iter = mParticipantsByURI.find(participant->mURI);
participantUUIDMap::iterator iter2 = mParticipantsByUUID.find(participant->mAvatarID);
-
+
LL_DEBUGS("Voice") << "participant \"" << participant->mURI << "\" (" << participant->mAvatarID << ") removed." << LL_ENDL;
-
+
if(iter == mParticipantsByURI.end())
{
LL_WARNS("Voice") << "Internal error: participant " << participant->mURI << " not in URI map" << LL_ENDL;
@@ -4676,7 +4676,7 @@ void LLVivoxVoiceClient::sessionState::removeAllParticipants()
{
removeParticipant(mParticipantsByURI.begin()->second);
}
-
+
if(!mParticipantsByUUID.empty())
{
LL_WARNS("Voice") << "Internal error: empty URI map, non-empty UUID map" << LL_ENDL;
@@ -4702,10 +4702,10 @@ void LLVivoxVoiceClient::sessionState::VerifySessions()
void LLVivoxVoiceClient::getParticipantList(std::set<LLUUID> &participants)
{
- if(mAudioSession)
+ if(mProcessChannels && mAudioSession)
{
for(participantUUIDMap::iterator iter = mAudioSession->mParticipantsByUUID.begin();
- iter != mAudioSession->mParticipantsByUUID.end();
+ iter != mAudioSession->mParticipantsByUUID.end();
iter++)
{
participants.insert(iter->first);
@@ -4715,18 +4715,18 @@ void LLVivoxVoiceClient::getParticipantList(std::set<LLUUID> &participants)
bool LLVivoxVoiceClient::isParticipant(const LLUUID &speaker_id)
{
- if(mAudioSession)
+ if(mProcessChannels && mAudioSession)
{
- return (mAudioSession->mParticipantsByUUID.find(speaker_id) != mAudioSession->mParticipantsByUUID.end());
+ return (mAudioSession->mParticipantsByUUID.find(speaker_id) != mAudioSession->mParticipantsByUUID.end());
}
- return false;
+ return false;
}
LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::findParticipant(const std::string &uri)
{
participantStatePtr_t result;
-
+
participantMap::iterator iter = mParticipantsByURI.find(uri);
if(iter == mParticipantsByURI.end())
@@ -4743,7 +4743,7 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::find
{
result = iter->second;
}
-
+
return result;
}
@@ -4763,12 +4763,12 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::find
LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::findParticipantByID(const LLUUID& id)
{
participantStatePtr_t result;
-
+
if(mAudioSession)
{
result = mAudioSession->findParticipantByID(id);
}
-
+
return result;
}
@@ -4779,15 +4779,15 @@ bool LLVivoxVoiceClient::checkParcelChanged(bool update)
{
LLViewerRegion *region = gAgent.getRegion();
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-
+
if(region && parcel)
{
S32 parcelLocalID = parcel->getLocalID();
std::string regionName = region->getName();
-
+
// LL_DEBUGS("Voice") << "Region name = \"" << regionName << "\", parcel local ID = " << parcelLocalID << ", cap URI = \"" << capURI << "\"" << LL_ENDL;
-
- // The region name starts out empty and gets filled in later.
+
+ // The region name starts out empty and gets filled in later.
// Also, the cap gets filled in a short time after the region cross, but a little too late for our purposes.
// If either is empty, wait for the next time around.
if(!regionName.empty())
@@ -4815,7 +4815,7 @@ bool LLVivoxVoiceClient::switchChannel(
std::string hash)
{
bool needsSwitch = !mIsInChannel;
-
+
if (mIsInChannel)
{
if (mSessionTerminateRequested)
@@ -4892,7 +4892,7 @@ bool LLVivoxVoiceClient::switchChannel(
mNextAudioSession->mReconnect = !no_reconnect;
mNextAudioSession->mIsP2P = is_p2p;
}
-
+
if (mIsInChannel)
{
// If we're already in a channel, or if we're joining one, terminate
@@ -4928,7 +4928,7 @@ bool LLVivoxVoiceClient::setSpatialChannel(const LLSD& channelInfo)
mSpatialSessionCredentials = channelInfo["channel_credentials"].asString();
LL_DEBUGS("Voice") << "got spatial channel uri: \"" << mSpatialSessionURI << "\"" << LL_ENDL;
-
+
if((mIsInChannel && mAudioSession && !(mAudioSession->mIsSpatial)) || (mNextAudioSession && !(mNextAudioSession->mIsSpatial)))
{
// User is in a non-spatial chat or joining a non-spatial chat. Don't switch channels.
@@ -4997,9 +4997,9 @@ bool LLVivoxVoiceClient::isVoiceWorking() const
// Currently this will be false only for PSTN callers into group chats, and PSTN p2p calls.
BOOL LLVivoxVoiceClient::isParticipantAvatar(const LLUUID &id)
{
- BOOL result = TRUE;
+ BOOL result = TRUE;
sessionStatePtr_t session(findSession(id));
-
+
if(session)
{
// this is a p2p session with the indicated caller, or the session with the specified UUID.
@@ -5018,22 +5018,22 @@ BOOL LLVivoxVoiceClient::isParticipantAvatar(const LLUUID &id)
}
}
}
-
+
return result;
}
// Returns true if calling back the session URI after the session has closed is possible.
-// Currently this will be false only for PSTN P2P calls.
+// Currently this will be false only for PSTN P2P calls.
BOOL LLVivoxVoiceClient::isSessionCallBackPossible(const LLUUID &session_id)
{
- BOOL result = TRUE;
+ BOOL result = TRUE;
sessionStatePtr_t session(findSession(session_id));
-
+
if(session != NULL)
{
result = session->isCallBackPossible();
}
-
+
return result;
}
@@ -5043,12 +5043,12 @@ BOOL LLVivoxVoiceClient::isSessionTextIMPossible(const LLUUID &session_id)
{
bool result = TRUE;
sessionStatePtr_t session(findSession(session_id));
-
+
if(session != NULL)
{
result = session->isTextIMPossible();
}
-
+
return result;
}
@@ -5056,15 +5056,15 @@ void LLVivoxVoiceClient::leaveNonSpatialChannel()
{
LL_DEBUGS("Voice") << "Request to leave spacial channel." << LL_ENDL;
- // Make sure we don't rejoin the current session.
+ // Make sure we don't rejoin the current session.
sessionStatePtr_t oldNextSession(mNextAudioSession);
mNextAudioSession.reset();
-
+
// Most likely this will still be the current session at this point, but check it anyway.
reapSession(oldNextSession);
-
+
verifySessionState();
-
+
sessionTerminate();
}
@@ -5075,8 +5075,10 @@ void LLVivoxVoiceClient::processChannels(bool process)
bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo)
{
- if (channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE)
+ if (!mProcessChannels || (channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE))
+ {
return false;
+ }
if (mAudioSession)
{
if (!channelInfo["sessionHandle"].asString().empty())
@@ -5098,12 +5100,12 @@ bool LLVivoxVoiceClient::compareChannels(const LLSD& channelInfo1, const LLSD& c
bool LLVivoxVoiceClient::inProximalChannel()
{
bool result = false;
-
+
if (mIsInChannel && !mSessionTerminateRequested)
{
result = inSpatialChannel();
}
-
+
return result;
}
@@ -5114,7 +5116,7 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
result += nameFromID(id);
result += "@";
result += mVoiceSIPURIHostName;
-
+
return result;
}
@@ -5128,14 +5130,14 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
result += "@";
result += mVoiceSIPURIHostName;
}
-
+
return result;
}
std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
{
std::string result;
-
+
if (uuid.isNull()) {
//VIVOX, the uuid emtpy look for the mURIString and return that instead.
//result.assign(uuid.mURIStringName);
@@ -5144,31 +5146,31 @@ std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
}
// Prepending this apparently prevents conflicts with reserved names inside the vivox code.
result = "x";
-
- // Base64 encode and replace the pieces of base64 that are less compatible
+
+ // Base64 encode and replace the pieces of base64 that are less compatible
// with e-mail local-parts.
// See RFC-4648 "Base 64 Encoding with URL and Filename Safe Alphabet"
result += LLBase64::encode(uuid.mData, UUID_BYTES);
LLStringUtil::replaceChar(result, '+', '-');
LLStringUtil::replaceChar(result, '/', '_');
-
+
// If you need to transform a GUID to this form on the Mac OS X command line, this will do so:
// echo -n x && (echo e669132a-6c43-4ee1-a78d-6c82fff59f32 |xxd -r -p |openssl base64|tr '/+' '_-')
-
+
// The reverse transform can be done with:
// echo 'x5mkTKmxDTuGnjWyC__WfMg==' |cut -b 2- -|tr '_-' '/+' |openssl base64 -d|xxd -p
-
+
return result;
}
bool LLVivoxVoiceClient::IDFromName(const std::string inName, LLUUID &uuid)
{
bool result = false;
-
+
// SLIM SDK: The "name" may actually be a SIP URI such as: "sip:xFnPP04IpREWNkuw1cOXlhw==@bhr.vivox.com"
// If it is, convert to a bare name before doing the transform.
std::string name = nameFromsipURI(inName);
-
+
// Doesn't look like a SIP URI, assume it's an actual name.
if(name.empty())
name = inName;
@@ -5176,7 +5178,7 @@ bool LLVivoxVoiceClient::IDFromName(const std::string inName, LLUUID &uuid)
// This will only work if the name is of the proper form.
// As an example, the account name for Monroe Linden (UUID 1673cfd3-8229-4445-8d92-ec3570e5e587) is:
// "xFnPP04IpREWNkuw1cOXlhw=="
-
+
if((name.size() == 25) && (name[0] == 'x') && (name[23] == '=') && (name[24] == '='))
{
// The name appears to have the right form.
@@ -5186,7 +5188,7 @@ bool LLVivoxVoiceClient::IDFromName(const std::string inName, LLUUID &uuid)
LLStringUtil::replaceChar(temp, '-', '+');
LLStringUtil::replaceChar(temp, '_', '/');
- U8 rawuuid[UUID_BYTES + 1];
+ U8 rawuuid[UUID_BYTES + 1];
int len = apr_base64_decode_binary(rawuuid, temp.c_str() + 1);
if(len == UUID_BYTES)
{
@@ -5194,15 +5196,15 @@ bool LLVivoxVoiceClient::IDFromName(const std::string inName, LLUUID &uuid)
memcpy(uuid.mData, rawuuid, UUID_BYTES);
result = true;
}
- }
-
+ }
+
if(!result)
{
// VIVOX: not a standard account name, just copy the URI name mURIString field
// and hope for the best. bpj
uuid.setNull(); // VIVOX, set the uuid field to nulls
}
-
+
return result;
}
@@ -5230,19 +5232,19 @@ std::string LLVivoxVoiceClient::nameFromsipURI(const std::string &uri)
{
result = uri.substr(sipOffset + 4, atOffset - (sipOffset + 4));
}
-
+
return result;
}
bool LLVivoxVoiceClient::inSpatialChannel(void)
{
bool result = false;
-
+
if(mAudioSession)
{
result = mAudioSession->mIsSpatial;
}
-
+
return result;
}
@@ -5250,22 +5252,22 @@ bool LLVivoxVoiceClient::inSpatialChannel(void)
LLSD LLVivoxVoiceClient::getAudioSessionChannelInfo()
{
LLSD result;
-
+
if (mAudioSession)
{
result = mAudioSession->getVoiceChannelInfo();
}
-
+
return result;
}
std::string LLVivoxVoiceClient::getAudioSessionHandle()
{
std::string result;
-
+
if(mAudioSession)
result = mAudioSession->mHandle;
-
+
return result;
}
@@ -5284,11 +5286,11 @@ void LLVivoxVoiceClient::enforceTether(void)
F32 camera_distance = (F32)camera_offset.magVec();
if(camera_distance > max_dist)
{
- tethered = mAvatarPosition +
+ tethered = mAvatarPosition +
(max_dist / camera_distance) * camera_offset;
}
}
-
+
if(dist_vec_squared(mCameraPosition, tethered) > 0.01)
{
mCameraPosition = tethered;
@@ -5305,19 +5307,19 @@ void LLVivoxVoiceClient::updatePosition(void)
LLMatrix3 rot;
LLVector3d pos;
LLQuaternion qrot;
-
+
// TODO: If camera and avatar velocity are actually used by the voice system, we could compute them here...
// They're currently always set to zero.
-
+
// Send the current camera position to the voice code
- rot.setRows(LLViewerCamera::getInstance()->getAtAxis(), LLViewerCamera::getInstance()->getLeftAxis (), LLViewerCamera::getInstance()->getUpAxis());
+ rot.setRows(LLViewerCamera::getInstance()->getAtAxis(), LLViewerCamera::getInstance()->getLeftAxis (), LLViewerCamera::getInstance()->getUpAxis());
pos = gAgent.getRegion()->getPosGlobalFromRegion(LLViewerCamera::getInstance()->getOrigin());
-
+
LLVivoxVoiceClient::getInstance()->setCameraPosition(
pos, // position
LLVector3::zero, // velocity
rot); // rotation matrix
-
+
// Send the current avatar position to the voice code
qrot = gAgentAvatarp->getRootJoint()->getWorldRotation();
pos = gAgentAvatarp->getPositionGlobal();
@@ -5325,7 +5327,7 @@ void LLVivoxVoiceClient::updatePosition(void)
// TODO: Can we get the head offset from outside the LLVOAvatar?
// pos += LLVector3d(mHeadOffset);
pos += LLVector3d(0.f, 0.f, 1.f);
-
+
LLVivoxVoiceClient::getInstance()->setAvatarPosition(
pos, // position
LLVector3::zero, // velocity
@@ -5336,13 +5338,13 @@ void LLVivoxVoiceClient::updatePosition(void)
void LLVivoxVoiceClient::setCameraPosition(const LLVector3d &position, const LLVector3 &velocity, const LLMatrix3 &rot)
{
mCameraRequestedPosition = position;
-
+
if(mCameraVelocity != velocity)
{
mCameraVelocity = velocity;
mSpatialCoordsDirty = true;
}
-
+
if(mCameraRot != rot)
{
mCameraRot = rot;
@@ -5357,19 +5359,19 @@ void LLVivoxVoiceClient::setAvatarPosition(const LLVector3d &position, const LLV
mAvatarPosition = position;
mSpatialCoordsDirty = true;
}
-
+
if(mAvatarVelocity != velocity)
{
mAvatarVelocity = velocity;
mSpatialCoordsDirty = true;
}
-
+
// If the two rotations are not exactly equal test their dot product
// to get the cos of the angle between them.
// If it is too small, don't update.
F32 rot_cos_diff = llabs(dot(mAvatarRot, rot));
if ((mAvatarRot != rot) && (rot_cos_diff < MINUSCULE_ANGLE_COS))
- {
+ {
mAvatarRot = rot;
mSpatialCoordsDirty = true;
}
@@ -5378,15 +5380,15 @@ void LLVivoxVoiceClient::setAvatarPosition(const LLVector3d &position, const LLV
bool LLVivoxVoiceClient::channelFromRegion(LLViewerRegion *region, std::string &name)
{
bool result = false;
-
+
if(region)
{
name = region->getName();
}
-
+
if(!name.empty())
result = true;
-
+
return result;
}
@@ -5416,14 +5418,14 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled)
<< " was "<< (mVoiceEnabled ? "enabled" : "disabled")
<< " coro "<< (mIsCoroutineActive ? "active" : "inactive")
<< LL_ENDL;
-
+
if (enabled != mVoiceEnabled)
{
// TODO: Refactor this so we don't call into LLVoiceChannel, but simply
// use the status observer
mVoiceEnabled = enabled;
LLVoiceClientStatusObserver::EStatusType status;
-
+
if (enabled)
{
LL_DEBUGS("Voice") << "enabling" << LL_ENDL;
@@ -5462,7 +5464,7 @@ void LLVivoxVoiceClient::setEarLocation(S32 loc)
if(mEarLocation != loc)
{
LL_DEBUGS("Voice") << "Setting mEarLocation to " << loc << LL_ENDL;
-
+
mEarLocation = loc;
mSpatialCoordsDirty = true;
}
@@ -5470,7 +5472,7 @@ void LLVivoxVoiceClient::setEarLocation(S32 loc)
void LLVivoxVoiceClient::setVoiceVolume(F32 volume)
{
- int scaled_volume = scale_speaker_volume(volume);
+ int scaled_volume = scale_speaker_volume(volume);
if(scaled_volume != mSpeakerVolume)
{
@@ -5488,7 +5490,7 @@ void LLVivoxVoiceClient::setVoiceVolume(F32 volume)
void LLVivoxVoiceClient::setMicGain(F32 volume)
{
int scaled_volume = scale_mic_volume(volume);
-
+
if(scaled_volume != mMicVolume)
{
mMicVolume = scaled_volume;
@@ -5498,29 +5500,19 @@ void LLVivoxVoiceClient::setMicGain(F32 volume)
/////////////////////////////
// Accessors for data related to nearby speakers
-BOOL LLVivoxVoiceClient::getVoiceEnabled(const LLUUID& id)
-{
- BOOL result = FALSE;
- participantStatePtr_t participant(findParticipantByID(id));
- if(participant)
- {
- // I'm not sure what the semantics of this should be.
- // For now, if we have any data about the user that came through the chat channel, assume they're voice-enabled.
- result = TRUE;
- }
-
- return result;
-}
std::string LLVivoxVoiceClient::getDisplayName(const LLUUID& id)
{
std::string result;
- participantStatePtr_t participant(findParticipantByID(id));
- if(participant)
- {
- result = participant->mDisplayName;
- }
-
+ if (mProcessChannels)
+ {
+ participantStatePtr_t participant(findParticipantByID(id));
+ if (participant)
+ {
+ result = participant->mDisplayName;
+ }
+ }
+
return result;
}
@@ -5529,42 +5521,47 @@ std::string LLVivoxVoiceClient::getDisplayName(const LLUUID& id)
BOOL LLVivoxVoiceClient::getIsSpeaking(const LLUUID& id)
{
BOOL result = FALSE;
+ if (mProcessChannels)
+ {
+ participantStatePtr_t participant(findParticipantByID(id));
+ if (participant)
+ {
+ if (participant->mSpeakingTimeout.getElapsedTimeF32() > SPEAKING_TIMEOUT)
+ {
+ participant->mIsSpeaking = FALSE;
+ }
+ result = participant->mIsSpeaking;
+ }
+ }
- participantStatePtr_t participant(findParticipantByID(id));
- if(participant)
- {
- if (participant->mSpeakingTimeout.getElapsedTimeF32() > SPEAKING_TIMEOUT)
- {
- participant->mIsSpeaking = FALSE;
- }
- result = participant->mIsSpeaking;
- }
-
return result;
}
BOOL LLVivoxVoiceClient::getIsModeratorMuted(const LLUUID& id)
{
BOOL result = FALSE;
-
+ if (!mProcessChannels)
+ {
+ return FALSE;
+ }
participantStatePtr_t participant(findParticipantByID(id));
if(participant)
{
result = participant->mIsModeratorMuted;
}
-
+
return result;
}
F32 LLVivoxVoiceClient::getCurrentPower(const LLUUID& id)
-{
+{
F32 result = 0;
participantStatePtr_t participant(findParticipantByID(id));
if(participant)
{
result = participant->mPower;
}
-
+
return result;
}
@@ -5581,19 +5578,6 @@ BOOL LLVivoxVoiceClient::getUsingPTT(const LLUUID& id)
// Does "using PTT" mean they're configured with a push-to-talk button?
// For now, we know there's no PTT mechanism in place, so nobody is using it.
}
-
- return result;
-}
-
-BOOL LLVivoxVoiceClient::getOnMuteList(const LLUUID& id)
-{
- BOOL result = FALSE;
-
- participantStatePtr_t participant(findParticipantByID(id));
- if(participant)
- {
- result = participant->mOnMuteList;
- }
return result;
}
@@ -5603,7 +5587,7 @@ F32 LLVivoxVoiceClient::getUserVolume(const LLUUID& id)
{
// Minimum volume will be returned for users with voice disabled
F32 result = LLVoiceClient::VOLUME_MIN;
-
+
participantStatePtr_t participant(findParticipantByID(id));
if(participant)
{
@@ -5651,21 +5635,21 @@ std::string LLVivoxVoiceClient::getGroupID(const LLUUID& id)
{
result = participant->mGroupID;
}
-
+
return result;
}
void LLVivoxVoiceClient::recordingLoopStart(int seconds, int deltaFramesPerControlFrame)
{
// LL_DEBUGS("Voice") << "sending SessionGroup.ControlRecording (Start)" << LL_ENDL;
-
+
if(!mMainSessionGroupHandle.empty())
{
std::ostringstream stream;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.ControlRecording.1\">"
<< "<SessionGroupHandle>" << mMainSessionGroupHandle << "</SessionGroupHandle>"
- << "<RecordingControlType>Start</RecordingControlType>"
+ << "<RecordingControlType>Start</RecordingControlType>"
<< "<DeltaFramesPerControlFrame>" << deltaFramesPerControlFrame << "</DeltaFramesPerControlFrame>"
<< "<Filename>" << "" << "</Filename>"
<< "<EnableAudioRecordingEvents>false</EnableAudioRecordingEvents>"
@@ -5687,7 +5671,7 @@ void LLVivoxVoiceClient::recordingLoopSave(const std::string& filename)
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.ControlRecording.1\">"
<< "<SessionGroupHandle>" << mMainSessionGroupHandle << "</SessionGroupHandle>"
- << "<RecordingControlType>Flush</RecordingControlType>"
+ << "<RecordingControlType>Flush</RecordingControlType>"
<< "<Filename>" << filename << "</Filename>"
<< "</Request>\n\n\n";
@@ -5705,7 +5689,7 @@ void LLVivoxVoiceClient::recordingStop()
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.ControlRecording.1\">"
<< "<SessionGroupHandle>" << mMainSessionGroupHandle << "</SessionGroupHandle>"
- << "<RecordingControlType>Stop</RecordingControlType>"
+ << "<RecordingControlType>Stop</RecordingControlType>"
<< "</Request>\n\n\n";
writeString(stream.str());
@@ -5722,7 +5706,7 @@ void LLVivoxVoiceClient::filePlaybackStart(const std::string& filename)
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.ControlPlayback.1\">"
<< "<SessionGroupHandle>" << mMainSessionGroupHandle << "</SessionGroupHandle>"
- << "<RecordingControlType>Start</RecordingControlType>"
+ << "<RecordingControlType>Start</RecordingControlType>"
<< "<Filename>" << filename << "</Filename>"
<< "</Request>\n\n\n";
@@ -5740,7 +5724,7 @@ void LLVivoxVoiceClient::filePlaybackStop()
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"SessionGroup.ControlPlayback.1\">"
<< "<SessionGroupHandle>" << mMainSessionGroupHandle << "</SessionGroupHandle>"
- << "<RecordingControlType>Stop</RecordingControlType>"
+ << "<RecordingControlType>Stop</RecordingControlType>"
<< "</Request>\n\n\n";
writeString(stream.str());
@@ -5830,7 +5814,7 @@ bool LLVivoxVoiceClient::sessionState::isTextIMPossible()
}
-/*static*/
+/*static*/
LLVivoxVoiceClient::sessionState::ptr_t LLVivoxVoiceClient::sessionState::matchSessionByHandle(const std::string &handle)
{
sessionStatePtr_t result;
@@ -5844,7 +5828,7 @@ LLVivoxVoiceClient::sessionState::ptr_t LLVivoxVoiceClient::sessionState::matchS
return result;
}
-/*static*/
+/*static*/
LLVivoxVoiceClient::sessionState::ptr_t LLVivoxVoiceClient::sessionState::matchCreatingSessionByURI(const std::string &uri)
{
sessionStatePtr_t result;
@@ -5891,7 +5875,7 @@ void LLVivoxVoiceClient::sessionState::for_each(sessionFunc_t func)
std::for_each(mSession.begin(), mSession.end(), boost::bind(for_eachPredicate, _1, func));
}
-// simple test predicates.
+// simple test predicates.
// *TODO: These should be made into lambdas when we can pull the trigger on newer C++ features.
bool LLVivoxVoiceClient::sessionState::testByHandle(const LLVivoxVoiceClient::sessionState::wptr_t &a, std::string handle)
{
@@ -5945,28 +5929,28 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::findSession(const std:
{
result = iter->second;
}
-
+
return result;
}
LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::findSessionBeingCreatedByURI(const std::string &uri)
-{
+{
sessionStatePtr_t result = sessionState::matchCreatingSessionByURI(uri);
-
+
return result;
}
LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::findSession(const LLUUID &participant_id)
{
sessionStatePtr_t result = sessionState::matchSessionByParticipant(participant_id);
-
+
return result;
}
LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::string &uri, const std::string &handle)
{
sessionStatePtr_t result;
-
+
if(handle.empty())
{
// No handle supplied.
@@ -5977,7 +5961,7 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::
{
// Check for an existing session with this handle
sessionMap::iterator iter = mSessionsByHandle.find(handle);
-
+
if(iter != mSessionsByHandle.end())
{
result = iter->second;
@@ -5987,7 +5971,7 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::
if(!result)
{
// No existing session found.
-
+
LL_DEBUGS("Voice") << "adding new session: handle \"" << handle << "\" URI " << uri << LL_ENDL;
result = sessionState::createSession();
result->mSIPURI = uri;
@@ -6000,8 +5984,8 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::
if(!result->mHandle.empty())
{
- // *TODO: Rider: This concerns me. There is a path (via switchChannel) where
- // we do not track the session. In theory this means that we could end up with
+ // *TODO: Rider: This concerns me. There is a path (via switchChannel) where
+ // we do not track the session. In theory this means that we could end up with
// a mAuidoSession that does not match the session tracked in mSessionsByHandle
mSessionsByHandle.insert(sessionMap::value_type(result->mHandle, result));
}
@@ -6009,7 +5993,7 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::
else
{
// Found an existing session
-
+
if(uri != result->mSIPURI)
{
// TODO: Should this be an internal error?
@@ -6031,12 +6015,12 @@ LLVivoxVoiceClient::sessionStatePtr_t LLVivoxVoiceClient::addSession(const std::
setSessionHandle(result, handle);
}
}
-
+
LL_DEBUGS("Voice") << "returning existing session: handle " << handle << " URI " << uri << LL_ENDL;
}
verifySessionState();
-
+
return result;
}
@@ -6067,7 +6051,7 @@ void LLVivoxVoiceClient::clearSessionHandle(const sessionStatePtr_t &session)
void LLVivoxVoiceClient::setSessionHandle(const sessionStatePtr_t &session, const std::string &handle)
{
// Have to remove the session from the handle-indexed map before changing the handle, or things will break badly.
-
+
if(!session->mHandle.empty())
{
// Remove session from the map if it should have been there.
@@ -6086,7 +6070,7 @@ void LLVivoxVoiceClient::setSessionHandle(const sessionStatePtr_t &session, cons
LL_WARNS("Voice") << "Attempt to remove session with handle " << session->mHandle << " not found in map!" << LL_ENDL;
}
}
-
+
session->mHandle = handle;
if(!handle.empty())
@@ -6148,7 +6132,7 @@ void LLVivoxVoiceClient::deleteAllSessions()
const sessionStatePtr_t session = mSessionsByHandle.begin()->second;
deleteSession(session);
}
-
+
}
void LLVivoxVoiceClient::verifySessionState(void)
@@ -6236,10 +6220,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
}
}
}
-
- LL_DEBUGS("Voice")
- << " " << LLVoiceClientStatusObserver::status2string(status)
- << ", session channelInfo " << getAudioSessionChannelInfo()
+
+ LL_DEBUGS("Voice")
+ << " " << LLVoiceClientStatusObserver::status2string(status)
+ << ", session channelInfo " << getAudioSessionChannelInfo()
<< ", proximal is " << inSpatialChannel()
<< LL_ENDL;
@@ -6330,7 +6314,7 @@ void LLVivoxVoiceClient::predAvatarNameResolution(const LLVivoxVoiceClient::sess
{
session->mTextInvitePending = false;
- // We don't need to call LLIMMgr::getInstance()->addP2PSession() here. The first incoming message will create the panel.
+ // We don't need to call LLIMMgr::getInstance()->addP2PSession() here. The first incoming message will create the panel.
}
if (session->mVoiceInvitePending)
{
@@ -6884,7 +6868,7 @@ void LLVivoxVoiceClient::onClickVoiceEffect(const std::string& voice_effect_name
}
}
-// it updates VoiceMorphing menu items in accordance with purchased properties
+// it updates VoiceMorphing menu items in accordance with purchased properties
void LLVivoxVoiceClient::updateVoiceMorphingMenu()
{
if (mVoiceFontListDirty)
@@ -7125,7 +7109,7 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage()
LLVivoxProtocolParser::LLVivoxProtocolParser()
{
parser = XML_ParserCreate(NULL);
-
+
reset();
}
@@ -7158,7 +7142,7 @@ void LLVivoxProtocolParser::reset()
applicationString.clear();
}
-//virtual
+//virtual
LLVivoxProtocolParser::~LLVivoxProtocolParser()
{
if (parser)
@@ -7184,38 +7168,38 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl(
istr.read(buf, sizeof(buf));
mInput.append(buf, istr.gcount());
}
-
+
// Look for input delimiter(s) in the input buffer. If one is found, send the message to the xml parser.
int start = 0;
int delim;
while((delim = mInput.find("\n\n\n", start)) != std::string::npos)
- {
-
+ {
+
// Reset internal state of the LLVivoxProtocolParser (no effect on the expat parser)
reset();
-
+
XML_ParserReset(parser, NULL);
XML_SetElementHandler(parser, ExpatStartTag, ExpatEndTag);
XML_SetCharacterDataHandler(parser, ExpatCharHandler);
- XML_SetUserData(parser, this);
+ XML_SetUserData(parser, this);
XML_Parse(parser, mInput.data() + start, delim - start, false);
-
+
LL_DEBUGS("VivoxProtocolParser") << "parsing: " << mInput.substr(start, delim - start) << LL_ENDL;
start = delim + 3;
}
-
+
if(start != 0)
mInput = mInput.substr(start);
-
+
LL_DEBUGS("VivoxProtocolParser") << "at end, mInput is: " << mInput << LL_ENDL;
-
+
if(!LLVivoxVoiceClient::sConnected)
{
// If voice has been disabled, we just want to close the socket. This does so.
LL_INFOS("Voice") << "returning STATUS_STOP" << LL_ENDL;
return STATUS_STOP;
}
-
+
return STATUS_OK;
}
@@ -7259,11 +7243,11 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
textBuffer.clear();
// only accumulate text if we're not ignoring tags.
accumulateText = !ignoringTags;
-
+
if (responseDepth == 0)
- {
+ {
isEvent = !stricmp("Event", tag);
-
+
if (!stricmp("Response", tag) || isEvent)
{
// Grab the attributes
@@ -7271,7 +7255,7 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
{
const char *key = *attr++;
const char *value = *attr++;
-
+
if (!stricmp("requestId", key))
{
requestId = value;
@@ -7297,20 +7281,20 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
else
{
LL_DEBUGS("VivoxProtocolParser") << tag << " (" << responseDepth << ")" << LL_ENDL;
-
+
// Ignore the InputXml stuff so we don't get confused
if (!stricmp("InputXml", tag))
{
ignoringTags = true;
ignoreDepth = responseDepth;
accumulateText = false;
-
+
LL_DEBUGS("VivoxProtocolParser") << "starting ignore, ignoreDepth is " << ignoreDepth << LL_ENDL;
}
else if (!stricmp("CaptureDevices", tag))
{
LLVivoxVoiceClient::getInstance()->clearCaptureDevices();
- }
+ }
else if (!stricmp("RenderDevices", tag))
{
LLVivoxVoiceClient::getInstance()->clearRenderDevices();
@@ -7322,7 +7306,7 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
else if (!stricmp("RenderDevice", tag))
{
deviceString.clear();
- }
+ }
else if (!stricmp("SessionFont", tag))
{
id = 0;
@@ -7357,9 +7341,9 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
void LLVivoxProtocolParser::EndTag(const char *tag)
{
const std::string& string = textBuffer;
-
+
responseDepth--;
-
+
if (ignoringTags)
{
if (ignoreDepth == responseDepth)
@@ -7372,11 +7356,11 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
LL_DEBUGS("VivoxProtocolParser") << "ignoring tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL;
}
}
-
+
if (!ignoringTags)
{
LL_DEBUGS("VivoxProtocolParser") << "processing tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL;
-
+
// Closing a tag. Finalize the text we've accumulated and reset
if (!stricmp("ReturnCode", tag))
returnCode = strtol(string.c_str(), NULL, 10);
@@ -7431,7 +7415,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
else if (!stricmp("DisplayName", tag))
displayNameString = string;
else if (!stricmp("Device", tag))
- deviceString = string;
+ deviceString = string;
else if (!stricmp("AccountName", tag))
nameString = string;
else if (!stricmp("ParticipantType", tag))
@@ -7529,7 +7513,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
textBuffer.clear();
accumulateText= false;
-
+
if (responseDepth == 0)
{
// We finished all of the XML, process the data
@@ -7546,7 +7530,7 @@ void LLVivoxProtocolParser::CharData(const char *buffer, int length)
This method is called for anything that isn't a tag, which can be text you
want that lies between tags, and a lot of stuff you don't want like file formatting
(tabs, spaces, CR/LF, etc).
-
+
Only copy text if we are in accumulate mode...
*/
if (accumulateText)
@@ -7573,14 +7557,14 @@ LLDate LLVivoxProtocolParser::expiryTimeStampToLLDate(const std::string& vivox_t
void LLVivoxProtocolParser::processResponse(std::string tag)
{
LL_DEBUGS("VivoxProtocolParser") << tag << LL_ENDL;
-
+
// SLIM SDK: the SDK now returns a statusCode of "200" (OK) for success. This is a change vs. previous SDKs.
// According to Mike S., "The actual API convention is that responses with return codes of 0 are successful, regardless of the status code returned",
// so I believe this will give correct behavior.
-
+
if(returnCode == 0)
statusCode = 0;
-
+
if (isEvent)
{
const char *eventTypeCstr = eventTypeString.c_str();
@@ -7648,7 +7632,7 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
}
else if (!stricmp(eventTypeCstr, "ParticipantAddedEvent"))
{
- /*
+ /*
<Event type="ParticipantAddedEvent">
<SessionGroupHandle>c1_m1000xFnPP04IpREWNkuw1cOXlhw==_sg4</SessionGroupHandle>
<SessionHandle>c1_m1000xFnPP04IpREWNkuw1cOXlhw==4</SessionHandle>
@@ -7680,12 +7664,12 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
// These are really spammy in tuning mode
LLVivoxVoiceClient::getInstance()->auxAudioPropertiesEvent(energy);
}
- else if (!stricmp(eventTypeCstr, "MessageEvent"))
+ else if (!stricmp(eventTypeCstr, "MessageEvent"))
{
//TODO: This probably is not received any more, it was used to support SLim clients
LLVivoxVoiceClient::getInstance()->messageEvent(sessionHandle, uriString, alias, messageHeader, messageBody, applicationString);
}
- else if (!stricmp(eventTypeCstr, "SessionNotificationEvent"))
+ else if (!stricmp(eventTypeCstr, "SessionNotificationEvent"))
{
//TODO: This probably is not received any more, it was used to support SLim clients
LLVivoxVoiceClient::getInstance()->sessionNotificationEvent(sessionHandle, uriString, notificationType);
@@ -7755,23 +7739,23 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
}
else if (!stricmp(actionCstr, "Session.Create.1"))
{
- LLVivoxVoiceClient::getInstance()->sessionCreateResponse(requestId, statusCode, statusString, sessionHandle);
+ LLVivoxVoiceClient::getInstance()->sessionCreateResponse(requestId, statusCode, statusString, sessionHandle);
}
else if (!stricmp(actionCstr, "SessionGroup.AddSession.1"))
{
- LLVivoxVoiceClient::getInstance()->sessionGroupAddSessionResponse(requestId, statusCode, statusString, sessionHandle);
+ LLVivoxVoiceClient::getInstance()->sessionGroupAddSessionResponse(requestId, statusCode, statusString, sessionHandle);
}
else if (!stricmp(actionCstr, "Session.Connect.1"))
{
- LLVivoxVoiceClient::getInstance()->sessionConnectResponse(requestId, statusCode, statusString);
+ LLVivoxVoiceClient::getInstance()->sessionConnectResponse(requestId, statusCode, statusString);
}
else if (!stricmp(actionCstr, "Account.Logout.1"))
{
- LLVivoxVoiceClient::getInstance()->logoutResponse(statusCode, statusString);
+ LLVivoxVoiceClient::getInstance()->logoutResponse(statusCode, statusString);
}
else if (!stricmp(actionCstr, "Connector.InitiateShutdown.1"))
{
- LLVivoxVoiceClient::getInstance()->connectorShutdownResponse(statusCode, statusString);
+ LLVivoxVoiceClient::getInstance()->connectorShutdownResponse(statusCode, statusString);
}
else if (!stricmp(actionCstr, "Account.GetSessionFonts.1"))
{
@@ -7800,75 +7784,75 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
}
else if (!stricmp(actionCstr, "Connector.AccountCreate.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Connector.MuteLocalMic.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Connector.MuteLocalSpeaker.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Connector.SetLocalMicVolume.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Connector.SetLocalSpeakerVolume.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Session.ListenerSetPosition.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Session.SpeakerSetPosition.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Session.AudioSourceSetPosition.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Session.GetChannelParticipants.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelCreate.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelUpdate.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelDelete.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelCreateAndInvite.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelFolderCreate.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelFolderUpdate.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelFolderDelete.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelAddModerator.1"))
{
-
+
}
else if (!stricmp(actionCstr, "Account.ChannelDeleteModerator.1"))
{
-
+
}
*/
}
@@ -7886,7 +7870,7 @@ LLVivoxSecurity::LLVivoxSecurity()
random_value[b] = ll_rand() & 0xff;
}
mConnectorHandle = LLBase64::encode(random_value, VIVOX_TOKEN_BYTES);
-
+
for (int b = 0; b < VIVOX_TOKEN_BYTES; b++)
{
random_value[b] = ll_rand() & 0xff;