fix: conditionals for audio-only

Change-Id: Ic2796d22258e37ad531aec4e638196915e35969e
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
This commit is contained in:
Nicolas Jager
2017-12-04 17:08:03 -05:00
committed by Guillaume Roguez
parent f8f13c8e64
commit 598caf5170
3 changed files with 5 additions and 3 deletions

View File

@ -526,7 +526,8 @@ RingAccount::onConnectedOutgoingCall(SIPCall& call, const std::string& to_id, Ip
sdp.setPublishedIP(addrSdp);
const bool created = sdp.createOffer(
getActiveAccountCodecInfoList(MEDIA_AUDIO),
getActiveAccountCodecInfoList(videoEnabled_ and call.isAudioOnly() ? MEDIA_NONE : MEDIA_VIDEO),
getActiveAccountCodecInfoList(videoEnabled_ and not call.isAudioOnly() ? MEDIA_VIDEO
: MEDIA_NONE),
getSrtpKeyExchange()
);

View File

@ -232,7 +232,7 @@ SIPAccount::newOutgoingCall(const std::string& toUrl, const std::map<std::string
const bool created = sdp.createOffer(
getActiveAccountCodecInfoList(MEDIA_AUDIO),
getActiveAccountCodecInfoList(videoEnabled_ ? MEDIA_VIDEO : MEDIA_NONE),
getActiveAccountCodecInfoList(videoEnabled_ and not call->isAudioOnly() ? MEDIA_VIDEO : MEDIA_NONE),
getSrtpKeyExchange()
);

View File

@ -231,7 +231,8 @@ SIPCall::SIPSessionReinvite()
sdp_->clearIce();
auto& acc = getSIPAccount();
if (not sdp_->createOffer(acc.getActiveAccountCodecInfoList(MEDIA_AUDIO),
acc.getActiveAccountCodecInfoList(acc.isVideoEnabled() ? MEDIA_VIDEO : MEDIA_NONE),
acc.getActiveAccountCodecInfoList(acc.isVideoEnabled() and not isAudioOnly() ? MEDIA_VIDEO
: MEDIA_NONE),
acc.getSrtpKeyExchange(),
getState() == CallState::HOLD))
return !PJ_SUCCESS;