mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 06:09:39 +00:00
make sure terminate call does nothing if call in state LinphoneCallReleased or LinphoneCallEnd
This commit is contained in:
parent
b90047b03f
commit
4a395bfb72
1 changed files with 17 additions and 5 deletions
|
|
@ -3269,14 +3269,26 @@ int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *the_call)
|
|||
{
|
||||
call = the_call;
|
||||
}
|
||||
switch (call->state) {
|
||||
case LinphoneCallReleased:
|
||||
case LinphoneCallEnd:
|
||||
ms_warning("No need to terminate a call [%p] in sate [%s]",call,linphone_call_state_to_string(call->state));
|
||||
return -1;
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
return linphone_core_decline_call(lc,call,LinphoneReasonDeclined);
|
||||
case LinphoneCallOutgoingInit: {
|
||||
/* In state OutgoingInit, op has to be destroyed */
|
||||
sal_op_release(call->op);
|
||||
call->op = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (call->state != LinphoneCallOutgoingInit)
|
||||
default:
|
||||
sal_call_terminate(call->op);
|
||||
else {
|
||||
/* In state OutgoingInit, op has to be destroyed */
|
||||
sal_op_release(call->op);
|
||||
call->op = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
terminate_call(lc,call);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue