diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 99e23f777..f18976476 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -232,17 +232,13 @@ static bool_t already_a_call_with_remote_address(const LinphoneCore *lc, const L return FALSE; } -static bool_t already_a_call_pending(LinphoneCore *lc){ +static bool_t already_an_outgoing_call_pending(LinphoneCore *lc){ MSList *elem; for(elem=lc->calls;elem!=NULL;elem=elem->next){ LinphoneCall *call=(LinphoneCall*)elem->data; - if (call->state==LinphoneCallIncomingReceived - || call->state==LinphoneCallIncomingEarlyMedia - || call->state==LinphoneCallOutgoingInit + if (call->state==LinphoneCallOutgoingInit || call->state==LinphoneCallOutgoingProgress - || call->state==LinphoneCallOutgoingEarlyMedia - || call->state==LinphoneCallOutgoingRinging - || call->state==LinphoneCallIdle){ /*case of an incoming call for which ICE candidate gathering is pending.*/ + || call->state==LinphoneCallOutgoingRinging){ return TRUE; } } @@ -312,8 +308,8 @@ static void call_received(SalOp *h){ from_addr=linphone_address_new(sal_op_get_from(h)); to_addr=linphone_address_new(sal_op_get_to(h)); - if ((already_a_call_with_remote_address(lc,from_addr) && prevent_colliding_calls) || already_a_call_pending(lc)){ - ms_warning("Receiving another call while one is ringing or initiated, refusing this one with busy message."); + if ((already_a_call_with_remote_address(lc,from_addr) && prevent_colliding_calls) || already_an_outgoing_call_pending(lc)){ + ms_warning("Receiving a call while one is initiated, refusing this one with busy message."); sal_call_decline(h,SalReasonBusy,NULL); sal_op_release(h); linphone_address_destroy(from_addr);