From a8078ca9b0eb1f6ee84866fc5849dcc071117b83 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 3 Feb 2017 17:11:57 +0100 Subject: [PATCH] add checks and fix bug where a call is directly transitionned to Released state when an io error occurs during a reINVITE. --- coreapi/bellesip_sal/sal_op_call.c | 10 +++++++--- tester/call_video_tester.c | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index a1af4e050..e3d5571e4 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -149,11 +149,15 @@ static void call_process_io_error(void *user_ctx, const belle_sip_io_error_event if (op->state == SalOpStateTerminated) return; if (op->pending_client_trans && (belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(op->pending_client_trans)) == BELLE_SIP_TRANSACTION_INIT)) { - /* Call terminated very very early, before INVITE is even sent, probably DNS resolution timeout. */ + sal_error_info_set(&op->error_info, SalReasonIOError, 503, "IO error", NULL); op->base.root->callbacks.call_failure(op); - op->state = SalOpStateTerminating; - call_set_released(op); + + if (!op->dialog || belle_sip_dialog_get_state(op->dialog) != BELLE_SIP_DIALOG_CONFIRMED){ + /* Call terminated very very early, before INVITE is even sent, probably DNS resolution timeout. */ + op->state = SalOpStateTerminating; + call_set_released(op); + } } else { /* Nothing to be done. If the error comes from a connectivity loss, * the call will be marked as broken, and an attempt to repair it will be done. */ diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index 7cd5179b7..5e102029d 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -983,6 +983,11 @@ static void _call_with_ice_video(LinphoneVideoPolicy caller_policy, LinphoneVide /* Wait for ICE reINVITEs to complete. */ BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 2) && wait_for(pauline->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 2)); + if (callee_policy.automatically_accept == FALSE){ + marie_remote_params = linphone_call_get_remote_params(linphone_core_get_current_call(marie->lc)); + /*The ICE reINVITE must not propose again video if was refused by callee*/ + BC_ASSERT_FALSE(linphone_call_params_video_enabled(marie_remote_params)); + } BC_ASSERT_TRUE(check_ice(pauline, marie, LinphoneIceStateHostConnection)); BC_ASSERT_TRUE(check_nb_media_starts(pauline, marie, nb_media_starts, nb_media_starts));