From 1a32d8f8a5497291aedf33f7d98c1f08498914af Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 14 Jun 2010 21:32:46 +0200 Subject: [PATCH] fix bug when call not closed when an invite is accepted with a 200Ok directly --- coreapi/linphonecore.c | 4 ++-- coreapi/sal_eXosip2.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6e0221ccb..51171d9f5 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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; } } diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 8214e2516..69f746642 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -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();