diff --git a/linphone-app/src/components/calls/CallsListModel.cpp b/linphone-app/src/components/calls/CallsListModel.cpp index 758e11af6..47830ac14 100644 --- a/linphone-app/src/components/calls/CallsListModel.cpp +++ b/linphone-app/src/components/calls/CallsListModel.cpp @@ -202,9 +202,13 @@ void CallsListModel::launchVideoCall (const QString &sipAddress, const QString& CallModel::setRecordFile(params, Utils::coreStringToAppString(address->getUsername())); auto call = core->inviteAddressWithParams(address, params); - call->setSpeakerMuted(!enableSpeaker); - qInfo() << "Launch " << (enableVideo ? "video" : "audio") << " call; camera: " << enableCamera<< " speaker:" << enableSpeaker << ", micro:" << params->micEnabled() << ", layout:" << (int)layout; - CallModel::prepareTransfert(call, prepareTransfertAddress); + if(!call) + qWarning() << "Cannot initiate call. Maybe another one is currently done: delay the call."; + else{ + call->setSpeakerMuted(!enableSpeaker); + qInfo() << "Launch " << (enableVideo ? "video" : "audio") << " call; camera: " << enableCamera<< " speaker:" << enableSpeaker << ", micro:" << params->micEnabled() << ", layout:" << (int)layout; + CallModel::prepareTransfert(call, prepareTransfertAddress); + } } QVariantMap CallsListModel::launchChat(const QString &sipAddress, const int& securityLevel) const{ diff --git a/linphone-app/ui/modules/Linphone/Calls/Calls.js b/linphone-app/ui/modules/Linphone/Calls/Calls.js index aa33c8f0e..76aba5aac 100644 --- a/linphone-app/ui/modules/Linphone/Calls/Calls.js +++ b/linphone-app/ui/modules/Linphone/Calls/Calls.js @@ -157,6 +157,7 @@ function getParams (call) { } function updateSelectedCall (call, index) { + console.debug('updateSelectedCall: '+call + ' / ' +index) if(index != undefined){ calls._selectedCall = call ? call : null if (index != null) { @@ -185,6 +186,7 @@ function setIndexWithCall (call) { for (var i = 0; i < count; i++) { if (call === model.data(model.index(i, 0))) { + console.debug('setIndexWithCall: '+call + ' / ' +i) updateSelectedCall(call, i) return } @@ -212,16 +214,19 @@ function handleCountChanged (count) { if(model){// Choose one call var candidate = getCallToStatusCondition(model, Linphone.CallModel.CallStatusConnected) if(candidate && candidate.callModel.isOutgoing) { + console.debug('handleCountChanged: '+candidate.callModel+ ' / ' +candidate.index) updateSelectedCall(candidate.callModel, candidate.index) return; } candidate = getCallToStatusCondition(model, Linphone.CallModel.CallStatusOutgoing) if(candidate){ + console.debug('handleCountChanged: '+candidate.callModel+ ' / ' +candidate.index) updateSelectedCall(candidate.callModel, candidate.index) return; } candidate = getCallToStatusCondition(model, Linphone.CallModel.CallStatusPaused) if(candidate){ + console.debug('handleCountChanged: '+candidate.callModel+ ' / ' +candidate.index) updateSelectedCall(candidate.callModel, candidate.index) return; }else @@ -231,11 +236,13 @@ function handleCountChanged (count) { if(model){// Select a call that has been localy initiated. var candidate = getCallToStatusCondition(model, Linphone.CallModel.CallStatusConnected) if(candidate && candidate.callModel.isOutgoing) { + console.debug('handleCountChanged: '+candidate.callModel+ ' / ' +candidate.index) updateSelectedCall(candidate.callModel, candidate.index) return; } candidate = getCallToStatusCondition(model, Linphone.CallModel.CallStatusOutgoing) if(candidate){ + console.debug('handleCountChanged: '+candidate.callModel+ ' / ' +candidate.index) updateSelectedCall(candidate.callModel, candidate.index) return; } @@ -269,7 +276,8 @@ function handleRowsInserted (_, first, last) { var call = model.data(model.index(index, 0)) if (call.isOutgoing && !call.isInConference) { - updateSelectedCall(call) + console.debug('handleRowsInserted: '+call+ ' / ' +index +' / ' +model.index(index, 0)) + updateSelectedCall(call, index) return } } @@ -278,7 +286,8 @@ function handleRowsInserted (_, first, last) { if (first === 0 && model.rowCount() === 1) { var call = model.data(model.index(0, 0)) if (!call.isInConference) { - updateSelectedCall(model.data(model.index(0, 0))) + console.debug('handleRowsInserted: '+model.data(model.index(0, 0))+ ' / 0 / ' +model.index(0, 0)) + updateSelectedCall(model.data(model.index(0, 0)),0) } } } diff --git a/linphone-app/ui/views/App/Calls/CallsWindow.js b/linphone-app/ui/views/App/Calls/CallsWindow.js index ef92493c2..4be6d8c78 100644 --- a/linphone-app/ui/views/App/Calls/CallsWindow.js +++ b/linphone-app/ui/views/App/Calls/CallsWindow.js @@ -69,31 +69,40 @@ function openWaitingRoom(model){ function getContent (call, conferenceInfoModel) { if (call == null) { if(conferenceInfoModel) { + console.debug('New Content:' +waitingRoom) return waitingRoom } else{ + console.debug('New Content: null') return null } } var status = call.status if (status == null) { - return calls.conferenceModel.count > 0 ? conference : null + var contentView = calls.conferenceModel.count > 0 ? conference : null + console.debug('New Content: ' +contentView) + return contentView } var CallModel = Linphone.CallModel if (status === CallModel.CallStatusIncoming) { + console.debug('New Content: ' +incall) return incall; } if( window.conferenceInfoModel != call.conferenceInfoModel) { Qt.callLater(function(){window.conferenceInfoModel = call.conferenceInfoModel}) + console.debug('New Content: ' +middlePane.sourceComponent) return middlePane.sourceComponent // unchange. Wait for later decision on conference model (avoid binding loop on sourceComponent) }else{ if(call.isConference){ + console.debug('New Content: ' +incall) return incall } if (status === CallModel.CallStatusOutgoing || (status === CallModel.CallStatusEnded && call.callError != '' )) { + console.debug('New Content: ' +waitingRoom) return waitingRoom } + console.debug('New Content: ' +incall) return incall } }