diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llvoicechannel.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvoiceclient.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 30 | ||||
| -rw-r--r-- | indra/newview/llvoicewebrtc.h | 2 | 
4 files changed, 28 insertions, 13 deletions
| diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 10cccb3671..a009641a34 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -460,7 +460,7 @@ void LLVoiceChannelGroup::setChannelInfo(const LLSD& channelInfo)  	if (mState == STATE_NO_CHANNEL_INFO)  	{ -		if(mChannelInfo.isUndefined()) +		if(!mChannelInfo.isUndefined())  		{  			setState(STATE_READY); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 3df94d8ba0..087c93a3f5 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -513,7 +513,12 @@ LLVoiceP2PIncomingCallInterfacePtr LLVoiceClient::getIncomingCallInterface(const  // outgoing calls  LLVoiceP2POutgoingCallInterface *LLVoiceClient::getOutgoingCallInterface(const LLSD& voiceChannelInfo)  { -    LLVoiceModuleInterface *module = getVoiceModule(voiceChannelInfo["voice_server_type"].asString()); +    std::string voiceServerType = gSavedSettings.getString("VoiceServerType"); +    if (voiceChannelInfo.has("voice_server_type")) +    { +        voiceServerType = voiceChannelInfo["voice_server_type"].asString(); +    } +    LLVoiceModuleInterface *module = getVoiceModule(voiceServerType);      return dynamic_cast<LLVoiceP2POutgoingCallInterface *>(module);  } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 791c733dcc..093f0a6d29 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -575,10 +575,8 @@ void LLWebRTCVoiceClient::voiceConnectionCoro()                  // leave channel can be called again and again without adverse effects.                  // it merely tells channels to shut down if they're not already doing so.                  leaveChannel(false); -                continue;              } - -            if (inSpatialChannel()) +            else if (inSpatialChannel())              {                  // add session for region or parcel voice.                  if (!regionp || regionp->getRegionID().isNull()) @@ -637,7 +635,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro()              }              sessionState::processSessionStates(); -            if (voiceEnabled) +            if (mProcessChannels && voiceEnabled)              {                  sendPositionUpdate(true);                  updateOwnVolume(); @@ -1274,8 +1272,9 @@ bool LLWebRTCVoiceClient::startParcelSession(const std::string &channelID, S32 p  bool LLWebRTCVoiceClient::startAdHocSession(const LLSD& channelInfo, bool hangup_on_last_leave)  {      leaveChannel(false); -    std::string channelID = channelInfo["channel"]; -    std::string credentials = channelInfo["credentials"]; +    LL_WARNS("Voice") << "Start AdHoc Session " << channelInfo << LL_ENDL; +    std::string channelID = channelInfo["channel_uri"]; +    std::string credentials = channelInfo["channel_credentials"];      mNextSession = addSession(channelID, sessionState::ptr_t(new adhocSessionState(channelID, credentials, hangup_on_last_leave)));      return true;  } @@ -1452,7 +1451,7 @@ bool LLWebRTCVoiceClient::inSpatialChannel()  	return result;  } -std::string LLWebRTCVoiceClient::getAudioSessionChannelInfo() +LLSD LLWebRTCVoiceClient::getAudioSessionChannelInfo()  {      LLSD result; @@ -1644,8 +1643,17 @@ void LLWebRTCVoiceClient::leaveChannel(bool stopTalking)  bool LLWebRTCVoiceClient::isCurrentChannel(const LLSD &channelInfo)  { -    return (channelInfo["voice_server_type"].asString() == WEBRTC_VOICE_SERVER_TYPE) && -           (sessionState::hasSession(channelInfo["session_handle"].asString())); +    if (channelInfo["voice_server_type"].asString() != WEBRTC_VOICE_SERVER_TYPE) +        return false; +    if (mSession) +    { +        if (!channelInfo["sessionHandle"].asString().empty()) +        { +            return mSession->mHandle == channelInfo["session_handle"].asString(); +        } +        return channelInfo["channel_uri"].asString() == mSession->mChannelID; +    } +    return false;  }  bool LLWebRTCVoiceClient::compareChannels(const LLSD &channelInfo1, const LLSD &channelInfo2) @@ -2248,12 +2256,13 @@ void LLWebRTCVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESt      mIsProcessingChannels = status == LLVoiceClientStatusObserver::STATUS_JOINED; +    LLSD channelInfo = getAudioSessionChannelInfo();  	for (status_observer_set_t::iterator it = mStatusObservers.begin();  		it != mStatusObservers.end();  		)  	{  		LLVoiceClientStatusObserver* observer = *it; -		observer->onChange(status, getAudioSessionChannelInfo(), inSpatialChannel()); +		observer->onChange(status, channelInfo, inSpatialChannel());  		// In case onError() deleted an entry.  		it = mStatusObservers.upper_bound(observer);  	} @@ -3151,6 +3160,7 @@ bool LLVoiceWebRTCAdHocConnection::requestVoiceConnection()      body["credentials"] = mCredentials;      body["channel"] = mChannelID;      body["channel_type"] = "multiagent"; +    body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;      LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(          url, diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 0bfbca8079..104331f44e 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -612,7 +612,7 @@ private:      bool inOrJoiningChannel(const std::string &channelID);      bool inEstateChannel(); -	std::string getAudioSessionChannelInfo(); +	LLSD getAudioSessionChannelInfo();      void setHidden(bool hidden) override; //virtual | 
