fix bug regarding calls that might be accepted while the application already declined it

This commit is contained in:
Simon Morlat 2011-05-30 12:32:47 +02:00
parent db00bf2a3e
commit 68fa025802
2 changed files with 8 additions and 7 deletions

View file

@ -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
*/

View file

@ -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;