From 7c172b8af2683813b4fcd8dd34281e07a12f8cf8 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Fri, 18 Dec 2015 14:10:28 +0100 Subject: [PATCH] Adding tests for AVPF<=>implicit AVPF calls in call_tester. Fixinf error for feature implicit AVPF in sal_sdp.c and linphonecall.c --- coreapi/bellesip_sal/sal_sdp.c | 2 +- coreapi/linphonecall.c | 4 ++- tester/call_tester.c | 56 ++++++++++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/coreapi/bellesip_sal/sal_sdp.c b/coreapi/bellesip_sal/sal_sdp.c index 462316a26..7f38dffaa 100644 --- a/coreapi/bellesip_sal/sal_sdp.c +++ b/coreapi/bellesip_sal/sal_sdp.c @@ -832,7 +832,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md, sdp_parse_media_ice_parameters(media_desc, stream); /* Get RTCP-FB attributes if any */ - if (sal_stream_description_has_avpf(stream)) { + if (sal_stream_description_has_avpf(stream) || sal_stream_description_has_implicit_avpf(stream)) { enable_avpf_for_stream(stream); sdp_parse_rtcp_fb_parameters(media_desc, stream); } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 27385f850..7b749aaa9 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -526,7 +526,9 @@ static void setup_rtcp_fb(LinphoneCall *call, SalMediaDescription *md) { if (!sal_stream_description_active(&md->streams[i])) continue; md->streams[i].rtcp_fb.generic_nack_enabled = lp_config_get_int(lc->config, "rtp", "rtcp_fb_generic_nack_enabled", 0); md->streams[i].rtcp_fb.tmmbr_enabled = lp_config_get_int(lc->config, "rtp", "rtcp_fb_tmmbr_enabled", 0); - for (pt_it = md->streams[i].payloads; pt_it != NULL; pt_it = pt_it->next) { + md->streams[i].implicit_rtcp_fb = call->params->implicit_rtcp_fb; + + for (pt_it = md->streams[i].payloads; pt_it != NULL; pt_it = pt_it->next) { pt = (PayloadType *)pt_it->data; if (call->params->avpf_enabled == FALSE && call->params->implicit_rtcp_fb == FALSE) { diff --git a/tester/call_tester.c b/tester/call_tester.c index 3d4d30c9e..368edcc8f 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -2152,7 +2152,7 @@ static void video_call(void) { linphone_core_manager_destroy(pauline); } -static void video_call_disable_implicit_AVPF_on_rcv(void) { +static void video_call_disable_implicit_AVPF_on_callee(void) { LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); LpConfig *callee_lp; @@ -2170,8 +2170,57 @@ static void video_call_disable_implicit_AVPF_on_rcv(void) { linphone_core_manager_destroy(callee); linphone_core_manager_destroy(caller); +} + + +static void video_call_disable_implicit_AVPF_on_caller(void) { + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LpConfig *caller_lp; + const LinphoneCallParams *params, *params2; + + caller_lp = linphone_core_get_config(caller->lc); + lp_config_set_int(caller_lp,"rtp","rtcp_fb_implicit_rtcp_fb",0); + + video_call_base_3(caller,callee,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); + params = linphone_call_get_current_params(linphone_core_get_current_call(callee->lc)); + BC_ASSERT_STRING_EQUAL(linphone_call_params_get_rtp_profile(params), "RTP/AVP"); + params2 =linphone_call_get_current_params(linphone_core_get_current_call(caller->lc)); + BC_ASSERT_STRING_EQUAL(linphone_call_params_get_rtp_profile(params2), "RTP/AVP"); + end_call(caller, callee); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); + +} + +static void video_call_AVPF_to_implicit_AVPF(void) +{ + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + + linphone_core_set_avpf_mode(caller->lc,LinphoneAVPFEnabled); + video_call_base_3(caller,callee,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); + end_call(caller,callee); + + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); } + +static void video_call_implicit_AVPF_to_AVPF(void) +{ + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + + linphone_core_set_avpf_mode(callee->lc,LinphoneAVPFEnabled); + video_call_base_3(caller,callee,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); + end_call(caller,callee); + + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); + +} + static void video_call_base_avpf(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) { linphone_core_set_avpf_mode(pauline->lc,LinphoneAVPFEnabled); linphone_core_set_avpf_mode(marie->lc,LinphoneAVPFEnabled); @@ -5731,7 +5780,10 @@ test_t call_tests[] = { { "Audio call with ICE no matching audio codecs", audio_call_with_ice_no_matching_audio_codecs }, #ifdef VIDEO_ENABLED { "Simple video call AVPF",video_call_avpf}, - { "Simple video call disable implicit",video_call_disable_implicit_AVPF_on_rcv}, + { "Simple video call disable implicit AVPF on callee",video_call_disable_implicit_AVPF_on_callee}, + { "Simple video call disable implicit AVPF on caller",video_call_disable_implicit_AVPF_on_caller}, + { "Simple video call AVPF to implicit AVPF",video_call_AVPF_to_implicit_AVPF}, + { "Simple video call implicit AVPF to AVPF",video_call_implicit_AVPF_to_AVPF}, { "Simple video call",video_call}, { "Simple ZRTP video call",video_call_zrtp}, { "Simple DTLS video call",video_call_dtls},