add offer answer test for payload types

This commit is contained in:
Simon Morlat 2017-09-22 15:01:14 +02:00
parent 76ccd7c138
commit 8b0a3f926e

View file

@ -105,6 +105,42 @@ static void simple_call_with_different_codec_mappings(void) {
linphone_core_manager_destroy(pauline);
}
static void simple_call_with_fmtps(void){
LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
LinphoneCall *pauline_call;
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new( "pauline_tcp_rc");
disable_all_audio_codecs_except_one(marie->lc,"pcmu",-1);
disable_all_audio_codecs_except_one(pauline->lc,"pcmu",-1);
/*marie set a fantasy fmtp to PCMU*/
linphone_payload_type_set_recv_fmtp(linphone_core_get_payload_type(marie->lc, "PCMU", 8000, -1), "parles-plus-fort=1");
BC_ASSERT_TRUE(call(marie,pauline));
pauline_call=linphone_core_get_current_call(pauline->lc);
BC_ASSERT_PTR_NOT_NULL(pauline_call);
if (pauline_call){
LinphonePayloadType *pt = linphone_call_params_get_used_audio_payload_type(linphone_call_get_current_params(pauline_call));
BC_ASSERT_PTR_NOT_NULL(pt);
if (pt){
BC_ASSERT_STRING_EQUAL(linphone_payload_type_get_send_fmtp(pt),"parles-plus-fort=1");
}
pt = linphone_call_params_get_used_audio_payload_type(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc)));
BC_ASSERT_PTR_NOT_NULL(pt);
if (pt){
ms_message("send_fmtp=%s, recv_fmtp=%s", linphone_payload_type_get_send_fmtp(pt), linphone_payload_type_get_recv_fmtp(pt));
BC_ASSERT_STRING_EQUAL(linphone_payload_type_get_recv_fmtp(pt),"parles-plus-fort=1");
}
}
end_call(marie,pauline);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void call_failed_because_of_codecs(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
@ -493,6 +529,7 @@ static test_t offeranswer_tests[] = {
TEST_NO_TAG("Start with no config", start_with_no_config),
TEST_NO_TAG("Call failed because of codecs", call_failed_because_of_codecs),
TEST_NO_TAG("Simple call with different codec mappings", simple_call_with_different_codec_mappings),
TEST_NO_TAG("Simple call with fmtps", simple_call_with_fmtps),
TEST_NO_TAG("AVP to AVP call", avp_to_avp_call),
TEST_NO_TAG("AVP to AVPF call", avp_to_avpf_call),
TEST_NO_TAG("AVP to SAVP call", avp_to_savp_call),