From c1ebfa171a7d52dde1e4b6bf43dab76117d7c3e4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 6 May 2016 15:18:47 +0200 Subject: [PATCH] make sure ice re-invite is disabled in case of DTLS --- cmake/FindIconv.cmake | 2 +- coreapi/linphonecall.c | 3 ++- tester/call_tester.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake index b0ae9013a..525bb330a 100644 --- a/cmake/FindIconv.cmake +++ b/cmake/FindIconv.cmake @@ -27,7 +27,7 @@ # ICONV_LIBRARIES - The libraries needed to use libiconv if(APPLE AND NOT IOS) - set(ICONV_HINTS "/usr") + set(ICONV_HINTS "${CMAKE_OSX_SYSROOT}/usr" "/usr") endif() if(ICONV_HINTS) set(ICONV_LIBRARIES_HINTS "${ICONV_HINTS}/lib") diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index e67ec9226..403a9c7b0 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4367,7 +4367,8 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ case IS_Failed: /* At least one ICE session has succeeded, so perform a call update. */ if (ice_session_has_completed_check_list(call->ice_session) == TRUE) { - if (ice_session_role(call->ice_session) == IR_Controlling && call->params->update_call_when_ice_completed ) { + const LinphoneCallParams *current_param = linphone_call_get_current_params(call); + if (ice_session_role(call->ice_session) == IR_Controlling && current_param->update_call_when_ice_completed ) { LinphoneCallParams *params = linphone_core_create_call_params(call->core, call); params->internal_call_update = TRUE; linphone_core_update_call(call->core, call, params); diff --git a/tester/call_tester.c b/tester/call_tester.c index 89e1b01a3..09c99a154 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -4266,6 +4266,41 @@ end: linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } +static void call_with_very_early_call_update(void) { + LinphoneCoreManager* marie; + LinphoneCoreManager* pauline; + LinphoneCallParams *params; + + marie = linphone_core_manager_new( "marie_rc"); + pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + linphone_core_invite_address(marie->lc,pauline->identity); + + BC_ASSERT_TRUE (wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallIncomingReceived,1)); + BC_ASSERT_TRUE(linphone_core_inc_invite_pending(pauline->lc)); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallOutgoingProgress,1, int, "%d"); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallOutgoingRinging,1)); + + BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call_remote_address(pauline->lc)); + if (linphone_core_get_current_call_remote_address(pauline->lc)) { + linphone_core_accept_call(pauline->lc,linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,1)); + } + + + params=linphone_core_create_call_params(pauline->lc,linphone_core_get_current_call(pauline->lc)); + linphone_core_update_call(pauline->lc,linphone_core_get_current_call(pauline->lc),params); + linphone_call_params_destroy(params); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallUpdating,1)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallUpdatedByRemote,1)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,2)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,2)); + end_call(marie,pauline); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + + static void call_with_in_dialog_codec_change_base(bool_t no_sdp) { int dummy=0; LinphoneCoreManager* marie; @@ -6392,6 +6427,7 @@ test_t call_tests[] = { TEST_NO_TAG("Call with no audio codec", call_with_no_audio_codec), TEST_NO_TAG("Video call with no audio and no video codec", video_call_with_no_audio_and_no_video_codec), TEST_NO_TAG("Call with in-dialog UPDATE request", call_with_in_dialog_update), + TEST_NO_TAG("Call with in-dialog very early call request", call_with_very_early_call_update), TEST_NO_TAG("Call with in-dialog codec change", call_with_in_dialog_codec_change), TEST_NO_TAG("Call with in-dialog codec change no sdp", call_with_in_dialog_codec_change_no_sdp), TEST_NO_TAG("Call with pause no SDP on resume", call_with_paused_no_sdp_on_resume),