From 03287d93cfea5841f7b927d97b8289bf7f8f5553 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 19 May 2015 12:38:13 +0200 Subject: [PATCH] tester: do not execute TLS tests when it is not available, and avoid using TLS when it is not necessary --- coreapi/proxy.c | 5 +- tester/CMakeLists.txt | 2 +- tester/Makefile.am | 2 +- tester/call_tester.c | 308 ++++----- tester/dtmf_tester.c | 25 +- tester/eventapi_tester.c | 8 +- tester/flexisip_tester.c | 337 ++++----- tester/liblinphone_tester.h | 3 +- tester/log_collection_tester.c | 41 +- tester/message_tester.c | 640 +++++++++--------- tester/multi_call.c | 16 +- tester/multicast_call_tester.c | 6 +- tester/offeranswer_tester.c | 6 +- tester/presence_tester.c | 2 +- tester/quality_reporting_tester.c | 10 +- tester/rcfiles/pauline_h264_rc | 4 +- tester/rcfiles/pauline_rc_rtcp_xr | 4 +- tester/rcfiles/pauline_tcp_rc | 2 +- tester/rcfiles/pauline_zrtp_aes256_rc | 4 +- tester/rcfiles/pauline_zrtp_b256_rc | 4 +- .../rcfiles/pauline_zrtp_srtpsuite_aes256_rc | 4 +- tester/register_tester.c | 417 ++++++------ tester/remote_provisioning_tester.c | 6 +- tester/tester.c | 8 +- .../{transport_tester.c => tunnel_tester.c} | 50 +- tester/video_tester.c | 6 +- 26 files changed, 996 insertions(+), 924 deletions(-) rename tester/{transport_tester.c => tunnel_tester.c} (85%) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 4283712d9..34fc86c2e 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -604,6 +604,7 @@ typedef struct dial_plan{ /* TODO: fill with information for all countries over the world*/ static dial_plan_t const dial_plans[]={ + //Country , iso country code, e164 country calling code, number length, international usual prefix {"Afghanistan" ,"AF" , "93" , 9 , "00" }, {"Albania" ,"AL" , "355" , 9 , "00" }, {"Algeria" ,"DZ" , "213" , 9 , "00" }, @@ -651,7 +652,7 @@ static dial_plan_t const dial_plans[]={ {"Congo Democratic Republic" ,"CD" , "243" , 9 , "00" }, {"Cook Islands" ,"CK" , "682" , 5 , "00" }, {"Costa Rica" ,"CR" , "506" , 8 , "00" }, - {"C�te d'Ivoire" ,"AD" , "225" , 8 , "00" }, + {"Cote d'Ivoire" ,"AD" , "225" , 8 , "00" }, {"Croatia" ,"HR" , "385" , 9 , "00" }, {"Cuba" ,"CU" , "53" , 8 , "119" }, {"Cyprus" ,"CY" , "357" , 8 , "00" }, @@ -780,7 +781,7 @@ static dial_plan_t const dial_plans[]={ {"Saint Vincent and the Grenadines","VC" , "1" , 10 , "011" }, {"Samoa" ,"WS" , "685" , 7 , "0" }, {"San Marino" ,"SM" , "378" , 10 , "00" }, - {"S�o Tom� and Pr�ncipe" ,"ST" , "239" , 7 , "00" }, + {"Sao Tome and Principe" ,"ST" , "239" , 7 , "00" }, {"Saudi Arabia" ,"SA" , "966" , 9 , "00" }, {"Senegal" ,"SN" , "221" , 9 , "00" }, {"Serbia" ,"RS" , "381" , 9 , "00" }, diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index 555f17ce9..6ab0a32ce 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -47,7 +47,7 @@ set(SOURCE_FILES setup_tester.c stun_tester.c tester.c - transport_tester.c + tunnel_tester.c upnp_tester.c video_tester.c ) diff --git a/tester/Makefile.am b/tester/Makefile.am index 86510d794..722d234ef 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -28,7 +28,7 @@ liblinphonetester_la_SOURCES = \ remote_provisioning_tester.c \ setup_tester.c \ stun_tester.c \ - transport_tester.c \ + tunnel_tester.c \ tester.c \ upnp_tester.c \ video_tester.c \ diff --git a/tester/call_tester.c b/tester/call_tester.c index e3ddacfc0..543bb820e 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -352,48 +352,50 @@ void simple_call_base(bool_t enable_multicast_recv_side) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); - /* with the account manager, we might lose the identity */ - marie_cfg = linphone_core_get_default_proxy_config(marie->lc); - marie_id = linphone_proxy_config_get_identity(marie_cfg); - { - LinphoneAddress* marie_addr = linphone_address_new(marie_id); - char* marie_tmp_id = NULL; - linphone_address_set_display_name(marie_addr, "Super Marie"); - marie_tmp_id = linphone_address_as_string(marie_addr); + /* with the account manager, we might lose the identity */ + marie_cfg = linphone_core_get_default_proxy_config(marie->lc); + marie_id = linphone_proxy_config_get_identity(marie_cfg); + { + LinphoneAddress* marie_addr = linphone_address_new(marie_id); + char* marie_tmp_id = NULL; + linphone_address_set_display_name(marie_addr, "Super Marie"); + marie_tmp_id = linphone_address_as_string(marie_addr); - linphone_proxy_config_edit(marie_cfg); - linphone_proxy_config_set_identity(marie_cfg,marie_tmp_id); - linphone_proxy_config_done(marie_cfg); + linphone_proxy_config_edit(marie_cfg); + linphone_proxy_config_set_identity(marie_cfg,marie_tmp_id); + linphone_proxy_config_done(marie_cfg); - ms_free(marie_tmp_id); - linphone_address_unref(marie_addr); - } + ms_free(marie_tmp_id); + linphone_address_unref(marie_addr); + } - linphone_core_enable_audio_multicast(pauline->lc,enable_multicast_recv_side); + linphone_core_enable_audio_multicast(pauline->lc,enable_multicast_recv_side); - BC_ASSERT_TRUE(call(marie,pauline)); - pauline_call=linphone_core_get_current_call(pauline->lc); - BC_ASSERT_PTR_NOT_NULL(pauline_call); - /*check that display name is correctly propagated in From */ - if (pauline_call){ - from=linphone_call_get_remote_address(linphone_core_get_current_call(pauline->lc)); - BC_ASSERT_PTR_NOT_NULL(from); - if (from){ - const char *dname=linphone_address_get_display_name(from); - BC_ASSERT_PTR_NOT_NULL(dname); - if (dname){ - BC_ASSERT_STRING_EQUAL(dname, "Super Marie"); + BC_ASSERT_TRUE(call(marie,pauline)); + pauline_call=linphone_core_get_current_call(pauline->lc); + BC_ASSERT_PTR_NOT_NULL(pauline_call); + /*check that display name is correctly propagated in From */ + if (pauline_call){ + from=linphone_call_get_remote_address(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_PTR_NOT_NULL(from); + if (from){ + const char *dname=linphone_address_get_display_name(from); + BC_ASSERT_PTR_NOT_NULL(dname); + if (dname){ + BC_ASSERT_STRING_EQUAL(dname, "Super Marie"); + } } } + + + liblinphone_tester_check_rtcp(marie,pauline); + end_call(marie,pauline); + linphone_core_manager_destroy(pauline); } - - - liblinphone_tester_check_rtcp(marie,pauline); - end_call(marie,pauline); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); leaked_objects=belle_sip_object_get_object_count()-begin; BC_ASSERT_TRUE(leaked_objects==0); @@ -416,7 +418,7 @@ static void call_with_timeouted_bye(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call(marie,pauline)); @@ -489,7 +491,7 @@ static void direct_call_over_ipv6(){ LCSipTransports pauline_transports; LinphoneAddress* pauline_dest = linphone_address_new("sip:[::1];transport=tcp"); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_tcp_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_enable_ipv6(marie->lc,TRUE); linphone_core_enable_ipv6(pauline->lc,TRUE); @@ -519,8 +521,8 @@ static void direct_call_over_ipv6(){ } static void call_outbound_with_multiple_proxy() { - LinphoneCoreManager* pauline = linphone_core_manager_new2( "pauline_rc", FALSE); LinphoneCoreManager* marie = linphone_core_manager_new2( "marie_rc", FALSE); + LinphoneCoreManager* pauline = linphone_core_manager_new2( "pauline_tcp_rc", FALSE); LinphoneProxyConfig* lpc = NULL; LinphoneProxyConfig* registered_lpc = linphone_proxy_config_new(); @@ -607,7 +609,7 @@ static void multiple_answers_call_with_media_relay(void) { /* Scenario is this: pauline calls marie, which is registered 2 times. * Both linphones answer at the same time, and only one should get the * call running, the other should be terminated */ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc" ); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc" ); LinphoneCoreManager* marie1 = linphone_core_manager_new( "marie_rc" ); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc" ); @@ -650,8 +652,8 @@ static void multiple_answers_call_with_media_relay(void) { } static void call_with_specified_codec_bitrate(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); const LinphoneCallStats *pauline_stats,*marie_stats; bool_t call_ok; char * codec = "opus"; @@ -703,8 +705,8 @@ end: static void simple_call_compatibility_mode(void) { char route[256]; - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCore* lc_marie=marie->lc; LinphoneCore* lc_pauline=pauline->lc; @@ -769,8 +771,8 @@ static void simple_call_compatibility_mode(void) { static void cancelled_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* out_call = linphone_core_invite_address(pauline->lc,marie->identity); linphone_call_ref(out_call); @@ -863,8 +865,8 @@ static void early_cancelled_call(void) { } static void cancelled_ringing_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* out_call = linphone_core_invite_address(pauline->lc,marie->identity); linphone_call_ref(out_call); @@ -882,8 +884,8 @@ static void cancelled_ringing_call(void) { } static void early_declined_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCallLog* out_call_log; LinphoneCall* out_call; @@ -923,8 +925,8 @@ static void call_busy_when_calling_self(void) { static void call_declined(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* in_call; LinphoneCall* out_call = linphone_core_invite_address(pauline->lc,marie->identity); @@ -948,8 +950,8 @@ static void call_declined(void) { } static void call_terminated_by_caller(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call(pauline,marie)); /*just to sleep*/ @@ -962,8 +964,8 @@ static void call_terminated_by_caller(void) { } static void call_with_no_sdp(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_enable_sdp_200_ack(marie->lc,TRUE); @@ -978,8 +980,8 @@ static void call_with_no_sdp(void) { } static void call_with_no_sdp_ack_without_sdp(void){ - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *call; linphone_core_enable_sdp_200_ack(marie->lc,TRUE); @@ -1097,8 +1099,8 @@ end: } static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); _call_with_ice_base(pauline,marie,caller_with_ice,callee_with_ice,random_ports); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); @@ -1109,8 +1111,8 @@ static void call_with_ice(void){ /*ICE is not expected to work in this case, however this should not crash*/ static void call_with_ice_no_sdp(void){ - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_enable_sdp_200_ack(pauline->lc,TRUE); @@ -1139,8 +1141,8 @@ static void not_ice_to_ice(void){ } static void call_with_custom_headers(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *call_marie,*call_pauline; LinphoneCallParams *params; const LinphoneCallParams *marie_remote_params; @@ -1210,8 +1212,8 @@ static void call_with_custom_headers(void) { } void call_paused_resumed_base(bool_t multicast) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* call_pauline; const rtp_stats_t * stats; bool_t call_ok; @@ -1267,8 +1269,8 @@ static void call_paused_resumed(void) { BC_ASSERT_TRUE(loss_percentage < 1.25 * params.loss_rate) static void call_paused_resumed_with_loss(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* call_pauline; const rtp_stats_t * stats; float loss_percentage; @@ -1327,8 +1329,8 @@ bool_t pause_call_1(LinphoneCoreManager* mgr_1,LinphoneCall* call_1,LinphoneCore } #if 0 void concurrent_paused_resumed_base() { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* call_pauline,call_marie; const rtp_stats_t * stats; @@ -1371,8 +1373,8 @@ void concurrent_paused_resumed_base() { } #endif static void call_paused_resumed_from_callee(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* call_marie; const rtp_stats_t * stats; bool_t call_ok; @@ -1410,7 +1412,7 @@ end: static void audio_call_with_ice_no_matching_audio_codecs(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *out_call; linphone_core_enable_payload_type(marie->lc, linphone_core_find_payload_type(marie->lc, "PCMU", 8000, 1), FALSE); /* Disable PCMU */ @@ -1560,8 +1562,8 @@ static bool_t remove_video(LinphoneCoreManager *caller, LinphoneCoreManager *cal } static void call_with_video_added(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; BC_ASSERT_TRUE((call_ok=call(pauline,marie))); @@ -1579,8 +1581,8 @@ end: } static void call_with_video_added_2(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; /*in this variant marie is already in automatically accept*/ LinphoneVideoPolicy marie_policy; @@ -1605,8 +1607,8 @@ end: } static void call_with_video_added_random_ports(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; linphone_core_set_audio_port(marie->lc,-1); @@ -1629,8 +1631,8 @@ end: static void call_with_several_video_switches(void) { int dummy = 0; - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; BC_ASSERT_TRUE(call_ok=call(pauline,marie)); @@ -1653,8 +1655,8 @@ end: static void srtp_call_with_several_video_switches(void) { int dummy = 0; - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; if (linphone_core_media_encryption_supported(marie->lc, LinphoneMediaEncryptionSRTP)) { @@ -1683,8 +1685,8 @@ end: } static void call_with_declined_video_base(bool_t using_policy) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* marie_call; LinphoneCall* pauline_call; LinphoneVideoPolicy marie_policy, pauline_policy; @@ -1827,16 +1829,16 @@ static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* ma BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1)); } static void video_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); video_call_base(marie,pauline,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } static void video_call_zrtp(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); if (linphone_core_media_encryption_supported(marie->lc,LinphoneMediaEncryptionZRTP)) { video_call_base(marie,pauline,FALSE,LinphoneMediaEncryptionZRTP,TRUE,TRUE); } else @@ -1846,8 +1848,8 @@ static void video_call_zrtp(void) { } static void video_call_dtls(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); if (linphone_core_media_encryption_supported(pauline->lc,LinphoneMediaEncryptionDTLS)) { video_call_base(marie,pauline,FALSE,LinphoneMediaEncryptionDTLS,TRUE,TRUE); } else @@ -1858,32 +1860,32 @@ static void video_call_dtls(void) { } static void video_call_using_policy(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); video_call_base(marie,pauline,TRUE,LinphoneMediaEncryptionNone,TRUE,TRUE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } static void video_call_using_policy_with_callee_video_disabled(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); video_call_base(marie,pauline,TRUE,LinphoneMediaEncryptionNone,FALSE,TRUE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } static void video_call_using_policy_with_caller_video_disabled(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); video_call_base(marie,pauline,TRUE,LinphoneMediaEncryptionNone,TRUE,FALSE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } static void video_call_no_sdp(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_enable_sdp_200_ack(pauline->lc,TRUE); video_call_base(pauline,marie,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); linphone_core_manager_destroy(marie); @@ -1891,8 +1893,8 @@ static void video_call_no_sdp(void) { } static void call_with_ice_video_to_novideo(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneVideoPolicy vpol={0}; vpol.automatically_initiate=TRUE; linphone_core_set_video_policy(pauline->lc,&vpol); @@ -1906,7 +1908,7 @@ static void call_with_ice_video_to_novideo(void) { static void _call_with_ice_video(LinphoneVideoPolicy caller_policy, LinphoneVideoPolicy callee_policy, bool_t video_added_by_caller, bool_t video_added_by_callee, bool_t video_removed_by_caller, bool_t video_removed_by_callee) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; linphone_core_set_video_policy(pauline->lc, &caller_policy); @@ -1974,7 +1976,7 @@ static void call_with_ice_video_added_and_refused(void) { static void video_call_with_early_media_no_matching_audio_codecs(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *out_call, *pauline_call; LinphoneVideoPolicy vpol={0}; @@ -2027,8 +2029,8 @@ end: } static void video_call_limited_bandwidth(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_set_download_bandwidth(pauline->lc, 100); video_call_base(marie,pauline,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); @@ -2045,8 +2047,8 @@ static void video_call_limited_bandwidth(void) { #endif /*VIDEO_ENABLED*/ static void _call_with_media_relay(bool_t random_ports) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok; linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); @@ -2085,8 +2087,8 @@ static void call_with_media_relay_random_ports(void) { } static void call_with_privacy(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *c1,*c2; LinphoneCallParams *params; LinphoneProxyConfig* pauline_proxy; @@ -2146,7 +2148,7 @@ static void call_with_privacy(void) { /*this ones makes call with privacy without previous registration*/ static void call_with_privacy2(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new2( "pauline_rc",FALSE); + LinphoneCoreManager* pauline = linphone_core_manager_new2(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc", FALSE); LinphoneCall *c1,*c2; LinphoneCallParams *params; LinphoneProxyConfig* pauline_proxy; @@ -2214,13 +2216,13 @@ static void zrtp_call() { static void zrtp_sas_call() { call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_b256_rc", "pauline_zrtp_b256_rc"); - call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_b256_rc", "pauline_rc"); + call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_b256_rc", "pauline_tcp_rc"); } static void zrtp_cipher_call() { call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_srtpsuite_aes256_rc", "pauline_zrtp_srtpsuite_aes256_rc"); call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_aes256_rc", "pauline_zrtp_aes256_rc"); - call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_aes256_rc", "pauline_rc"); + call_base_with_configfile(LinphoneMediaEncryptionZRTP,FALSE,FALSE,LinphonePolicyNoFirewall,FALSE, "marie_zrtp_aes256_rc", "pauline_tcp_rc"); } static void zrtp_video_call() { @@ -2251,8 +2253,8 @@ static void dtls_srtp_ice_video_call_with_relay() { } #endif static void call_with_declined_srtp(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); if (linphone_core_media_encryption_supported(marie->lc,LinphoneMediaEncryptionSRTP)) { linphone_core_set_media_encryption(pauline->lc,LinphoneMediaEncryptionSRTP); @@ -2273,8 +2275,8 @@ static void call_srtp_paused_and_resumed(void) { * This test was made to evidence a bug due to internal usage of current_params while not yet filled by linphone_call_get_current_params(). * As a result it must not use the call() function because it calls linphone_call_get_current_params(). */ - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); const LinphoneCallParams *params; LinphoneCall *pauline_call; @@ -2319,8 +2321,8 @@ static void on_eof(LinphonePlayer *player, void *user_data){ } static void call_with_file_player(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphonePlayer *player; char hellopath[256]; char *recordpath = create_filepath(bc_tester_writable_dir_prefix, "record-call_with_file_player", "wav"); @@ -2387,8 +2389,8 @@ static bool_t is_format_supported(LinphoneCore *lc, const char *fmt){ } static void call_with_mkv_file_player(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphonePlayer *player; char hellomkv[256]; char hellowav[256]; @@ -2558,7 +2560,7 @@ end: } void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel) { - call_base_with_configfile(mode, enable_video, enable_relay, policy, enable_tunnel, "marie_rc", "pauline_rc"); + call_base_with_configfile(mode, enable_video, enable_relay, policy, enable_tunnel, "marie_rc", "pauline_tcp_rc"); } #ifdef VIDEO_ENABLED @@ -2586,8 +2588,8 @@ static void dtls_ice_call_with_relay(void) { } static void early_media_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_early_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_early_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call(pauline,marie)); @@ -2612,7 +2614,7 @@ static void early_media_call(void) { static void early_media_call_with_ringing(void){ LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_tcp_rc"); MSList* lcs = NULL; LinphoneCall* marie_call; LinphoneCallLog *marie_call_log; @@ -2670,7 +2672,7 @@ static void early_media_call_with_ringing(void){ static void early_media_call_with_update_base(bool_t media_change){ LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); MSList* lcs = NULL; LinphoneCall *marie_call, *pauline_call; LinphoneCallParams *pauline_params; @@ -2756,8 +2758,8 @@ static void check_call_state(LinphoneCoreManager* mgr,LinphoneCallState state) { } static void call_established_with_rejected_info(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); int dummy=0; bool_t call_ok=FALSE; @@ -2790,8 +2792,8 @@ static void call_established_with_rejected_info(void) { static void call_established_with_rejected_reinvite(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok=FALSE; BC_ASSERT_TRUE(call_ok=call(pauline,marie)); @@ -2824,8 +2826,8 @@ static void call_established_with_rejected_reinvite(void) { } static void call_established_with_rejected_incoming_reinvite(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok=FALSE; BC_ASSERT_TRUE((call_ok=call(pauline,marie))); @@ -2864,7 +2866,7 @@ static void call_established_with_rejected_incoming_reinvite(void) { static void call_redirect(void){ LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new("laure_rc"); MSList* lcs = NULL; char *margaux_url = NULL; @@ -2917,8 +2919,8 @@ static void call_redirect(void){ } static void call_established_with_rejected_reinvite_with_error(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); bool_t call_ok=TRUE; BC_ASSERT_TRUE((call_ok=call(pauline,marie))); @@ -3195,11 +3197,11 @@ static void accept_call_in_send_base(bool_t caller_has_ice) { belle_sip_object_enable_leak_detector(TRUE); begin=belle_sip_object_get_object_count(); - pauline = linphone_core_manager_new("pauline_rc"); + marie = linphone_core_manager_new("marie_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); if (caller_has_ice) { linphone_core_set_firewall_policy(pauline->lc,LinphonePolicyUseIce); } - marie = linphone_core_manager_new("marie_rc"); lcs=ms_list_append(lcs,pauline->lc); lcs=ms_list_append(lcs,marie->lc); @@ -3237,8 +3239,8 @@ void two_accepted_call_in_send_only() { belle_sip_object_enable_leak_detector(TRUE); begin=belle_sip_object_get_object_count(); - pauline = linphone_core_manager_new("pauline_rc"); marie = linphone_core_manager_new("marie_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); laure = linphone_core_manager_new("laure_rc"); lcs=ms_list_append(lcs,pauline->lc); @@ -3345,7 +3347,7 @@ static void video_call_recording_test(void) { static void video_call_snapshot(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc); LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc); LinphoneCall *callInst = NULL; @@ -3387,7 +3389,7 @@ static void call_with_in_dialog_update(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call_ok=call(pauline,marie)); if (!call_ok) goto end; @@ -3425,7 +3427,7 @@ static void call_with_in_dialog_codec_change_base(bool_t no_sdp) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call_ok=call(pauline,marie)); if (!call_ok) goto end; @@ -3480,7 +3482,7 @@ static void call_with_custom_supported_tags(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_add_supported_tag(marie->lc,"pouet-tag"); BC_ASSERT_TRUE(call_ok=call(pauline,marie)); @@ -3505,8 +3507,8 @@ end: } static void call_log_from_taken_from_p_asserted_id(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall *c1,*c2; LinphoneCallParams *params; const char* paulie_asserted_id ="\"Paupauche\" "; @@ -3548,7 +3550,7 @@ end: } static void incoming_invite_with_invalid_sdp() { - LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* callee = linphone_core_manager_new( "marie_rc"); LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; @@ -3565,7 +3567,7 @@ static void incoming_invite_with_invalid_sdp() { } static void outgoing_invite_with_invalid_sdp() { - LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* callee = linphone_core_manager_new( "marie_rc"); LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; @@ -3585,7 +3587,7 @@ static void outgoing_invite_with_invalid_sdp() { static void incoming_reinvite_with_invalid_ack_sdp(){ #ifdef VIDEO_ENABLED - LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* callee = linphone_core_manager_new( "marie_rc"); LinphoneCall * inc_call; BC_ASSERT_TRUE(call(caller,callee)); @@ -3627,7 +3629,7 @@ static void incoming_reinvite_with_invalid_ack_sdp(){ static void outgoing_reinvite_with_invalid_ack_sdp() { #ifdef VIDEO_ENABLED - LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* callee = linphone_core_manager_new( "marie_rc"); LinphoneCall * out_call; BC_ASSERT_TRUE(call(caller,callee)); @@ -3677,7 +3679,7 @@ static void call_with_paused_no_sdp_on_resume() { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); BC_ASSERT_TRUE(call(pauline,marie)); liblinphone_tester_check_rtcp(marie,pauline); @@ -3725,7 +3727,7 @@ end: static void early_media_without_sdp_in_200_base( bool_t use_video, bool_t use_ice ){ LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); MSList* lcs = NULL; LinphoneCall* marie_call; LinphoneCallParams* params = NULL; @@ -3823,7 +3825,7 @@ static void call_with_generic_cn(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); remove(recorded_file); @@ -3904,7 +3906,7 @@ static void call_with_transport_change_base(bool_t succesfull_call) { v_table = linphone_core_v_table_new(); v_table->call_state_changed=call_state_changed_2; marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_add_listener(marie->lc,v_table); v_table = linphone_core_v_table_new(); v_table->call_state_changed=call_state_changed_3; @@ -3932,7 +3934,7 @@ static void call_with_transport_change_base(bool_t succesfull_call) { linphone_core_manager_destroy(pauline); leaked_objects=belle_sip_object_get_object_count()-begin; - BC_ASSERT_TRUE(leaked_objects==0); + BC_ASSERT_EQUAL(leaked_objects,0,int,"%d"); if (leaked_objects>0){ belle_sip_object_dump_active_objects(); } @@ -3959,7 +3961,7 @@ static void video_call_with_re_invite_inactive_followed_by_re_invite_base(Linpho begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_set_avpf_mode(pauline->lc,TRUE); linphone_core_set_video_device(pauline->lc,"Mire: Mire (synthetic moving picture)"); linphone_core_set_video_device(marie->lc,"Mire: Mire (synthetic moving picture)"); @@ -4044,8 +4046,8 @@ static void srtp_video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp ms_message("srtp_video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp skipped, missing srtp support"); } static void video_call_ice_params() { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); linphone_core_set_firewall_policy(pauline->lc,LinphonePolicyUseIce); @@ -4069,7 +4071,7 @@ static void simple_stereo_call(const char *codec_name, int clock_rate, int bitra begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); /*make sure we have opus*/ pt = linphone_core_find_payload_type(marie->lc, codec_name, clock_rate, 2); diff --git a/tester/dtmf_tester.c b/tester/dtmf_tester.c index 22d03837c..f26e75ddb 100644 --- a/tester/dtmf_tester.c +++ b/tester/dtmf_tester.c @@ -32,11 +32,16 @@ void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) { counters->dtmf_count++; } -void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq) { +void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq, bool_t use_opus) { char* expected = NULL; int dtmf_count_prev; marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new( "pauline_tcp_rc"); + + if (use_opus) { + disable_all_audio_codecs_except_one(marie->lc, "opus", 48000); + disable_all_audio_codecs_except_one(pauline->lc, "opus", 48000); + } linphone_core_set_use_rfc2833_for_dtmf(marie->lc, use_rfc2833); linphone_core_set_use_info_for_dtmf(marie->lc, use_sipinfo); @@ -95,22 +100,22 @@ void send_dtmf_cleanup() { } static void send_dtmf_rfc2833() { - send_dtmf_base(TRUE,FALSE,'1',NULL); + send_dtmf_base(TRUE,FALSE,'1',NULL,FALSE); send_dtmf_cleanup(); } static void send_dtmf_sip_info() { - send_dtmf_base(FALSE,TRUE,'#',NULL); + send_dtmf_base(FALSE,TRUE,'#',NULL,FALSE); send_dtmf_cleanup(); } static void send_dtmfs_sequence_rfc2833() { - send_dtmf_base(TRUE,FALSE,'\0',"1230#"); + send_dtmf_base(TRUE,FALSE,'\0',"1230#",FALSE); send_dtmf_cleanup(); } static void send_dtmfs_sequence_sip_info() { - send_dtmf_base(FALSE,TRUE,'\0',"1230#"); + send_dtmf_base(FALSE,TRUE,'\0',"1230#",FALSE); send_dtmf_cleanup(); } @@ -121,7 +126,7 @@ static void send_dtmfs_sequence_not_ready() { } static void send_dtmfs_sequence_call_state_changed() { - send_dtmf_base(FALSE,TRUE,'\0',NULL); + send_dtmf_base(FALSE,TRUE,'\0',NULL,FALSE); /*very long DTMF(around 4 sec to be sent)*/ linphone_call_send_dtmfs(marie_call, "123456789123456789"); @@ -138,6 +143,11 @@ static void send_dtmfs_sequence_call_state_changed() { send_dtmf_cleanup(); } +static void send_dtmf_rfc2833_opus() { + send_dtmf_base(TRUE,FALSE,'1',NULL,TRUE); + send_dtmf_cleanup(); +} + test_t dtmf_tests[] = { { "Send DTMF using RFC2833",send_dtmf_rfc2833}, { "Send DTMF using SIP INFO",send_dtmf_sip_info}, @@ -145,6 +155,7 @@ test_t dtmf_tests[] = { { "Send DTMF sequence using SIP INFO",send_dtmfs_sequence_sip_info}, { "DTMF sequence not sent if invalid call",send_dtmfs_sequence_not_ready}, { "DTMF sequence canceled if call state changed",send_dtmfs_sequence_call_state_changed}, + { "Send DTMF using RFC2833 using Opus",send_dtmf_rfc2833_opus}, }; test_suite_t dtmf_test_suite = { diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index 8ac8e2c18..d564f2f42 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -122,7 +122,7 @@ void linphone_publish_state_changed(LinphoneCore *lc, LinphoneEvent *ev, Linphon static void subscribe_test_declined(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneContent* content; LinphoneEvent *lev; const LinphoneErrorInfo *ei; @@ -164,7 +164,7 @@ typedef enum RefreshTestType{ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTestType refresh_type) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneContent* content; LinphoneEvent *lev; int expires= refresh_type!=NoRefresh ? 4 : 600; @@ -217,7 +217,7 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes static void subscribe_test_with_args2(bool_t terminated_by_subscriber, RefreshTestType refresh_type) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneContent* content; LinphoneEvent *lev; int expires= refresh_type!=NoRefresh ? 4 : 600; @@ -301,7 +301,7 @@ static void subscribe_test_manually_refreshed(void){ static void publish_test_with_args(bool_t refresh, int expires){ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneContent* content; LinphoneEvent *lev; MSList* lcs=ms_list_append(NULL,marie->lc); diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index 926221836..84f0d04c1 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -24,8 +24,8 @@ static void subscribe_forking(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - LinphoneCoreManager* pauline2 = linphone_core_manager_new( "pauline_tcp_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* pauline2 = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneContent* content; LinphoneEvent *lev; int expires= 600; @@ -59,8 +59,8 @@ static void subscribe_forking(void) { } static void message_forking(void) { - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,marie->lc); char* to = linphone_address_as_string(marie->identity); @@ -83,8 +83,8 @@ static void message_forking(void) { } static void message_forking_with_unreachable_recipients(void) { - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,marie->lc); @@ -125,8 +125,8 @@ static void message_forking_with_unreachable_recipients(void) { } static void message_forking_with_all_recipients_unreachable(void) { - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,marie->lc); @@ -175,8 +175,8 @@ static void message_forking_with_all_recipients_unreachable(void) { } static void call_forking(void){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -221,8 +221,8 @@ static void call_forking(void){ } static void call_forking_with_urgent_reply(void){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -266,8 +266,8 @@ static void call_forking_with_urgent_reply(void){ } static void call_forking_cancelled(void){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -306,8 +306,8 @@ static void call_forking_cancelled(void){ } static void call_forking_declined(bool_t declined_globaly){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -329,7 +329,7 @@ static void call_forking_declined(bool_t declined_globaly){ BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallIncomingReceived,1,1000)); BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallIncomingReceived,1,1000)); - /*marie1 finally declines the call*/ + /*marie finally declines the call*/ linphone_core_decline_call(marie->lc,linphone_core_get_current_call(marie->lc), declined_globaly ? LinphoneReasonDeclined : LinphoneReasonBusy ); @@ -370,8 +370,8 @@ static void call_forking_declined_localy(void){ static void call_forking_with_push_notification_single(void){ MSList* lcs; - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); @@ -412,8 +412,8 @@ static void call_forking_with_push_notification_single(void){ } static void call_forking_with_push_notification_multiple(void){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -430,7 +430,7 @@ static void call_forking_with_push_notification_multiple(void){ linphone_core_invite_address(pauline->lc,marie->identity); - /*marie1 will ring*/ + /*marie will ring*/ BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallIncomingReceived,1,5000)); /*pauline should hear ringback as well*/ BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,1000)); @@ -448,7 +448,7 @@ static void call_forking_with_push_notification_multiple(void){ BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallConnected,1,1000)); BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallStreamsRunning,1,1000)); - /*call to marie1 should be cancelled*/ + /*call to marie should be cancelled*/ BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,1000)); liblinphone_tester_check_rtcp(pauline,marie2); @@ -464,8 +464,8 @@ static void call_forking_with_push_notification_multiple(void){ } static void call_forking_not_responded(void){ - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc"); MSList* lcs=ms_list_append(NULL,pauline->lc); @@ -502,8 +502,8 @@ static void call_forking_not_responded(void){ } static void early_media_call_forking(void) { - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_tcp_rc"); - LinphoneCoreManager* marie1 = linphone_core_manager_new("marie_early_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new("marie_early_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new("marie_early_rc"); MSList *lcs=NULL; LinphoneCallParams *params=linphone_core_create_default_call_parameters(pauline->lc); @@ -516,37 +516,37 @@ static void early_media_call_forking(void) { pol.automatically_accept=1; pol.automatically_initiate=1; - linphone_core_set_user_agent(marie1->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL); linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); linphone_core_enable_video(pauline->lc,TRUE,TRUE); - linphone_core_enable_video(marie1->lc,TRUE,TRUE); - linphone_core_set_video_policy(marie1->lc,&pol); + linphone_core_enable_video(marie->lc,TRUE,TRUE); + linphone_core_set_video_policy(marie->lc,&pol); linphone_core_enable_video(marie2->lc,TRUE,TRUE); linphone_core_set_video_policy(marie2->lc,&pol); linphone_core_set_audio_port_range(marie2->lc,40200,40300); linphone_core_set_video_port_range(marie2->lc,40400,40500); - lcs=ms_list_append(lcs,marie1->lc); + lcs=ms_list_append(lcs,marie->lc); lcs=ms_list_append(lcs,marie2->lc); lcs=ms_list_append(lcs,pauline->lc); linphone_call_params_enable_early_media_sending(params,TRUE); linphone_call_params_enable_video(params,TRUE); - linphone_core_invite_address_with_params(pauline->lc,marie1->identity,params); + linphone_core_invite_address_with_params(pauline->lc,marie->identity,params); linphone_call_params_destroy(params); - BC_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000)); + BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000)); BC_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000)); BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallOutgoingEarlyMedia,1,3000)); BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallOutgoingEarlyMedia,1, int, "%d"); pauline_call=linphone_core_get_current_call(pauline->lc); - marie1_call=linphone_core_get_current_call(marie1->lc); + marie1_call=linphone_core_get_current_call(marie->lc); marie2_call=linphone_core_get_current_call(marie2->lc); /*wait a bit that streams are established*/ @@ -558,8 +558,8 @@ static void early_media_call_forking(void) { BC_ASSERT_GREATER(linphone_call_get_audio_stats(marie2_call)->download_bandwidth, 60, int, "%d"); BC_ASSERT_LOWER(linphone_call_get_audio_stats(marie2_call)->download_bandwidth, 99, int, "%d"); - linphone_core_accept_call(marie1->lc,linphone_core_get_current_call(marie1->lc)); - BC_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallStreamsRunning,1,3000)); + linphone_core_accept_call(marie->lc,linphone_core_get_current_call(marie->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,3000)); BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,3000)); /*marie2 should get her call terminated*/ @@ -574,85 +574,89 @@ static void early_media_call_forking(void) { linphone_core_terminate_all_calls(pauline->lc); BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,5000)); - BC_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallEnd,1,5000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,5000)); ms_list_free(lcs); - linphone_core_manager_destroy(marie1); + linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie2); linphone_core_manager_destroy(pauline); } static void call_with_sips(void){ - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_sips_rc"); - LinphoneCoreManager* pauline1 = linphone_core_manager_new( "pauline_sips_rc"); LinphoneCoreManager* pauline2 = linphone_core_manager_new( "pauline_tcp_rc"); - MSList* lcs=ms_list_append(NULL,marie->lc); + if (transport_supported(pauline2->lc, LinphoneTransportTls)) { + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_sips_rc"); + LinphoneCoreManager* pauline1 = linphone_core_manager_new( "pauline_sips_rc"); + MSList* lcs=ms_list_append(NULL,marie->lc); - lcs=ms_list_append(lcs,pauline1->lc); - lcs=ms_list_append(lcs,pauline2->lc); + lcs=ms_list_append(lcs,pauline1->lc); + lcs=ms_list_append(lcs,pauline2->lc); - linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); - linphone_core_set_user_agent(pauline1->lc,"Natted Linphone",NULL); - linphone_core_set_user_agent(pauline2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline1->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline2->lc,"Natted Linphone",NULL); - linphone_core_invite_address(marie->lc,pauline1->identity); + linphone_core_invite_address(marie->lc,pauline1->identity); - /*marie should hear ringback*/ - BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); - /*Only the sips registered device from pauline should ring*/ - BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallIncomingReceived,1,1000)); + /*marie should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*Only the sips registered device from pauline should ring*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallIncomingReceived,1,1000)); - /*pauline accepts the call */ - linphone_core_accept_call(pauline1->lc,linphone_core_get_current_call(pauline1->lc)); - BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallConnected,1,1000)); - BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallStreamsRunning,1,1000)); - BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallConnected,1,1000)); - BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + /*pauline accepts the call */ + linphone_core_accept_call(pauline1->lc,linphone_core_get_current_call(pauline1->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,1000)); - /*pauline2 should not have ring*/ - BC_ASSERT_EQUAL(pauline2->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + /*pauline2 should not have ring*/ + BC_ASSERT_EQUAL(pauline2->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); - linphone_core_terminate_call(pauline1->lc,linphone_core_get_current_call(pauline1->lc)); - BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallEnd,1,3000)); - BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,3000)); + linphone_core_terminate_call(pauline1->lc,linphone_core_get_current_call(pauline1->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_LinphoneCallEnd,1,3000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,3000)); - linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline1); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline1); + ms_list_free(lcs); + } linphone_core_manager_destroy(pauline2); - ms_list_free(lcs); } static void call_with_sips_not_achievable(void){ - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_sips_rc"); - LinphoneCoreManager* pauline1 = linphone_core_manager_new( "pauline_rc"); LinphoneCoreManager* pauline2 = linphone_core_manager_new( "pauline_tcp_rc"); - MSList* lcs=ms_list_append(NULL,marie->lc); - LinphoneAddress *dest; - LinphoneCall *call; - const LinphoneErrorInfo *ei; + if (transport_supported(pauline2->lc, LinphoneTransportTls)) { + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_sips_rc"); + LinphoneCoreManager* pauline1 = linphone_core_manager_new( "pauline_rc"); + MSList* lcs=ms_list_append(NULL,marie->lc); + LinphoneAddress *dest; + LinphoneCall *call; + const LinphoneErrorInfo *ei; - lcs=ms_list_append(lcs,pauline1->lc); - lcs=ms_list_append(lcs,pauline2->lc); + lcs=ms_list_append(lcs,pauline1->lc); + lcs=ms_list_append(lcs,pauline2->lc); - dest=linphone_address_clone(pauline1->identity); - linphone_address_set_secure(dest,TRUE); - call=linphone_core_invite_address(marie->lc,dest); - linphone_call_ref(call); - linphone_address_unref(dest); + dest=linphone_address_clone(pauline1->identity); + linphone_address_set_secure(dest,TRUE); + call=linphone_core_invite_address(marie->lc,dest); + linphone_call_ref(call); + linphone_address_unref(dest); - /*Call should be rejected by server with 480*/ - BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallError,1,6000)); - ei=linphone_call_get_error_info(call); - BC_ASSERT_PTR_NOT_NULL(ei); - if (ei){ - BC_ASSERT_EQUAL(linphone_error_info_get_reason(ei), LinphoneReasonTemporarilyUnavailable, int, "%d"); + /*Call should be rejected by server with 480*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallError,1,6000)); + ei=linphone_call_get_error_info(call); + BC_ASSERT_PTR_NOT_NULL(ei); + if (ei){ + BC_ASSERT_EQUAL(linphone_error_info_get_reason(ei), LinphoneReasonTemporarilyUnavailable, int, "%d"); + } + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline1); + ms_list_free(lcs); } - - linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline1); linphone_core_manager_destroy(pauline2); - ms_list_free(lcs); } static void call_with_ipv6(void) { @@ -675,7 +679,7 @@ static void call_with_ipv6(void) { liblinphone_tester_enable_ipv6(TRUE); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new( transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); @@ -714,78 +718,79 @@ static void call_with_ipv6(void) { } static void file_transfer_message_rcs_to_external_body_client(void) { - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneChatMessageCbs *cbs; - LinphoneContent* content; - FILE *file_to_send = NULL; - size_t file_size; - char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", bc_tester_read_dir_prefix); - char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", bc_tester_writable_dir_prefix); - LinphoneCoreManager* marie = linphone_core_manager_init( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneChatMessageCbs *cbs; + LinphoneContent* content; + FILE *file_to_send = NULL; + size_t file_size; + char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", bc_tester_read_dir_prefix); + char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", bc_tester_writable_dir_prefix); + LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); - linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); - linphone_core_manager_start(marie, "marie_rc", TRUE); + linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); + linphone_core_manager_start(marie, "marie_rc", TRUE); - linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); - linphone_core_manager_start(pauline, "pauline_rc", TRUE); + linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); + linphone_core_manager_start(pauline, "pauline_rc", TRUE); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - file_to_send = fopen(send_filepath, "rb"); - fseek(file_to_send, 0, SEEK_END); - file_size = ftell(file_to_send); - fseek(file_to_send, 0, SEEK_SET); - - /* Globally configure an http file transfer server. */ - linphone_core_set_file_transfer_server(pauline->lc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - ms_free(to); - /* create a file transfer message */ - content = linphone_core_create_content(pauline->lc); - linphone_content_set_type(content,"image"); - linphone_content_set_subtype(content,"jpeg"); - linphone_content_set_size(content,file_size); /*total size to be transfered*/ - linphone_content_set_name(content,"nowebcamCIF.jpg"); - message = linphone_chat_room_create_file_transfer_message(chat_room, content); - linphone_chat_message_set_user_data(message, file_to_send); - cbs = linphone_chat_message_get_callbacks(message); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ reset_counters(&marie->stat); reset_counters(&pauline->stat); - } - linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); - linphone_chat_room_send_chat_message(chat_room,message); - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageExtBodyReceived,1)); - fclose(file_to_send); - if (marie->stat.last_received_chat_message ) { - cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); - linphone_chat_message_download_file(marie->stat.last_received_chat_message); - } - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageFileTransferDone,1)); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1, int, "%d"); - BC_ASSERT_TRUE(compare_files(send_filepath, receive_filepath)); + file_to_send = fopen(send_filepath, "rb"); + fseek(file_to_send, 0, SEEK_END); + file_size = ftell(file_to_send); + fseek(file_to_send, 0, SEEK_SET); - linphone_content_unref(content); - linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); - ms_free(send_filepath); - ms_free(receive_filepath); + /* Globally configure an http file transfer server. */ + linphone_core_set_file_transfer_server(pauline->lc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + ms_free(to); + /* create a file transfer message */ + content = linphone_core_create_content(pauline->lc); + linphone_content_set_type(content,"image"); + linphone_content_set_subtype(content,"jpeg"); + linphone_content_set_size(content,file_size); /*total size to be transfered*/ + linphone_content_set_name(content,"nowebcamCIF.jpg"); + message = linphone_chat_room_create_file_transfer_message(chat_room, content); + linphone_chat_message_set_user_data(message, file_to_send); + cbs = linphone_chat_message_get_callbacks(message); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); + linphone_chat_room_send_chat_message(chat_room,message); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageExtBodyReceived,1)); + fclose(file_to_send); + if (marie->stat.last_received_chat_message ) { + cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); + linphone_chat_message_download_file(marie->stat.last_received_chat_message); + } + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageFileTransferDone,1)); + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1, int, "%d"); + BC_ASSERT_TRUE(compare_files(send_filepath, receive_filepath)); + + linphone_content_unref(content); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); + ms_free(send_filepath); + ms_free(receive_filepath); + } } static void send_file_transfer_message_using_external_body_url(LinphoneCoreManager *marie, LinphoneCoreManager *pauline) { @@ -818,43 +823,47 @@ static void send_file_transfer_message_using_external_body_url(LinphoneCoreManag static void file_transfer_message_external_body_to_external_body_client(void) { LinphoneCoreManager* marie = linphone_core_manager_init( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); - linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); - linphone_core_manager_start(marie, "marie_rc", TRUE); + linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); + linphone_core_manager_start(marie, "marie_rc", TRUE); - linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp"); - linphone_core_manager_start(pauline, "pauline_rc", TRUE); + linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp"); + linphone_core_manager_start(pauline, "pauline_rc", TRUE); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); + reset_counters(&marie->stat); + reset_counters(&pauline->stat); - linphone_core_refresh_registers(marie->lc); - linphone_core_refresh_registers(pauline->lc); + linphone_core_refresh_registers(marie->lc); + linphone_core_refresh_registers(pauline->lc); - send_file_transfer_message_using_external_body_url(marie, pauline); + send_file_transfer_message_using_external_body_url(marie, pauline); + linphone_core_manager_destroy(pauline); + } linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } static void file_transfer_message_external_body_to_rcs_client(void) { LinphoneCoreManager* marie = linphone_core_manager_init( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + LinphoneCoreManager* pauline = linphone_core_manager_init( "pauline_rc"); - linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); - linphone_core_manager_start(marie, "marie_rc", TRUE); + linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); + linphone_core_manager_start(marie, "marie_rc", TRUE); - linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); - linphone_core_manager_start(pauline, "pauline_rc", TRUE); + linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); + linphone_core_manager_start(pauline, "pauline_rc", TRUE); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); + reset_counters(&marie->stat); + reset_counters(&pauline->stat); - send_file_transfer_message_using_external_body_url(marie, pauline); + send_file_transfer_message_using_external_body_url(marie, pauline); + linphone_core_manager_destroy(pauline); + } linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } static void dos_module_trigger(void) { @@ -863,7 +872,7 @@ static void dos_module_trigger(void) { int i = 0; int number_of_messge_to_send = 100; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(marie->lc, LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); reset_counters(&marie->stat); reset_counters(&pauline->stat); diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 4fb0e2fa0..3a3d05277 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -44,7 +44,7 @@ extern test_suite_t stun_test_suite; extern test_suite_t remote_provisioning_test_suite; extern test_suite_t quality_reporting_test_suite; extern test_suite_t log_collection_test_suite; -extern test_suite_t transport_test_suite; +extern test_suite_t tunnel_test_suite; extern test_suite_t player_test_suite; extern test_suite_t dtmf_test_suite; extern test_suite_t offeranswer_test_suite; @@ -288,6 +288,7 @@ void end_call(LinphoneCoreManager *m1, LinphoneCoreManager *m2); void disable_all_audio_codecs_except_one(LinphoneCore *lc, const char *mime, int rate); void disable_all_video_codecs_except_one(LinphoneCore *lc, const char *mime); stats * get_stats(LinphoneCore *lc); +bool_t transport_supported(LinphoneCore *lc, LinphoneTransportType transport); LinphoneCoreManager *get_manager(LinphoneCore *lc); const char *liblinphone_tester_get_subscribe_content(void); const char *liblinphone_tester_get_notify_content(void); diff --git a/tester/log_collection_tester.c b/tester/log_collection_tester.c index 3d55075c7..32605c863 100644 --- a/tester/log_collection_tester.c +++ b/tester/log_collection_tester.c @@ -108,7 +108,7 @@ static LinphoneCoreManager* setup(bool_t enable_logs) { collect_init(); linphone_core_enable_log_collection(enable_logs); - marie = linphone_core_manager_new( "marie_rc"); + marie = linphone_core_manager_new2( "marie_rc", 0); // wait a few seconds to generate some traffic while (--timeout){ // Generate some logs - error logs because we must ensure that @@ -288,27 +288,28 @@ static void logCollectionUploadStateChangedCb(LinphoneCore *lc, LinphoneCoreLogC } static void upload_collected_traces() { LinphoneCoreManager* marie = setup(TRUE); - int waiting = 100; - LinphoneCoreVTable *v_table = linphone_core_v_table_new(); - v_table->log_collection_upload_state_changed = logCollectionUploadStateChangedCb; - linphone_core_add_listener(marie->lc, v_table); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + int waiting = 100; + LinphoneCoreVTable *v_table = linphone_core_v_table_new(); + v_table->log_collection_upload_state_changed = logCollectionUploadStateChangedCb; + linphone_core_add_listener(marie->lc, v_table); - linphone_core_set_log_collection_max_file_size(5000); - linphone_core_set_log_collection_upload_server_url(marie->lc,"https://www.linphone.org:444/lft.php"); - // Generate some logs - while (--waiting) ms_error("(test error)Waiting %d...", waiting); - linphone_core_compress_log_collection(marie->lc); - linphone_core_upload_log_collection(marie->lc); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,1)); - - /*try 2 times*/ - waiting=100; - linphone_core_reset_log_collection(marie->lc); - while (--waiting) ms_error("(test error)Waiting %d...", waiting); - linphone_core_compress_log_collection(marie->lc); - linphone_core_upload_log_collection(marie->lc); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,2)); + linphone_core_set_log_collection_max_file_size(5000); + linphone_core_set_log_collection_upload_server_url(marie->lc,"https://www.linphone.org:444/lft.php"); + // Generate some logs + while (--waiting) ms_error("(test error)Waiting %d...", waiting); + linphone_core_compress_log_collection(marie->lc); + linphone_core_upload_log_collection(marie->lc); + BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,1)); + /*try 2 times*/ + waiting=100; + linphone_core_reset_log_collection(marie->lc); + while (--waiting) ms_error("(test error)Waiting %d...", waiting); + linphone_core_compress_log_collection(marie->lc); + linphone_core_upload_log_collection(marie->lc); + BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,2)); + } collect_cleanup(marie); } diff --git a/tester/message_tester.c b/tester/message_tester.c index b50c9d2d3..2a32d019e 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -184,7 +184,7 @@ void liblinphone_tester_chat_message_msg_state_changed(LinphoneChatMessage *msg, static void text_message(void) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); char* to; LinphoneChatRoom* chat_room; @@ -211,7 +211,7 @@ static void text_message_within_dialog(void) { char* to; LinphoneChatRoom* chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); lp_config_set_int(pauline->lc->config,"sip","chat_use_call_dialogs",1); @@ -249,7 +249,7 @@ static void text_message_with_credential_from_auth_cb(void) { LinphoneChatRoom* chat_room; LinphoneCoreVTable* vtable = linphone_core_v_table_new(); LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); text_message_with_credential_from_auth_cb_auth_info=linphone_auth_info_clone((LinphoneAuthInfo*)(linphone_core_get_auth_info_list(pauline->lc)->data)); /*to force cb to be called*/ @@ -282,7 +282,7 @@ static void text_message_with_privacy(void) { LinphoneProxyConfig* pauline_proxy; LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); to = linphone_address_as_string(marie->identity); chat_room = linphone_core_create_chat_room(pauline->lc,to); @@ -310,7 +310,7 @@ static void text_message_with_privacy(void) { static void text_message_compatibility_mode(void) { char route[256]; LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneProxyConfig* proxy; LinphoneAddress* proxy_address; char*tmp; @@ -362,7 +362,7 @@ static void text_message_with_ack(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new( "pauline_tcp_rc"); { char* to = linphone_address_as_string(marie->identity); @@ -391,7 +391,7 @@ static void text_message_with_ack(void) { static void text_message_with_external_body(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); char *to = linphone_address_as_string(marie->identity); LinphoneChatRoom* chat_room = linphone_core_create_chat_room(pauline->lc,to); LinphoneChatMessage* message = linphone_chat_room_create_message(chat_room,"Bli bli bli \n blu"); @@ -441,134 +441,138 @@ bool_t compare_files(const char *path1, const char *path2) { } static void file_transfer_message(void) { - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneChatMessageCbs *cbs; - LinphoneContent* content; - FILE *file_to_send = NULL; - size_t file_size; - char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", bc_tester_read_dir_prefix); - char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", bc_tester_writable_dir_prefix); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneChatMessageCbs *cbs; + LinphoneContent* content; + FILE *file_to_send = NULL; + size_t file_size; + char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", bc_tester_read_dir_prefix); + char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", bc_tester_writable_dir_prefix); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - file_to_send = fopen(send_filepath, "rb"); - fseek(file_to_send, 0, SEEK_END); - file_size = ftell(file_to_send); - fseek(file_to_send, 0, SEEK_SET); - - /* Globally configure an http file transfer server. */ - linphone_core_set_file_transfer_server(pauline->lc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - ms_free(to); - /* create a file transfer message */ - content = linphone_core_create_content(pauline->lc); - linphone_content_set_type(content,"image"); - linphone_content_set_subtype(content,"jpeg"); - linphone_content_set_size(content,file_size); /*total size to be transfered*/ - linphone_content_set_name(content,"nowebcamCIF.jpg"); - message = linphone_chat_room_create_file_transfer_message(chat_room, content); - linphone_chat_message_set_user_data(message, file_to_send); - cbs = linphone_chat_message_get_callbacks(message); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ reset_counters(&marie->stat); reset_counters(&pauline->stat); - } - linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); - linphone_chat_room_send_chat_message(chat_room,message); - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); - fclose(file_to_send); - if (marie->stat.last_received_chat_message ) { - cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); - linphone_chat_message_download_file(marie->stat.last_received_chat_message); - } - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1)); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1, int, "%d"); - BC_ASSERT_TRUE(compare_files(send_filepath, receive_filepath)); + file_to_send = fopen(send_filepath, "rb"); + fseek(file_to_send, 0, SEEK_END); + file_size = ftell(file_to_send); + fseek(file_to_send, 0, SEEK_SET); - linphone_content_unref(content); + /* Globally configure an http file transfer server. */ + linphone_core_set_file_transfer_server(pauline->lc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + ms_free(to); + /* create a file transfer message */ + content = linphone_core_create_content(pauline->lc); + linphone_content_set_type(content,"image"); + linphone_content_set_subtype(content,"jpeg"); + linphone_content_set_size(content,file_size); /*total size to be transfered*/ + linphone_content_set_name(content,"nowebcamCIF.jpg"); + message = linphone_chat_room_create_file_transfer_message(chat_room, content); + linphone_chat_message_set_user_data(message, file_to_send); + cbs = linphone_chat_message_get_callbacks(message); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); + linphone_chat_room_send_chat_message(chat_room,message); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); + fclose(file_to_send); + if (marie->stat.last_received_chat_message ) { + cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); + linphone_chat_message_download_file(marie->stat.last_received_chat_message); + } + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1)); + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1, int, "%d"); + BC_ASSERT_TRUE(compare_files(send_filepath, receive_filepath)); + + linphone_content_unref(content); + linphone_core_manager_destroy(pauline); + ms_free(send_filepath); + ms_free(receive_filepath); + } linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); - ms_free(send_filepath); - ms_free(receive_filepath); } /* same than previous but with a 160 characters file */ #define SMALL_FILE_SIZE 160 static void small_file_transfer_message(void) { - int i; - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneChatMessageCbs *cbs; - LinphoneContent* content; - const char* big_file_content="big file"; /* setting dummy file content to something */ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - for (i=0;ilc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - ms_free(to); - /* create a file transfer message */ - content = linphone_core_create_content(pauline->lc); - linphone_content_set_type(content,"text"); - linphone_content_set_subtype(content,"plain"); - linphone_content_set_size(content,SMALL_FILE_SIZE); /*total size to be transfered*/ - linphone_content_set_name(content,"bigfile.txt"); - message = linphone_chat_room_create_file_transfer_message(chat_room, content); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + if (transport_supported(marie->lc, LinphoneTransportTls)) { + int i; + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneChatMessageCbs *cbs; + LinphoneContent* content; + const char* big_file_content="big file"; /* setting dummy file content to something */ + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); reset_counters(&marie->stat); reset_counters(&pauline->stat); - } - cbs = linphone_chat_message_get_callbacks(message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); - linphone_chat_room_send_chat_message(chat_room,message); - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); - if (marie->stat.last_received_chat_message ) { - cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); + + for (i=0;ilc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + ms_free(to); + /* create a file transfer message */ + content = linphone_core_create_content(pauline->lc); + linphone_content_set_type(content,"text"); + linphone_content_set_subtype(content,"plain"); + linphone_content_set_size(content,SMALL_FILE_SIZE); /*total size to be transfered*/ + linphone_content_set_name(content,"bigfile.txt"); + message = linphone_chat_room_create_file_transfer_message(chat_room, content); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + cbs = linphone_chat_message_get_callbacks(message); linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); - linphone_chat_message_download_file(marie->stat.last_received_chat_message); + linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); + linphone_chat_room_send_chat_message(chat_room,message); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); + if (marie->stat.last_received_chat_message ) { + cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received); + linphone_chat_message_download_file(marie->stat.last_received_chat_message); + } + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1)); + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1, int, "%d"); + + linphone_content_unref(content); + linphone_core_manager_destroy(pauline); } - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1)); - - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1, int, "%d"); - - linphone_content_unref(content); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } #ifdef HAVE_LIME @@ -592,7 +596,7 @@ static void lime_file_transfer_message(void) { big_file[sizeof(big_file)-1]=*"E"; marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new( "pauline_tcp_rc"); reset_counters(&marie->stat); reset_counters(&pauline->stat); @@ -845,7 +849,7 @@ static void lime_text_message(void) { FILE *ZIDCacheMarieFD, *ZIDCachePaulineFD; LinphoneChatRoom* chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); /* make sure lime is enabled */ linphone_core_enable_lime(marie->lc, 1); @@ -878,198 +882,204 @@ static void lime_text_message(void) { #endif /* HAVE_LIME */ static void file_transfer_message_io_error_upload(void) { - int i; - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneChatMessageCbs *cbs; - LinphoneContent* content; - const char* big_file_content="big file"; /* setting dummy file content to something */ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + int i; + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneChatMessageCbs *cbs; + LinphoneContent* content; + const char* big_file_content="big file"; /* setting dummy file content to something */ + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - /* setting dummy file content to something */ - for (i=0;ilc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - - /* create a file transfer message */ - content = linphone_core_create_content(pauline->lc); - linphone_content_set_type(content,"text"); - linphone_content_set_subtype(content,"plain"); - linphone_content_set_size(content,sizeof(big_file)); /*total size to be transfered*/ - linphone_content_set_name(content,"bigfile.txt"); - message = linphone_chat_room_create_file_transfer_message(chat_room, content); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ reset_counters(&marie->stat); reset_counters(&pauline->stat); + + /* setting dummy file content to something */ + for (i=0;ilc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + + /* create a file transfer message */ + content = linphone_core_create_content(pauline->lc); + linphone_content_set_type(content,"text"); + linphone_content_set_subtype(content,"plain"); + linphone_content_set_size(content,sizeof(big_file)); /*total size to be transfered*/ + linphone_content_set_name(content,"bigfile.txt"); + message = linphone_chat_room_create_file_transfer_message(chat_room, content); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + cbs = linphone_chat_message_get_callbacks(message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); + linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); + linphone_chat_room_send_chat_message(chat_room,message); + + /*wait for file to be 25% uploaded and simultate a network error*/ + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.progress_of_LinphoneFileTransfer,25)); + sal_set_send_error(pauline->lc->sal, -1); + + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1)); + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); + + sal_set_send_error(pauline->lc->sal, 0); + + linphone_core_refresh_registers(pauline->lc); /*to make sure registration is back in registered and so it can be later unregistered*/ + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneRegistrationOk,pauline->stat.number_of_LinphoneRegistrationOk+1)); + + linphone_content_unref(content); + linphone_core_manager_destroy(pauline); } - cbs = linphone_chat_message_get_callbacks(message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); - linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); - linphone_chat_room_send_chat_message(chat_room,message); - - /*wait for file to be 25% uploaded and simultate a network error*/ - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.progress_of_LinphoneFileTransfer,25)); - sal_set_send_error(pauline->lc->sal, -1); - - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1)); - - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); - - sal_set_send_error(pauline->lc->sal, 0); - - linphone_core_refresh_registers(pauline->lc); /*to make sure registration is back in registered and so it can be later unregistered*/ - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneRegistrationOk,pauline->stat.number_of_LinphoneRegistrationOk+1)); - - linphone_content_unref(content); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } #ifdef TEST_IS_BUGGED_NO_CALL_TO_IO_ERROR_CALLBACK static void file_transfer_message_io_error_download(void) { - int i; - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneContent content; - const char* big_file_content="big file"; /* setting dummy file content to something */ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + int i; + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneContent content; + const char* big_file_content="big file"; /* setting dummy file content to something */ + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - /* setting dummy file content to something */ - for (i=0;ilc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - ms_free(to); - - /* create a file transfer message */ - memset(&content,0,sizeof(content)); - content.type="text"; - content.subtype="plain"; - content.size=sizeof(big_file); /*total size to be transfered*/ - content.name = "bigfile.txt"; - message = linphone_chat_room_create_file_transfer_message(chat_room, &content); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ reset_counters(&marie->stat); reset_counters(&pauline->stat); + + /* setting dummy file content to something */ + for (i=0;ilc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + ms_free(to); + + /* create a file transfer message */ + memset(&content,0,sizeof(content)); + content.type="text"; + content.subtype="plain"; + content.size=sizeof(big_file); /*total size to be transfered*/ + content.name = "bigfile.txt"; + message = linphone_chat_room_create_file_transfer_message(chat_room, &content); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + linphone_chat_room_send_message2(chat_room,message,liblinphone_tester_chat_message_state_change,pauline->lc); + + /* wait for marie to receive pauline's message */ + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); + + + if (marie->stat.last_received_chat_message ) { /* get last message and use it to download file */ + linphone_chat_message_start_file_download(marie->stat.last_received_chat_message, liblinphone_tester_chat_message_state_change, marie->lc); + /* wait for file to be 50% downloaded */ + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.progress_of_LinphoneFileTransfer, 50)); + /* and simulate network error */ + sal_set_recv_error(marie->lc->sal, -1); + } + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); + + sal_set_recv_error(marie->lc->sal, 0); + linphone_core_manager_destroy(pauline); } - linphone_chat_room_send_message2(chat_room,message,liblinphone_tester_chat_message_state_change,pauline->lc); - - /* wait for marie to receive pauline's message */ - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceivedWithFile,1)); - - - if (marie->stat.last_received_chat_message ) { /* get last message and use it to download file */ - linphone_chat_message_start_file_download(marie->stat.last_received_chat_message, liblinphone_tester_chat_message_state_change, marie->lc); - /* wait for file to be 50% downloaded */ - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.progress_of_LinphoneFileTransfer, 50)); - /* and simulate network error */ - sal_set_recv_error(marie->lc->sal, -1); - } - - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d"); - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); - - sal_set_recv_error(marie->lc->sal, 0); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } #endif static void file_transfer_message_upload_cancelled(void) { - int i; - char* to; - LinphoneChatRoom* chat_room; - LinphoneChatMessage* message; - LinphoneChatMessageCbs *cbs; - LinphoneContent* content; - const char* big_file_content="big file"; /* setting dummy file content to something */ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + int i; + char* to; + LinphoneChatRoom* chat_room; + LinphoneChatMessage* message; + LinphoneChatMessageCbs *cbs; + LinphoneContent* content; + const char* big_file_content="big file"; /* setting dummy file content to something */ + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); - - /* setting dummy file content to something */ - for (i=0;ilc,"https://www.linphone.org:444/lft.php"); - - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - - /* create a file transfer message */ - content = linphone_core_create_content(pauline->lc); - linphone_content_set_type(content,"text"); - linphone_content_set_subtype(content,"plain"); - linphone_content_set_size(content,sizeof(big_file)); /*total size to be transfered*/ - linphone_content_set_name(content,"bigfile.txt"); - message = linphone_chat_room_create_file_transfer_message(chat_room, content); - { - int dummy=0; - wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ reset_counters(&marie->stat); reset_counters(&pauline->stat); + + /* setting dummy file content to something */ + for (i=0;ilc,"https://www.linphone.org:444/lft.php"); + + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + + /* create a file transfer message */ + content = linphone_core_create_content(pauline->lc); + linphone_content_set_type(content,"text"); + linphone_content_set_subtype(content,"plain"); + linphone_content_set_size(content,sizeof(big_file)); /*total size to be transfered*/ + linphone_content_set_name(content,"bigfile.txt"); + message = linphone_chat_room_create_file_transfer_message(chat_room, content); + { + int dummy=0; + wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/ + reset_counters(&marie->stat); + reset_counters(&pauline->stat); + } + cbs = linphone_chat_message_get_callbacks(message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); + linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); + linphone_chat_room_send_chat_message(chat_room,message); + + /*wait for file to be 50% uploaded and cancel the transfer */ + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.progress_of_LinphoneFileTransfer, 50)); + linphone_chat_message_cancel_file_transfer(message); + + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1)); + + BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); + + linphone_content_unref(content); + linphone_core_manager_destroy(pauline); } - cbs = linphone_chat_message_get_callbacks(message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_cbs_set_file_transfer_send(cbs, memory_file_transfer_send); - linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); - linphone_chat_room_send_chat_message(chat_room,message); - - /*wait for file to be 50% uploaded and cancel the transfer */ - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.progress_of_LinphoneFileTransfer, 50)); - linphone_chat_message_cancel_file_transfer(message); - - BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1)); - - BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1, int, "%d"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0, int, "%d"); - - linphone_content_unref(content); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } static void file_transfer_message_download_cancelled(void) { @@ -1081,7 +1091,7 @@ static void file_transfer_message_download_cancelled(void) { LinphoneContent content; const char* big_file_content="big file"; /* setting dummy file content to something */ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); reset_counters(&marie->stat); reset_counters(&pauline->stat); @@ -1139,45 +1149,47 @@ static void file_transfer_message_download_cancelled(void) { } static void file_transfer_using_external_body_url(void) { - char *to; - LinphoneChatMessageCbs *cbs; - LinphoneChatRoom *chat_room; - LinphoneChatMessage *message; LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); - reset_counters(&marie->stat); - reset_counters(&pauline->stat); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + char *to; + LinphoneChatMessageCbs *cbs; + LinphoneChatRoom *chat_room; + LinphoneChatMessage *message; + LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + reset_counters(&marie->stat); + reset_counters(&pauline->stat); - /* make sure lime is disabled */ - linphone_core_enable_lime(marie->lc, FALSE); - linphone_core_enable_lime(pauline->lc, FALSE); + /* make sure lime is disabled */ + linphone_core_enable_lime(marie->lc, FALSE); + linphone_core_enable_lime(pauline->lc, FALSE); - /* create a chatroom on pauline's side */ - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); + /* create a chatroom on pauline's side */ + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); - message = linphone_chat_room_create_message(chat_room, NULL); + message = linphone_chat_room_create_message(chat_room, NULL); - cbs = linphone_chat_message_get_callbacks(message); - linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); + cbs = linphone_chat_message_get_callbacks(message); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); - linphone_chat_message_set_external_body_url(message, "https://www.linphone.org:444//tmp/54ec58280ace9_c30709218df8eaba61d1.jpg"); - linphone_chat_room_send_chat_message(chat_room, message); + linphone_chat_message_set_external_body_url(message, "https://www.linphone.org:444//tmp/54ec58280ace9_c30709218df8eaba61d1.jpg"); + linphone_chat_room_send_chat_message(chat_room, message); - BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); - if (marie->stat.last_received_chat_message) { - linphone_chat_message_download_file(marie->stat.last_received_chat_message); + BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); + if (marie->stat.last_received_chat_message) { + linphone_chat_message_download_file(marie->stat.last_received_chat_message); + } + BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageExtBodyReceived, 1)); + BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageInProgress, 1)); + ms_free(to); + linphone_core_manager_destroy(pauline); } - BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageExtBodyReceived, 1)); - BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageInProgress, 1)); - ms_free(to); linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); } static void text_message_with_send_error(void) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); char *to = linphone_address_as_string(pauline->identity); LinphoneChatRoom* chat_room = linphone_core_create_chat_room(marie->lc,to); @@ -1217,7 +1229,7 @@ static void text_message_with_send_error(void) { static void text_message_denied(void) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); char *to = linphone_address_as_string(pauline->identity); LinphoneChatRoom* chat_room = linphone_core_create_chat_room(marie->lc,to); @@ -1262,7 +1274,7 @@ static void info_message_with_args(bool_t with_content) { const char *hvalue; LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); BC_ASSERT_TRUE(call(pauline,marie)); @@ -1325,7 +1337,7 @@ static void is_composing_notification(void) { int dummy = 0; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); to = linphone_address_as_string(marie->identity); chat_room = linphone_core_create_chat_room(pauline->lc, to); diff --git a/tester/multi_call.c b/tester/multi_call.c index b0fed70cc..47e884a0f 100644 --- a/tester/multi_call.c +++ b/tester/multi_call.c @@ -33,7 +33,7 @@ static void call_waiting_indication_with_param(bool_t enable_caller_privacy) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); MSList *iterator; MSList* lcs; @@ -115,7 +115,7 @@ static void call_waiting_indication_with_privacy(void) { static void incoming_call_accepted_when_outgoing_call_in_state(LinphoneCallState state) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); MSList* lcs; LinphoneCallParams *laure_params=linphone_core_create_default_call_parameters(laure->lc); @@ -242,7 +242,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag } static void simple_conference(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); simple_conference_base(marie,pauline,laure); linphone_core_manager_destroy(marie); @@ -252,7 +252,7 @@ static void simple_conference(void) { static void simple_conference_with_ice(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); @@ -271,7 +271,7 @@ static void simple_conference_with_ice(void) { static void simple_call_transfer(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); LinphoneCall* pauline_called_by_marie; LinphoneCall *marie_calling_pauline; @@ -331,7 +331,7 @@ static void simple_call_transfer(void) { static void unattended_call_transfer(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); LinphoneCall* pauline_called_by_marie; @@ -377,7 +377,7 @@ static void unattended_call_transfer(void) { static void unattended_call_transfer_with_error(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCall* pauline_called_by_marie; bool_t call_ok=TRUE; MSList* lcs=ms_list_append(NULL,marie->lc); @@ -417,7 +417,7 @@ static void unattended_call_transfer_with_error(void) { static void call_transfer_existing_call_outgoing_call(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); LinphoneCall* marie_call_pauline; LinphoneCall* pauline_called_by_marie; diff --git a/tester/multicast_call_tester.c b/tester/multicast_call_tester.c index 3453463a0..5085c944c 100644 --- a/tester/multicast_call_tester.c +++ b/tester/multicast_call_tester.c @@ -31,7 +31,7 @@ static void call_multicast_base(bool_t video) { belle_sip_object_enable_leak_detector(TRUE); begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_rc"); + pauline = linphone_core_manager_new( "pauline_tcp_rc"); if (video) { linphone_core_enable_video_capture(marie->lc, TRUE); @@ -101,8 +101,8 @@ static void early_media_with_multicast_base(bool_t video) { belle_sip_object_enable_leak_detector(TRUE); begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new("pauline_rc"); - pauline2 = linphone_core_manager_new("pauline_rc"); + pauline = linphone_core_manager_new("pauline_tcp_rc"); + pauline2 = linphone_core_manager_new("pauline_tcp_rc"); marie_lp=linphone_core_get_config(marie->lc); lp_config_set_int(marie_lp,"misc","real_early_media",1); diff --git a/tester/offeranswer_tester.c b/tester/offeranswer_tester.c index 67d9c9d62..40639ade8 100644 --- a/tester/offeranswer_tester.c +++ b/tester/offeranswer_tester.c @@ -80,7 +80,7 @@ static void simple_call_with_different_codec_mappings(void) { begin=belle_sip_object_get_object_count(); marie = linphone_core_manager_new( "marie_rc"); - pauline = linphone_core_manager_new( "pauline_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); @@ -127,7 +127,7 @@ static void call_failed_because_of_codecs(void) { { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCall* out_call; disable_all_audio_codecs_except_one(marie->lc,"pcmu",-1); @@ -156,7 +156,7 @@ static void call_failed_because_of_codecs(void) { static void profile_call_base(bool_t avpf1, LinphoneMediaEncryption srtp1,bool_t avpf2, LinphoneMediaEncryption srtp2, bool_t encryption_mandatory, const char *expected_profile) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc"); LinphoneProxyConfig *lpc; const LinphoneCallParams *params; diff --git a/tester/presence_tester.c b/tester/presence_tester.c index ef16102a0..7ce6dc599 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -180,7 +180,7 @@ static bool_t subscribe_to_callee_presence(LinphoneCoreManager* caller_mgr,Linph } static void subscribe_failure_handle_by_app(void) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_tcp_rc"); LinphoneProxyConfig* config; LinphoneFriend* lf; char* lf_identity=linphone_address_as_string_uri_only(pauline->identity); diff --git a/tester/quality_reporting_tester.c b/tester/quality_reporting_tester.c index e5c97b8ee..f5413b5c8 100644 --- a/tester/quality_reporting_tester.c +++ b/tester/quality_reporting_tester.c @@ -143,7 +143,7 @@ bool_t create_call_for_quality_reporting_tests( static void quality_reporting_not_used_without_config() { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCall* call_marie = NULL; LinphoneCall* call_pauline = NULL; @@ -167,7 +167,7 @@ static void quality_reporting_not_used_without_config() { static void quality_reporting_not_sent_if_call_not_started() { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCallLog* out_call_log; LinphoneCall* out_call; @@ -198,7 +198,7 @@ static void quality_reporting_not_sent_if_call_not_started() { static void quality_reporting_not_sent_if_low_bandwidth() { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCallParams* marie_params; marie_params=linphone_core_create_default_call_parameters(marie->lc); @@ -223,7 +223,7 @@ void on_report_send_remove_fields(const LinphoneCall *call, int stream_type, con static void quality_reporting_invalid_report() { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCall* call_marie = NULL; LinphoneCall* call_pauline = NULL; @@ -291,7 +291,7 @@ static void quality_reporting_interval_report() { static void quality_reporting_session_report_if_video_stopped() { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc_rtcp_xr"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCall* call_pauline = NULL; LinphoneCall* call_marie = NULL; LinphoneCallParams* pauline_params; diff --git a/tester/rcfiles/pauline_h264_rc b/tester/rcfiles/pauline_h264_rc index 8f30cf020..158f45fe5 100644 --- a/tester/rcfiles/pauline_h264_rc +++ b/tester/rcfiles/pauline_h264_rc @@ -15,8 +15,8 @@ realm=sip.example.org [proxy_0] -reg_proxy=sip2.linphone.org;transport=tls -reg_route=sip2.linphone.org;transport=tls +reg_proxy=sip2.linphone.org;transport=tcp +reg_route=sip2.linphone.org;transport=tcp reg_identity=sip:pauline@sip.example.org reg_expires=3600 reg_sendregister=1 diff --git a/tester/rcfiles/pauline_rc_rtcp_xr b/tester/rcfiles/pauline_rc_rtcp_xr index 94c0314ea..1648b508a 100644 --- a/tester/rcfiles/pauline_rc_rtcp_xr +++ b/tester/rcfiles/pauline_rc_rtcp_xr @@ -15,8 +15,8 @@ realm=sip.example.org [proxy_0] -reg_proxy=sip2.linphone.org;transport=tls -reg_route=sip2.linphone.org;transport=tls +reg_proxy=sip2.linphone.org;transport=tcp +reg_route=sip2.linphone.org;transport=tcp reg_identity=sip:pauline@sip.example.org reg_expires=3600 reg_sendregister=1 diff --git a/tester/rcfiles/pauline_tcp_rc b/tester/rcfiles/pauline_tcp_rc index 1b2a85e80..f3a3ef568 100644 --- a/tester/rcfiles/pauline_tcp_rc +++ b/tester/rcfiles/pauline_tcp_rc @@ -36,7 +36,7 @@ video_rtp_port=39072-49000 display=0 capture=0 show_local=0 -size=vga +size=qcif enabled=0 self_view=0 automatically_initiate=0 diff --git a/tester/rcfiles/pauline_zrtp_aes256_rc b/tester/rcfiles/pauline_zrtp_aes256_rc index 470432c99..5f1af185d 100644 --- a/tester/rcfiles/pauline_zrtp_aes256_rc +++ b/tester/rcfiles/pauline_zrtp_aes256_rc @@ -16,8 +16,8 @@ realm=sip.example.org [proxy_0] -reg_proxy=sip2.linphone.org;transport=tls -reg_route=sip2.linphone.org;transport=tls +reg_proxy=sip2.linphone.org;transport=tcp +reg_route=sip2.linphone.org;transport=tcp reg_identity=sip:pauline@sip.example.org reg_expires=3600 reg_sendregister=1 diff --git a/tester/rcfiles/pauline_zrtp_b256_rc b/tester/rcfiles/pauline_zrtp_b256_rc index e2d6ce14b..cf74f3fa7 100644 --- a/tester/rcfiles/pauline_zrtp_b256_rc +++ b/tester/rcfiles/pauline_zrtp_b256_rc @@ -16,8 +16,8 @@ realm=sip.example.org [proxy_0] -reg_proxy=sip2.linphone.org;transport=tls -reg_route=sip2.linphone.org;transport=tls +reg_proxy=sip2.linphone.org;transport=tcp +reg_route=sip2.linphone.org;transport=tcp reg_identity=sip:pauline@sip.example.org reg_expires=3600 reg_sendregister=1 diff --git a/tester/rcfiles/pauline_zrtp_srtpsuite_aes256_rc b/tester/rcfiles/pauline_zrtp_srtpsuite_aes256_rc index 08ba14da8..b79b11874 100644 --- a/tester/rcfiles/pauline_zrtp_srtpsuite_aes256_rc +++ b/tester/rcfiles/pauline_zrtp_srtpsuite_aes256_rc @@ -16,8 +16,8 @@ realm=sip.example.org [proxy_0] -reg_proxy=sip2.linphone.org;transport=tls -reg_route=sip2.linphone.org;transport=tls +reg_proxy=sip2.linphone.org;transport=tcp +reg_route=sip2.linphone.org;transport=tcp reg_identity=sip:pauline@sip.example.org reg_expires=3600 reg_sendregister=1 diff --git a/tester/register_tester.c b/tester/register_tester.c index 5f13243cc..4b7d4c8a8 100644 --- a/tester/register_tester.c +++ b/tester/register_tester.c @@ -32,17 +32,17 @@ static void auth_info_requested(LinphoneCore *lc, const char *realm, const char static LinphoneCoreManager* create_lcm_with_auth(unsigned int with_auth) { - LinphoneCoreManager* mgr=linphone_core_manager_new(NULL); + LinphoneCoreManager* lcm=linphone_core_manager_new(NULL); if (with_auth) { LinphoneCoreVTable* vtable = linphone_core_v_table_new(); vtable->auth_info_requested=auth_info_requested; - linphone_core_add_listener(mgr->lc,vtable); + linphone_core_add_listener(lcm->lc,vtable); } /*to allow testing with 127.0.0.1*/ - linphone_core_set_network_reachable(mgr->lc,TRUE); - return mgr; + linphone_core_set_network_reachable(lcm->lc,TRUE); + return lcm; } static LinphoneCoreManager* create_lcm() { @@ -85,6 +85,7 @@ static void register_with_refresh_base_3(LinphoneCore* lc BC_ASSERT_PTR_NOT_NULL(lc); if (!lc) return; + counters = get_stats(lc); reset_counters(counters); linphone_core_set_sip_transports(lc,&transport); @@ -292,13 +293,13 @@ static void simple_tcp_register_compatibility_mode(){ linphone_core_manager_destroy(lcm); } - static void simple_tls_register(){ char route[256]; - LinphoneCoreManager* lcm; - sprintf(route,"sip:%s;transport=tls",test_route); - lcm = create_lcm(); - register_with_refresh(lcm,FALSE,test_domain,route); + LinphoneCoreManager* lcm = create_lcm(); + if (transport_supported(lcm->lc,LinphoneTransportTls)) { + sprintf(route,"sip:%s;transport=tls",test_route); + register_with_refresh(lcm,FALSE,test_domain,route); + } linphone_core_manager_destroy(lcm); } @@ -331,44 +332,44 @@ static void ha1_authenticated_register(){ } static void authenticated_register_with_no_initial_credentials(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCoreVTable* vtable = linphone_core_v_table_new(); stats* counters; char route[256]; sprintf(route,"sip:%s",test_route); - mgr = linphone_core_manager_new(NULL); + lcm = linphone_core_manager_new(NULL); vtable->auth_info_requested=auth_info_requested; - linphone_core_add_listener(mgr->lc,vtable); + linphone_core_add_listener(lcm->lc,vtable); - counters= get_stats(mgr->lc); + counters= get_stats(lcm->lc); counters->number_of_auth_info_requested=0; - register_with_refresh(mgr,FALSE,auth_domain,route); + register_with_refresh(lcm,FALSE,auth_domain,route); BC_ASSERT_EQUAL(counters->number_of_auth_info_requested,1, int, "%d"); - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); } static void authenticated_register_with_late_credentials(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; stats* counters; LCSipTransports transport = {5070,5070,0,5071}; char route[256]; sprintf(route,"sip:%s",test_route); - mgr = linphone_core_manager_new(NULL); + lcm = linphone_core_manager_new(NULL); - counters = get_stats(mgr->lc); - register_with_refresh_base_2(mgr->lc,FALSE,auth_domain,route,TRUE,transport); + counters = get_stats(lcm->lc); + register_with_refresh_base_2(lcm->lc,FALSE,auth_domain,route,TRUE,transport); BC_ASSERT_EQUAL(counters->number_of_auth_info_requested,1, int, "%d"); - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); } static void authenticated_register_with_wrong_late_credentials(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; stats* counters; LCSipTransports transport = {5070,5070,0,5071}; char route[256]; @@ -379,19 +380,19 @@ static void authenticated_register_with_wrong_late_credentials(){ sprintf(route,"sip:%s",test_route); - mgr = linphone_core_manager_new(NULL); + lcm = linphone_core_manager_new(NULL); - counters = get_stats(mgr->lc); - register_with_refresh_base_3(mgr->lc,FALSE,auth_domain,route,TRUE,transport,LinphoneRegistrationFailed); + counters = get_stats(lcm->lc); + register_with_refresh_base_3(lcm->lc,FALSE,auth_domain,route,TRUE,transport,LinphoneRegistrationFailed); BC_ASSERT_EQUAL(counters->number_of_auth_info_requested,2, int, "%d"); BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,2, int, "%d"); BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress,2, int, "%d"); test_password=saved_test_passwd; - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); } -static void authenticated_register_with_wrong_credentials_with_params_base(const char* user_agent,LinphoneCoreManager *mgr) { +static void authenticated_register_with_wrong_credentials_with_params_base(const char* user_agent,LinphoneCoreManager *lcm) { stats* counters; LCSipTransports transport = {5070,5070,0,5071}; LinphoneAuthInfo *info=linphone_auth_info_new(test_username,NULL,"wrong passwd",NULL,auth_domain,NULL); /*create authentication structure from identity*/ @@ -399,22 +400,22 @@ static void authenticated_register_with_wrong_credentials_with_params_base(const sprintf(route,"sip:%s",test_route); - sal_set_refresher_retry_after(mgr->lc->sal,500); + sal_set_refresher_retry_after(lcm->lc->sal,500); if (user_agent) { - linphone_core_set_user_agent(mgr->lc,user_agent,NULL); + linphone_core_set_user_agent(lcm->lc,user_agent,NULL); } - linphone_core_add_auth_info(mgr->lc,info); /*add wrong authentication info to LinphoneCore*/ - counters = get_stats(mgr->lc); - register_with_refresh_base_3(mgr->lc,TRUE,auth_domain,route,FALSE,transport,LinphoneRegistrationFailed); + linphone_core_add_auth_info(lcm->lc,info); /*add wrong authentication info to LinphoneCore*/ + counters = get_stats(lcm->lc); + register_with_refresh_base_3(lcm->lc,TRUE,auth_domain,route,FALSE,transport,LinphoneRegistrationFailed); //BC_ASSERT_EQUAL(counters->number_of_auth_info_requested,3, int, "%d"); register_with_refresh_base_3 does not alow to precisely check number of number_of_auth_info_requested /*wait for retry*/ - BC_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&counters->number_of_auth_info_requested,4)); + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_auth_info_requested,4)); BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,1, int, "%d"); /*check the detailed error info */ if (!user_agent || strcmp(user_agent,"tester-no-403")!=0){ LinphoneProxyConfig *cfg=NULL; - linphone_core_get_default_proxy(mgr->lc,&cfg); + linphone_core_get_default_proxy(lcm->lc,&cfg); BC_ASSERT_PTR_NOT_NULL(cfg); if (cfg){ const LinphoneErrorInfo *ei=linphone_proxy_config_get_error_info(cfg); @@ -428,63 +429,71 @@ static void authenticated_register_with_wrong_credentials_with_params_base(const } } static void authenticated_register_with_wrong_credentials_with_params(const char* user_agent) { - LinphoneCoreManager *mgr = linphone_core_manager_new(NULL); - authenticated_register_with_wrong_credentials_with_params_base(user_agent,mgr); - linphone_core_manager_destroy(mgr); + LinphoneCoreManager *lcm = linphone_core_manager_new(NULL); + authenticated_register_with_wrong_credentials_with_params_base(user_agent,lcm); + linphone_core_manager_destroy(lcm); } static void authenticated_register_with_wrong_credentials() { authenticated_register_with_wrong_credentials_with_params(NULL); } static void authenticated_register_with_wrong_credentials_2() { - LinphoneCoreManager *mgr = linphone_core_manager_new(NULL); - stats* counters = get_stats(mgr->lc); + LinphoneCoreManager *lcm = linphone_core_manager_new(NULL); + stats* counters = get_stats(lcm->lc); int current_in_progress; LinphoneProxyConfig* proxy; - authenticated_register_with_wrong_credentials_with_params_base(NULL,mgr); + authenticated_register_with_wrong_credentials_with_params_base(NULL,lcm); - linphone_core_get_default_proxy(mgr->lc,&proxy); + linphone_core_get_default_proxy(lcm->lc,&proxy); /*Make sure registration attempts are stopped*/ linphone_proxy_config_edit(proxy); linphone_proxy_config_enable_register(proxy,FALSE); linphone_proxy_config_done(proxy); current_in_progress=counters->number_of_LinphoneRegistrationProgress; - BC_ASSERT_FALSE(wait_for(mgr->lc,mgr->lc,&counters->number_of_LinphoneRegistrationProgress,current_in_progress+1)); + BC_ASSERT_FALSE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationProgress,current_in_progress+1)); - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); } static void authenticated_register_with_wrong_credentials_without_403() { authenticated_register_with_wrong_credentials_with_params("tester-no-403"); } static LinphoneCoreManager* configure_lcm(void) { - LinphoneCoreManager *mgr=linphone_core_manager_new( "multi_account_rc"); - stats *counters=&mgr->stat; - BC_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&counters->number_of_LinphoneRegistrationOk,ms_list_size(linphone_core_get_proxy_config_list(mgr->lc)))); - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0, int, "%d"); - return mgr; + LinphoneCoreManager *lcm=linphone_core_manager_new2( "multi_account_rc", FALSE); + if (transport_supported(lcm->lc,LinphoneTransportTls)) { + stats *counters=&lcm->stat; + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,ms_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0, int, "%d"); + return lcm; + } + linphone_core_manager_destroy(lcm); + return NULL; } static void multiple_proxy(){ - LinphoneCoreManager *mgr=configure_lcm(); - linphone_core_manager_destroy(mgr); + LinphoneCoreManager *lcm=configure_lcm(); + if (lcm) { + linphone_core_manager_destroy(lcm); + } } static void network_state_change(){ int register_ok; stats *counters; - LinphoneCoreManager *mgr=configure_lcm(); - LinphoneCore *lc=mgr->lc; + LinphoneCoreManager *lcm=configure_lcm(); + if (lcm) { + LinphoneCore *lc=lcm->lc; - counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; - linphone_core_set_network_reachable(lc,FALSE); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_NetworkReachableFalse,1)); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationNone,register_ok)); - linphone_core_set_network_reachable(lc,TRUE); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_NetworkReachableTrue,1)); - wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,2*register_ok); + counters = get_stats(lc); + register_ok=counters->number_of_LinphoneRegistrationOk; + linphone_core_set_network_reachable(lc,FALSE); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_NetworkReachableFalse,1)); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationNone,register_ok)); + linphone_core_set_network_reachable(lc,TRUE); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_NetworkReachableTrue,1)); + wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,2*register_ok); - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); + } } static int get_number_of_udp_proxy(const LinphoneCore* lc) { int number_of_udp_proxy=0; @@ -498,7 +507,7 @@ static int get_number_of_udp_proxy(const LinphoneCore* lc) { return number_of_udp_proxy; } static void transport_change(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCore* lc; int register_ok; stats* counters ; @@ -506,26 +515,28 @@ static void transport_change(){ LCSipTransports sip_tr_orig; int number_of_udp_proxy=0; int total_number_of_proxies; - memset(&sip_tr,0,sizeof(sip_tr)); - mgr=configure_lcm(); - lc=mgr->lc; - counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; + lcm=configure_lcm(); + if (lcm) { + memset(&sip_tr,0,sizeof(sip_tr)); + lc=lcm->lc; + counters = get_stats(lc); + register_ok=counters->number_of_LinphoneRegistrationOk; - number_of_udp_proxy=get_number_of_udp_proxy(lc); - total_number_of_proxies=ms_list_size(linphone_core_get_proxy_config_list(lc)); - linphone_core_get_sip_transports(lc,&sip_tr_orig); + number_of_udp_proxy=get_number_of_udp_proxy(lc); + total_number_of_proxies=ms_list_size(linphone_core_get_proxy_config_list(lc)); + linphone_core_get_sip_transports(lc,&sip_tr_orig); - sip_tr.udp_port=sip_tr_orig.udp_port; + sip_tr.udp_port=sip_tr_orig.udp_port; - /*keep only udp*/ - linphone_core_set_sip_transports(lc,&sip_tr); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,register_ok+number_of_udp_proxy)); + /*keep only udp*/ + linphone_core_set_sip_transports(lc,&sip_tr); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,register_ok+number_of_udp_proxy)); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationFailed,total_number_of_proxies-number_of_udp_proxy)); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationFailed,total_number_of_proxies-number_of_udp_proxy)); - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); + } } static void proxy_transport_change(){ @@ -624,198 +635,212 @@ static void proxy_transport_change_with_wrong_port_givin_up() { } static void io_recv_error(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCore* lc; int register_ok; stats* counters ; int number_of_udp_proxy=0; - mgr=configure_lcm(); - lc=mgr->lc; - counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; - number_of_udp_proxy=get_number_of_udp_proxy(lc); - sal_set_recv_error(lc->sal, 0); + lcm=configure_lcm(); + if (lcm) { + lc=lcm->lc; + counters = get_stats(lc); + register_ok=counters->number_of_LinphoneRegistrationOk; + number_of_udp_proxy=get_number_of_udp_proxy(lc); + sal_set_recv_error(lc->sal, 0); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationProgress,2*(register_ok-number_of_udp_proxy) /*because 1 udp*/)); - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationProgress,2*(register_ok-number_of_udp_proxy) /*because 1 udp*/)); + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); - sal_set_recv_error(lc->sal, 1); /*reset*/ + sal_set_recv_error(lc->sal, 1); /*reset*/ - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); + } } static void io_recv_error_retry_immediatly(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCore* lc; int register_ok; stats* counters ; int number_of_udp_proxy=0; + lcm=configure_lcm(); + if (lcm) { + lc=lcm->lc; + counters = get_stats(lc); + register_ok=counters->number_of_LinphoneRegistrationOk; + number_of_udp_proxy=get_number_of_udp_proxy(lc); + sal_set_recv_error(lc->sal, 0); - mgr=configure_lcm(); - lc=mgr->lc; - counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; - number_of_udp_proxy=get_number_of_udp_proxy(lc); - sal_set_recv_error(lc->sal, 0); + BC_ASSERT_TRUE(wait_for(lc,NULL,&counters->number_of_LinphoneRegistrationProgress,(register_ok-number_of_udp_proxy)+register_ok /*because 1 udp*/)); + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); + sal_set_recv_error(lc->sal, 1); /*reset*/ - BC_ASSERT_TRUE(wait_for(lc,NULL,&counters->number_of_LinphoneRegistrationProgress,(register_ok-number_of_udp_proxy)+register_ok /*because 1 udp*/)); - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); - sal_set_recv_error(lc->sal, 1); /*reset*/ + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,register_ok-number_of_udp_proxy+register_ok)); - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationOk,register_ok-number_of_udp_proxy+register_ok)); - - linphone_core_manager_destroy(mgr); + linphone_core_manager_destroy(lcm); + } } static void io_recv_error_late_recovery(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCore* lc; int register_ok; stats* counters ; int number_of_udp_proxy=0; MSList* lcs; - mgr=linphone_core_manager_new2( "multi_account_rc",FALSE); /*to make sure iterates are not call yet*/ - lc=mgr->lc; - sal_set_refresher_retry_after(lc->sal,1000); - counters=&mgr->stat; - BC_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&counters->number_of_LinphoneRegistrationOk,ms_list_size(linphone_core_get_proxy_config_list(mgr->lc)))); + lcm=linphone_core_manager_new2( "multi_account_rc",FALSE); /*to make sure iterates are not call yet*/ + if (transport_supported(lcm->lc, LinphoneTransportTls)) { + lc=lcm->lc; + sal_set_refresher_retry_after(lc->sal,1000); + counters=&lcm->stat; + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,ms_list_size(linphone_core_get_proxy_config_list(lcm->lc)))); - counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; - number_of_udp_proxy=get_number_of_udp_proxy(lc); - /*simulate a general socket error*/ - sal_set_recv_error(lc->sal, 0); - sal_set_send_error(lc->sal, -1); + counters = get_stats(lc); + register_ok=counters->number_of_LinphoneRegistrationOk; + number_of_udp_proxy=get_number_of_udp_proxy(lc); + /*simulate a general socket error*/ + sal_set_recv_error(lc->sal, 0); + sal_set_send_error(lc->sal, -1); - BC_ASSERT_TRUE(wait_for(lc,NULL,&counters->number_of_LinphoneRegistrationProgress,(register_ok-number_of_udp_proxy)+register_ok /*because 1 udp*/)); - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); + BC_ASSERT_TRUE(wait_for(lc,NULL,&counters->number_of_LinphoneRegistrationProgress,(register_ok-number_of_udp_proxy)+register_ok /*because 1 udp*/)); + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); - BC_ASSERT_TRUE(wait_for_list(lcs=ms_list_append(NULL,lc),&counters->number_of_LinphoneRegistrationFailed,(register_ok-number_of_udp_proxy),sal_get_refresher_retry_after(lc->sal)+3000)); + BC_ASSERT_TRUE(wait_for_list(lcs=ms_list_append(NULL,lc),&counters->number_of_LinphoneRegistrationFailed,(register_ok-number_of_udp_proxy),sal_get_refresher_retry_after(lc->sal)+3000)); - sal_set_recv_error(lc->sal, 1); /*reset*/ - sal_set_send_error(lc->sal, 0); + sal_set_recv_error(lc->sal, 1); /*reset*/ + sal_set_send_error(lc->sal, 0); - BC_ASSERT_TRUE(wait_for_list(lcs=ms_list_append(NULL,lc),&counters->number_of_LinphoneRegistrationOk,register_ok-number_of_udp_proxy +register_ok,sal_get_refresher_retry_after(lc->sal)+3000)); - - linphone_core_manager_destroy(mgr); + BC_ASSERT_TRUE(wait_for_list(lcs=ms_list_append(NULL,lc),&counters->number_of_LinphoneRegistrationOk,register_ok-number_of_udp_proxy +register_ok,sal_get_refresher_retry_after(lc->sal)+3000)); + } + linphone_core_manager_destroy(lcm); } static void io_recv_error_without_active_register(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneCore* lc; int register_ok; stats* counters ; MSList* proxys; int dummy=0; - mgr=configure_lcm(); - lc=mgr->lc; - counters = get_stats(lc); + lcm=configure_lcm(); + if (lcm) { + lc=lcm->lc; + counters = get_stats(lc); - register_ok=counters->number_of_LinphoneRegistrationOk; + register_ok=counters->number_of_LinphoneRegistrationOk; - for (proxys=ms_list_copy(linphone_core_get_proxy_config_list(lc));proxys!=NULL;proxys=proxys->next) { - LinphoneProxyConfig* proxy_cfg=(LinphoneProxyConfig*)proxys->data; - linphone_proxy_config_edit(proxy_cfg); - linphone_proxy_config_enableregister(proxy_cfg,FALSE); - linphone_proxy_config_done(proxy_cfg); + for (proxys=ms_list_copy(linphone_core_get_proxy_config_list(lc));proxys!=NULL;proxys=proxys->next) { + LinphoneProxyConfig* proxy_cfg=(LinphoneProxyConfig*)proxys->data; + linphone_proxy_config_edit(proxy_cfg); + linphone_proxy_config_enableregister(proxy_cfg,FALSE); + linphone_proxy_config_done(proxy_cfg); + } + ms_list_free(proxys); + /*wait for unregistrations*/ + BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationCleared,register_ok /*because 1 udp*/)); + + sal_set_recv_error(lc->sal, 0); + + /*nothing should happen because no active registration*/ + wait_for_until(lc,lc, &dummy, 1, 3000); + BC_ASSERT_TRUE(counters->number_of_LinphoneRegistrationProgress == ms_list_size(linphone_core_get_proxy_config_list(lc))); + + BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); + + sal_set_recv_error(lc->sal, 1); /*reset*/ + + linphone_core_manager_destroy(lcm); } - ms_list_free(proxys); - /*wait for unregistrations*/ - BC_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationCleared,register_ok /*because 1 udp*/)); - - sal_set_recv_error(lc->sal, 0); - - /*nothing should happen because no active registration*/ - wait_for_until(lc,lc, &dummy, 1, 3000); - BC_ASSERT_TRUE(counters->number_of_LinphoneRegistrationProgress == ms_list_size(linphone_core_get_proxy_config_list(lc))); - - BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0,int,"%d"); - - sal_set_recv_error(lc->sal, 1); /*reset*/ - - linphone_core_manager_destroy(mgr); } static void tls_certificate_failure(){ - LinphoneCoreManager* mgr; + LinphoneCoreManager* lcm; LinphoneCore *lc; char rootcapath[256]; - mgr=linphone_core_manager_new2("pauline_rc",FALSE); - lc=mgr->lc; - snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/agent.pem", bc_tester_read_dir_prefix); /*bad root ca*/ - linphone_core_set_root_ca(mgr->lc,rootcapath); - linphone_core_set_network_reachable(lc,TRUE); - BC_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&mgr->stat.number_of_LinphoneRegistrationFailed,1)); - linphone_core_set_root_ca(mgr->lc,NULL); /*no root ca*/ - linphone_core_refresh_registers(mgr->lc); - BC_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationFailed,2)); - snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); /*goot root ca*/ - linphone_core_set_root_ca(mgr->lc,rootcapath); - linphone_core_refresh_registers(mgr->lc); - BC_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,1)); - BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneRegistrationFailed,2, int, "%d"); - linphone_core_destroy(mgr->lc); + lcm=linphone_core_manager_new2("pauline_rc",FALSE); + lc=lcm->lc; + if (transport_supported(lc,LinphoneTransportTls)) { + snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/agent.pem", bc_tester_read_dir_prefix); /*bad root ca*/ + linphone_core_set_root_ca(lcm->lc,rootcapath); + linphone_core_set_network_reachable(lc,TRUE); + BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&lcm->stat.number_of_LinphoneRegistrationFailed,1)); + linphone_core_set_root_ca(lcm->lc,NULL); /*no root ca*/ + linphone_core_refresh_registers(lcm->lc); + BC_ASSERT_TRUE(wait_for(lc,lc,&lcm->stat.number_of_LinphoneRegistrationFailed,2)); + snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); /*goot root ca*/ + linphone_core_set_root_ca(lcm->lc,rootcapath); + linphone_core_refresh_registers(lcm->lc); + BC_ASSERT_TRUE(wait_for(lc,lc,&lcm->stat.number_of_LinphoneRegistrationOk,1)); + BC_ASSERT_EQUAL(lcm->stat.number_of_LinphoneRegistrationFailed,2, int, "%d"); + } + linphone_core_manager_destroy(lcm); } /*the purpose of this test is to check that will not block the proxy config during SSL handshake for entire life in case of mistaken configuration*/ static void tls_with_non_tls_server(){ - LinphoneCoreManager *mgr; + LinphoneCoreManager *lcm; LinphoneProxyConfig* proxy_cfg; LinphoneAddress* addr; char tmp[256]; LinphoneCore *lc; - mgr=linphone_core_manager_new2( "marie_rc", 0); - lc=mgr->lc; - sal_set_transport_timeout(lc->sal,3000); - linphone_core_get_default_proxy(lc,&proxy_cfg); - linphone_proxy_config_edit(proxy_cfg); - addr=linphone_address_new(linphone_proxy_config_get_addr(proxy_cfg)); - snprintf(tmp,sizeof(tmp),"sip:%s:%i;transport=tls" ,linphone_address_get_domain(addr) - ,(linphone_address_get_port(addr)>0?linphone_address_get_port(addr):5060)); - linphone_proxy_config_set_server_addr(proxy_cfg,tmp); - linphone_proxy_config_done(proxy_cfg); - linphone_address_destroy(addr); - BC_ASSERT_TRUE(wait_for_until(lc,lc,&mgr->stat.number_of_LinphoneRegistrationFailed,1,5000)); - linphone_core_manager_destroy(mgr); + lcm=linphone_core_manager_new2( "marie_rc", 0); + lc=lcm->lc; + if (transport_supported(lc,LinphoneTransportTls)) { + sal_set_transport_timeout(lc->sal,3000); + linphone_core_get_default_proxy(lc,&proxy_cfg); + linphone_proxy_config_edit(proxy_cfg); + addr=linphone_address_new(linphone_proxy_config_get_addr(proxy_cfg)); + snprintf(tmp,sizeof(tmp),"sip:%s:%i;transport=tls" ,linphone_address_get_domain(addr) + ,(linphone_address_get_port(addr)>0?linphone_address_get_port(addr):5060)); + linphone_proxy_config_set_server_addr(proxy_cfg,tmp); + linphone_proxy_config_done(proxy_cfg); + linphone_address_destroy(addr); + BC_ASSERT_TRUE(wait_for_until(lc,lc,&lcm->stat.number_of_LinphoneRegistrationFailed,1,5000)); + } + linphone_core_manager_destroy(lcm); } static void tls_alt_name_register(){ - LinphoneCoreManager* mgr; + LinphoneCoreManager* lcm; LinphoneCore *lc; char rootcapath[256]; - mgr=linphone_core_manager_new2("pauline_alt_rc",FALSE); - lc=mgr->lc; - snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); - linphone_core_set_root_ca(mgr->lc,rootcapath); - linphone_core_refresh_registers(mgr->lc); - BC_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,1)); - BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneRegistrationFailed,0, int, "%d"); - linphone_core_manager_destroy(mgr); + lcm=linphone_core_manager_new2("pauline_alt_rc",FALSE); + lc=lcm->lc; + if (transport_supported(lc,LinphoneTransportTls)) { + snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); + linphone_core_set_root_ca(lc,rootcapath); + linphone_core_refresh_registers(lc); + BC_ASSERT_TRUE(wait_for(lc,lc,&lcm->stat.number_of_LinphoneRegistrationOk,1)); + BC_ASSERT_EQUAL(lcm->stat.number_of_LinphoneRegistrationFailed,0, int, "%d"); + } + linphone_core_manager_destroy(lcm); } static void tls_wildcard_register(){ - LinphoneCoreManager* mgr; + LinphoneCoreManager* lcm; LinphoneCore *lc; char rootcapath[256]; - mgr=linphone_core_manager_new2("pauline_wild_rc",FALSE); - lc=mgr->lc; - snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); - linphone_core_set_root_ca(mgr->lc,rootcapath); - linphone_core_refresh_registers(mgr->lc); - BC_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,2)); - BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneRegistrationFailed,0, int, "%d"); - linphone_core_destroy(mgr->lc); + lcm=linphone_core_manager_new2("pauline_wild_rc",FALSE); + lc=lcm->lc; + if (transport_supported(lc,LinphoneTransportTls)) { + snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); + linphone_core_set_root_ca(lc,rootcapath); + linphone_core_refresh_registers(lc); + BC_ASSERT_TRUE(wait_for(lc,lc,&lcm->stat.number_of_LinphoneRegistrationOk,2)); + BC_ASSERT_EQUAL(lcm->stat.number_of_LinphoneRegistrationFailed,0, int, "%d"); + } + linphone_core_manager_destroy(lcm); } static void redirect(){ @@ -824,9 +849,11 @@ static void redirect(){ LCSipTransports transport = {-1,0,0,0}; sprintf(route,"sip:%s:5064",test_route); lcm = create_lcm(); - linphone_core_set_user_agent(lcm->lc,"redirect",NULL); - register_with_refresh_base_2(lcm->lc,FALSE,test_domain,route,FALSE,transport); - linphone_core_manager_destroy(lcm); + if (lcm) { + linphone_core_set_user_agent(lcm->lc,"redirect",NULL); + register_with_refresh_base_2(lcm->lc,FALSE,test_domain,route,FALSE,transport); + linphone_core_manager_destroy(lcm); + } } test_t register_tests[] = { diff --git a/tester/remote_provisioning_tester.c b/tester/remote_provisioning_tester.c index ad3c5ebb1..cd4e19536 100644 --- a/tester/remote_provisioning_tester.c +++ b/tester/remote_provisioning_tester.c @@ -59,8 +59,10 @@ static void remote_provisioning_transient(void) { static void remote_provisioning_https(void) { LinphoneCoreManager* marie = linphone_core_manager_new2("marie_remote_https_rc", FALSE); - BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringSuccessful,1)); - BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneRegistrationOk,1)); + if (transport_supported(marie->lc, LinphoneTransportTls)) { + BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringSuccessful,1)); + BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneRegistrationOk,1)); + } linphone_core_manager_destroy(marie); } diff --git a/tester/tester.c b/tester/tester.c index e63629bc3..9479abc2c 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -224,6 +224,12 @@ LinphoneCoreManager *get_manager(LinphoneCore *lc){ return manager; } +bool_t transport_supported(LinphoneCore *lc, LinphoneTransportType transport) { + bool_t supported = linphone_core_sip_transport_supported(lc, transport); + if (!supported) ms_warning("TLS transport not supported, falling back to TCP if possible otherwise skipping test."); + return supported; +} + LinphoneCoreManager* linphone_core_manager_init(const char* rc_file) { LinphoneCoreManager* mgr= ms_new0(LinphoneCoreManager,1); char *rc_path = NULL; @@ -402,7 +408,7 @@ void liblinphone_tester_add_suites() { bc_tester_add_suite(&remote_provisioning_test_suite); bc_tester_add_suite(&quality_reporting_test_suite); bc_tester_add_suite(&log_collection_test_suite); - bc_tester_add_suite(&transport_test_suite); + bc_tester_add_suite(&tunnel_test_suite); bc_tester_add_suite(&player_test_suite); bc_tester_add_suite(&dtmf_test_suite); #if defined(VIDEO_ENABLED) && defined(HAVE_GTK) diff --git a/tester/transport_tester.c b/tester/tunnel_tester.c similarity index 85% rename from tester/transport_tester.c rename to tester/tunnel_tester.c index aae69c3a0..4355fd9e1 100644 --- a/tester/transport_tester.c +++ b/tester/tunnel_tester.c @@ -58,7 +58,7 @@ static char* get_public_contact_ip(LinphoneCore* lc) { } -static void call_with_transport_base(LinphoneTunnelMode tunnel_mode, bool_t with_sip, LinphoneMediaEncryption encryption, bool_t with_video_and_ice) { +static void call_with_tunnel_base(LinphoneTunnelMode tunnel_mode, bool_t with_sip, LinphoneMediaEncryption encryption, bool_t with_video_and_ice) { if (linphone_core_tunnel_available()){ LinphoneCoreManager *pauline = linphone_core_manager_new( "pauline_rc"); LinphoneCoreManager *marie = linphone_core_manager_new( "marie_rc"); @@ -174,30 +174,30 @@ static void call_with_transport_base(LinphoneTunnelMode tunnel_mode, bool_t with static void call_with_tunnel(void) { - call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, FALSE); + call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, FALSE); } static void call_with_tunnel_srtp(void) { - call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionSRTP, FALSE); + call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionSRTP, FALSE); } static void call_with_tunnel_without_sip(void) { - call_with_transport_base(LinphoneTunnelModeEnable, FALSE, LinphoneMediaEncryptionNone, FALSE); + call_with_tunnel_base(LinphoneTunnelModeEnable, FALSE, LinphoneMediaEncryptionNone, FALSE); } static void call_with_tunnel_auto(void) { - call_with_transport_base(LinphoneTunnelModeAuto, TRUE, LinphoneMediaEncryptionNone, FALSE); + call_with_tunnel_base(LinphoneTunnelModeAuto, TRUE, LinphoneMediaEncryptionNone, FALSE); } static void call_with_tunnel_auto_without_sip_with_srtp(void) { - call_with_transport_base(LinphoneTunnelModeAuto, FALSE, LinphoneMediaEncryptionSRTP, FALSE); + call_with_tunnel_base(LinphoneTunnelModeAuto, FALSE, LinphoneMediaEncryptionSRTP, FALSE); } #ifdef VIDEO_ENABLED static void full_tunnel_video_ice_call(void){ if (linphone_core_tunnel_available()){ - call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, TRUE); + call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, TRUE); }else ms_warning("Could not test %s because tunnel functionality is not available",__FUNCTION__); } @@ -250,28 +250,28 @@ static void tunnel_ice_call(void) { else ms_warning("Could not test %s because tunnel functionality is not available",__FUNCTION__); } -test_t transport_tests[] = { - { "Tunnel only", call_with_tunnel }, - { "Tunnel with SRTP", call_with_tunnel_srtp }, - { "Tunnel without SIP", call_with_tunnel_without_sip }, - { "Tunnel in automatic mode", call_with_tunnel_auto }, - { "Tunnel in automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp }, - { "Tunnel ice call", tunnel_ice_call }, - { "Tunnel SRTP ice call", tunnel_srtp_ice_call }, - { "Tunnel ZRTP ice call", tunnel_zrtp_ice_call }, +test_t tunnel_tests[] = { + { "Simple", call_with_tunnel }, + { "With SRTP", call_with_tunnel_srtp }, + { "Without SIP", call_with_tunnel_without_sip }, + { "In automatic mode", call_with_tunnel_auto }, + { "In automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp }, + { "Ice call", tunnel_ice_call }, + { "SRTP ice call", tunnel_srtp_ice_call }, + { "ZRTP ice call", tunnel_zrtp_ice_call }, #ifdef VIDEO_ENABLED - { "Tunnel ice video call", tunnel_video_ice_call }, - { "Tunnel with SIP - ice video call", full_tunnel_video_ice_call }, - { "Tunnel SRTP ice video call", tunnel_srtp_video_ice_call }, - { "Tunnel DTLS ice video call", tunnel_dtls_video_ice_call }, - { "Tunnel ZRTP ice video call", tunnel_zrtp_video_ice_call }, + { "Ice video call", tunnel_video_ice_call }, + { "With SIP - ice video call", full_tunnel_video_ice_call }, + { "SRTP ice video call", tunnel_srtp_video_ice_call }, + { "DTLS ice video call", tunnel_dtls_video_ice_call }, + { "ZRTP ice video call", tunnel_zrtp_video_ice_call }, #endif }; -test_suite_t transport_test_suite = { - "Transport", +test_suite_t tunnel_test_suite = { + "Tunnel", NULL, NULL, - sizeof(transport_tests) / sizeof(transport_tests[0]), - transport_tests + sizeof(tunnel_tests) / sizeof(tunnel_tests[0]), + tunnel_tests }; diff --git a/tester/video_tester.c b/tester/video_tester.c index 163d2f3f0..789297807 100644 --- a/tester/video_tester.c +++ b/tester/video_tester.c @@ -247,7 +247,7 @@ static void early_media_video_during_video_call_test(void) { LinphoneCallParams *laure_params; marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new("pauline_rc"); + pauline = linphone_core_manager_new("pauline_tcp_rc"); laure = linphone_core_manager_new("laure_rc"); marie_params = configure_for_early_media_video_receiving(marie); pauline_params = configure_for_video(pauline); @@ -297,7 +297,7 @@ static void two_incoming_early_media_video_calls_test(void) { const MSList *calls_list; marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new("pauline_rc"); + pauline = linphone_core_manager_new("pauline_tcp_rc"); laure = linphone_core_manager_new("laure_rc"); marie_params = configure_for_early_media_video_receiving(marie); pauline_params = configure_for_early_media_video_sending(pauline); @@ -364,7 +364,7 @@ static void early_media_video_with_inactive_audio(void) { LinphoneCallParams *pauline_params; marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new("pauline_rc"); + pauline = linphone_core_manager_new("pauline_tcp_rc"); marie_params = configure_for_early_media_video_receiving_with_inactive_audio(marie); pauline_params = configure_for_early_media_video_sending(pauline);