From 1052ffc6108f503d536b910ac6a59389943c97ba Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 3 Oct 2015 11:22:16 +0200 Subject: [PATCH] add debug logs for troubeshooting android failed tests --- coreapi/linphonecall.c | 9 +++++++-- tester/call_tester.c | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 19fb39fce..cba490570 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1672,6 +1672,7 @@ static unsigned int linphone_call_get_n_active_streams(const LinphoneCall *call) **/ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){ SalMediaDescription *md=call->resultdesc; + int all_streams_encrypted = 0; #ifdef VIDEO_ENABLED VideoStream *vstream; #endif @@ -1698,17 +1699,21 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){ switch (call->params->media_encryption) { case LinphoneMediaEncryptionZRTP: - if (linphone_call_all_streams_encrypted(call) && linphone_call_get_authentication_token(call)) { + if ((all_streams_encrypted = linphone_call_all_streams_encrypted(call)) && linphone_call_get_authentication_token(call)) { call->current_params->media_encryption=LinphoneMediaEncryptionZRTP; } else { + ms_message("Encryption was resquested to be %s, but isn't effective (all_streams_encrypted=%i, auth_token=%s)", + linphone_media_encryption_to_string(call->params->media_encryption), all_streams_encrypted, call->auth_token); call->current_params->media_encryption=LinphoneMediaEncryptionNone; } break; case LinphoneMediaEncryptionDTLS: case LinphoneMediaEncryptionSRTP: - if (linphone_call_get_n_active_streams(call)==0 || linphone_call_all_streams_encrypted(call)) { + if (linphone_call_get_n_active_streams(call)==0 || (all_streams_encrypted = linphone_call_all_streams_encrypted(call))) { call->current_params->media_encryption = call->params->media_encryption; } else { + ms_message("Encryption was resquested to be %s, but isn't effective (all_streams_encrypted=%i)", + linphone_media_encryption_to_string(call->params->media_encryption), all_streams_encrypted); call->current_params->media_encryption=LinphoneMediaEncryptionNone; } break; diff --git a/tester/call_tester.c b/tester/call_tester.c index e3aa0cd1d..27c89115e 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -304,7 +304,7 @@ bool_t call_with_params2(LinphoneCoreManager* caller_mgr wait_for(callee_mgr->lc,caller_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallEncryptedOn,initial_callee.number_of_LinphoneCallEncryptedOn+1); { const LinphoneCallParams* call_param = linphone_call_get_current_params(callee_call); - BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(call_param),linphone_core_get_media_encryption(caller_mgr->lc), int, "%d"); + BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(call_param),linphone_core_get_media_encryption(callee_mgr->lc), int, "%d"); call_param = linphone_call_get_current_params(linphone_core_get_current_call(caller_mgr->lc)); BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(call_param),linphone_core_get_media_encryption(caller_mgr->lc), int, "%d"); @@ -3460,6 +3460,7 @@ void two_accepted_call_in_send_only(void) { MSList *lcs=NULL; marie = linphone_core_manager_new("marie_rc"); + linphone_core_use_files(marie->lc, TRUE); pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); laure = linphone_core_manager_new("laure_rc"); @@ -3469,7 +3470,6 @@ void two_accepted_call_in_send_only(void) { accept_call_in_send_only_base(pauline,marie,lcs); - reset_counters(&marie->stat); accept_call_in_send_only_base(laure,marie,lcs);