Commit e24be286 authored by Andrea Gianarda's avatar Andrea Gianarda
Browse files

transfer call to focus only if the focus call is in UpdatedByRemote or...

transfer call to focus only if the focus call is in UpdatedByRemote or Connected or StreamsRunning state
parent d3c7dfde
......@@ -1493,13 +1493,17 @@ void RemoteConference::onPendingCallStateChanged (std::shared_ptr<LinphonePrivat
switch (callState) {
case LinphoneCallStreamsRunning:
case LinphoneCallPaused:
if (state == ConferenceInterface::State::Created) {
{
CallSession::State focusCallState = m_focusCall->getState();
// Transfer call to focus is the conference is in creation pending or created state and if the focus call is in connected, streams running or updated by remote state
if (((focusCallState == CallSession::State::StreamsRunning) || (focusCallState == CallSession::State::Connected) || (focusCallState == CallSession::State::UpdatedByRemote)) && ((getState() == ConferenceInterface::State::CreationPending) || (state == ConferenceInterface::State::Created))) {
// Transfer call only if focus call remote contact address is available (i.e. the call has been correctly established and passed through state StreamsRunning)
if (m_focusCall && (m_focusCall->getRemoteContact().empty() == false)) {
m_pendingCalls.remove(call);
transferToFocus(call);
}
}
}
break;
case LinphoneCallError:
case LinphoneCallEnd:
......
......@@ -170,8 +170,11 @@ void CallSessionPrivate::executePendingActions() {
void CallSessionPrivate::setTransferState (CallSession::State newState) {
L_Q();
if (newState == transferState)
if (newState == transferState) {
lError() << "Unable to change transfer state for CallSession [" << q << "] from ["
<< Utils::toString(transferState) << "] to [" << Utils::toString(newState) << "]";
return;
}
lInfo() << "Transfer state for CallSession [" << q << "] changed from ["
<< Utils::toString(transferState) << "] to [" << Utils::toString(newState) << "]";
transferState = newState;
......@@ -1361,8 +1364,10 @@ LinphoneStatus CallSession::transfer (const shared_ptr<CallSession> &dest) {
LinphoneStatus CallSession::transfer (const Address &address) {
L_D();
if (!address.isValid())
if (!address.isValid()) {
lError() << "Received invalid address " << address.asString() << " to transfer the call to";
return -1;
}
d->op->refer(address.asString().c_str());
d->setTransferState(CallSession::State::OutgoingInit);
return 0;
......
......@@ -1010,7 +1010,9 @@ static void simple_conference_with_subject_change_from_not_admin(void) {
BC_ASSERT_PTR_NOT_NULL(conference);
linphone_address_unref(uri);
BC_ASSERT_TRUE(strcmp(original_subject, linphone_conference_get_subject(conference)) == 0);
if (conference) {
BC_ASSERT_TRUE(strcmp(original_subject, linphone_conference_get_subject(conference)) == 0);
}
}
LinphoneAddress *pauline_uri = linphone_address_new(linphone_core_get_identity(pauline->lc));
......@@ -1033,6 +1035,7 @@ static void simple_conference_with_subject_change_from_not_admin(void) {
destroy_mgr_in_conference(marie);
destroy_mgr_in_conference(michelle);
linphone_conference_server_destroy(focus);
bctbx_list_free(all_manangers_in_conf);
bctbx_list_free(participants);
bctbx_list_free(lcs);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment