From e33a9a53efe1c432f24e51d4635a8969845a3e99 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 15 Oct 2015 17:28:09 +0200 Subject: [PATCH] prevent bad usage of linphone_core_accept_call_update() in case of late sdp offer/answer --- coreapi/linphonecore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index f02372874..ec82192f0 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3561,11 +3561,15 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call, * @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state). **/ int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ - if (call->state!=LinphoneCallUpdatedByRemote){ + if (call->state != LinphoneCallUpdatedByRemote){ ms_error("linphone_core_accept_update(): invalid state %s to call this function.", linphone_call_state_to_string(call->state)); return -1; } + if (call->expect_media_in_ack){ + ms_error("linphone_core_accept_call_update() is not possible during a late offer incoming reINVITE (INVITE without SDP)"); + return -1; + } return _linphone_core_accept_call_update(lc, call, params, call->prevstate, linphone_call_state_to_string(call->prevstate)); }