call: ignore answerCall if already answered

Any client can try to answer a call multiple times. For example if dring
is running with the --auto-answer flag and the client set auto answer on
the daemon. This cause weird behavior like rotation not taken into account,
etc.

So, don't call answerCall if already answered.

Change-Id: Ibb967787aaf83e86a98fba7192810e86975304f1
This commit is contained in:
Sébastien Blin
2020-07-24 09:58:20 -04:00
committed by Adrien Béraud
parent db5abdd50b
commit 3dd52a4b11

View File

@ -975,6 +975,11 @@ Manager::answerCall(const std::string& call_id)
return false;
}
if (call->getConnectionState() != Call::ConnectionState::RINGING) {
// The call is already answered
return true;
}
// If ringing
stopTone();