summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 189ed54993..25df528d89 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -153,6 +153,7 @@ static bool sMuteListListener_listening = false;
///////////////////////////////////////////////////////////////////////////////////////////////
static LLProcessPtr sGatewayPtr;
+static LLEventStream sGatewayPump("VivoxDaemonPump", true);
static bool isGatewayRunning()
{
@@ -163,6 +164,7 @@ static void killGateway()
{
if (sGatewayPtr)
{
+ sGatewayPump.stopListening("VivoxDaemonPump");
sGatewayPtr->kill();
}
}
@@ -599,6 +601,19 @@ bool LLVivoxVoiceClient::endAndDisconnectSession()
return true;
}
+bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data)
+{
+ if (!LLAppViewer::isExiting())
+ {
+ terminateAudioSession(false);
+ closeSocket();
+ cleanUp();
+ LLVoiceClient::getInstance()->setUserPTTState(false);
+ gAgent.setVoiceConnected(false);
+ }
+ sGatewayPump.stopListening("VivoxDaemonPump");
+ return false;
+}
bool LLVivoxVoiceClient::startAndLaunchDaemon()
{
@@ -670,6 +685,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
params.args.add(LLVivoxSecurity::getInstance()->connectorHandle());
# endif // VIVOX_HANDLE_ARGS
+ params.postend = sGatewayPump.getName();
+ sGatewayPump.listen("VivoxDaemonPump", boost::bind(&LLVivoxVoiceClient::callbackEndDaemon, this, _1));
+
sGatewayPtr = LLProcess::create(params);
mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort"));
@@ -764,15 +782,13 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
llcoro::suspend();
}
- LLViewerRegion *region = gAgent.getRegion();
-
- while (!region->capabilitiesReceived())
+ while (!gAgent.getRegion()->capabilitiesReceived())
{
// *TODO* Pump a message for wake up.
llcoro::suspend();
}
- std::string url = region->getCapability("ProvisionVoiceAccountRequest");
+ std::string url = gAgent.getRegionCapability("ProvisionVoiceAccountRequest");
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t