fix bug when call not closed when an invite is accepted with a 200Ok directly

This commit is contained in:
Simon Morlat 2010-06-14 21:32:46 +02:00
parent 567cec3c40
commit 1a32d8f8a5
2 changed files with 12 additions and 4 deletions

View file

@ -2358,8 +2358,8 @@ int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *the_call)
LinphoneCall *call;
if (the_call == NULL){
call = linphone_core_get_current_call(lc);
if(call == NULL)
{
if(call == NULL){
ms_warning("No currently active call to terminate !");
return -1;
}
}

View file

@ -644,9 +644,13 @@ int sal_call_send_dtmf(SalOp *h, char dtmf){
}
int sal_call_terminate(SalOp *h){
int err;
eXosip_lock();
eXosip_call_terminate(h->cid,h->did);
err=eXosip_call_terminate(h->cid,h->did);
eXosip_unlock();
if (err!=0){
ms_warning("Exosip could not terminate the call: cid=%i did=%i", h->cid,h->did);
}
sal_remove_call(h->base.root,h);
h->cid=-1;
return 0;
@ -845,7 +849,8 @@ static int call_proceeding(Sal *sal, eXosip_event_t *ev){
eXosip_unlock();
return -1;
}
op->did=ev->did;
if (ev->did>0)
op->did=ev->did;
op->tid=ev->tid;
/* update contact if received and rport are set by the server
@ -879,6 +884,9 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){
ms_error("A closed call is accepted ?");
return;
}
if (op->did==-1){
op->did=ev->did;
}
sdp=eXosip_get_sdp_info(ev->response);
if (sdp){
op->base.remote_media=sal_media_description_new();