diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 4230a156b..ab521aa7f 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -223,7 +223,6 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro /* this function is called internally to get rid of a call. It performs the following tasks: - remove the call from the internal list of calls - - unref the LinphoneCall object - update the call logs accordingly */ diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 33ef079c9..869a7d8bb 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -1015,13 +1015,12 @@ static void update_contact_from_response(SalOp *op, osip_message_t *response){ static int call_proceeding(Sal *sal, eXosip_event_t *ev){ SalOp *op=find_op(sal,ev); - - if (op==NULL) { + + if (op==NULL || op->terminated==TRUE) { ms_warning("This call has been canceled."); eXosip_lock(); eXosip_call_terminate(ev->cid,ev->did); eXosip_unlock(); - op->terminated=TRUE; return -1; } if (ev->did>0) @@ -1056,9 +1055,12 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){ SalOp *op=find_op(sal,ev); const char *contact; - if (op==NULL){ - ms_error("A closed call is accepted ?"); - return; + if (op==NULL || op->terminated==TRUE) { + ms_warning("This call has been already terminated."); + eXosip_lock(); + eXosip_call_terminate(ev->cid,ev->did); + eXosip_unlock(); + return ; } op->did=ev->did;