From b0729218028f8d46d701505a525eac4702d16b8c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 3 Feb 2011 14:00:23 +0100 Subject: [PATCH] multicall bugfixes again --- coreapi/callbacks.c | 18 +++++++++++++++--- coreapi/offeranswer.c | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index ab48f8837..62cf00835 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -305,16 +305,28 @@ static void call_accepted(SalOp *op){ linphone_core_update_streams (lc,call,md); linphone_call_set_state(call,LinphoneCallPausedByRemote,"Call paused by remote"); }else{ - if (lc->vtable.display_status){ - lc->vtable.display_status(lc,_("Call answered - connected.")); - } if (call->state==LinphoneCallStreamsRunning){ /*media was running before, the remote as acceted a call modification (that is a reinvite made by us. We must notify the application this reinvite was accepted*/ linphone_call_set_state(call, LinphoneCallUpdated, "Call updated"); + }else{ + if (call->state==LinphoneCallResuming){ + if (lc->vtable.display_status){ + lc->vtable.display_status(lc,_("Call resumed.")); + } + }else{ + if (lc->vtable.display_status){ + char *tmp=linphone_call_get_remote_address_as_string (call); + char *msg=ms_strdup_printf(_("Call answered by %s."),tmp); + lc->vtable.display_status(lc,msg); + ms_free(tmp); + ms_free(msg); + } + } } linphone_core_update_streams (lc,call,md); linphone_call_set_state(call, LinphoneCallStreamsRunning, "Streams running"); + lc->current_call=call; } }else{ /*send a bye*/ diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index aea3f87e7..6a221c98b 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -129,9 +129,9 @@ static SalStreamDir compute_dir_incoming(SalStreamDir local, SalStreamDir offere if (local==SalStreamSendRecv){ if (offered==SalStreamSendOnly) res=SalStreamRecvOnly; - if (offered==SalStreamRecvOnly) + else if (offered==SalStreamRecvOnly) res=SalStreamSendOnly; - if (offered==SalStreamInactive) + else if (offered==SalStreamInactive) res=SalStreamInactive; else res=SalStreamSendRecv;