mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 13:08:08 +00:00
Fix cancelled_ringing_call test
This commit is contained in:
parent
8b0a3f926e
commit
627eb03451
1 changed files with 24 additions and 22 deletions
|
|
@ -1128,22 +1128,22 @@ static void cancel_other_device_after_accept(void) {
|
|||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingProgress, 1));
|
||||
call_callee = linphone_core_get_current_call(callee_mgr->lc);
|
||||
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
|
||||
|
||||
|
||||
linphone_call_ref(call_callee);
|
||||
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
|
||||
linphone_call_ref(call_callee_2);
|
||||
BC_ASSERT_PTR_NOT_NULL(call_callee_2);
|
||||
|
||||
|
||||
BC_ASSERT_EQUAL( linphone_call_accept(call_callee), 0 , int, "%d");
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallConnected,1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
|
||||
|
||||
|
||||
wait_for_until(caller_mgr->lc,callee_mgr_2->lc,NULL,0,500);
|
||||
|
||||
|
||||
rei = linphone_call_get_error_info(call_callee_2);
|
||||
BC_ASSERT_PTR_NOT_NULL(rei);
|
||||
if (rei){
|
||||
|
|
@ -1183,12 +1183,12 @@ static void cancel_other_device_after_decline(void) {
|
|||
call_callee = linphone_core_get_current_call(callee_mgr->lc);
|
||||
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
|
||||
linphone_call_ref(call_callee);
|
||||
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
|
||||
linphone_call_ref(call_callee_2);
|
||||
BC_ASSERT_PTR_NOT_NULL(call_callee_2);
|
||||
|
||||
|
||||
BC_ASSERT_EQUAL(linphone_call_decline(call_callee, LinphoneReasonDeclined), 0 , int, "%d");
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallEnd,1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallReleased, 1));
|
||||
|
|
@ -1196,7 +1196,7 @@ static void cancel_other_device_after_decline(void) {
|
|||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &callee_mgr->stat.number_of_LinphoneCallReleased, 1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
|
||||
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
|
||||
|
||||
|
||||
rei = linphone_call_get_error_info(call_callee_2);
|
||||
BC_ASSERT_PTR_NOT_NULL(rei);
|
||||
if (rei){
|
||||
|
|
@ -1318,11 +1318,11 @@ static void cancelled_ringing_call(void) {
|
|||
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
|
||||
const bctbx_list_t * call_history;
|
||||
LinphoneCall* out_call;
|
||||
|
||||
|
||||
char * db_path= bctbx_strdup_printf("%s,%s",bc_tester_get_writable_dir_prefix(),"tmp_call_log.db");
|
||||
linphone_core_set_call_logs_database_path(marie->lc,db_path);
|
||||
|
||||
|
||||
|
||||
|
||||
out_call = linphone_core_invite_address(pauline->lc,marie->identity);
|
||||
linphone_call_ref(out_call);
|
||||
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallIncomingReceived,1));
|
||||
|
|
@ -1332,12 +1332,13 @@ static void cancelled_ringing_call(void) {
|
|||
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallReleased,1));
|
||||
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd,1, int, "%d");
|
||||
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallEnd,1, int, "%d");
|
||||
|
||||
|
||||
call_history = linphone_core_get_call_history(marie->lc);
|
||||
BC_ASSERT_PTR_NOT_NULL(call_history);
|
||||
BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i");
|
||||
BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i");
|
||||
|
||||
if (BC_ASSERT_PTR_NOT_NULL(call_history)) {
|
||||
BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i");
|
||||
BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i");
|
||||
}
|
||||
|
||||
linphone_call_unref(out_call);
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
|
|
@ -1709,7 +1710,7 @@ static void on_ack_processing(LinphoneCall *call, LinphoneHeaders *ack, bool_t i
|
|||
static void call_created(LinphoneCore *lc, LinphoneCall *call){
|
||||
LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get());
|
||||
linphone_call_cbs_set_ack_processing(cbs, on_ack_processing);
|
||||
linphone_call_add_callbacks(call, cbs);
|
||||
linphone_call_add_callbacks(call, cbs);
|
||||
linphone_call_cbs_unref(cbs);
|
||||
}
|
||||
|
||||
|
|
@ -1728,7 +1729,7 @@ static void call_with_custom_headers(void) {
|
|||
char* tmp=linphone_address_as_string_uri_only(marie->identity);
|
||||
char tmp2[256];
|
||||
LinphoneCoreCbs *core_cbs = linphone_factory_create_core_cbs(linphone_factory_get());
|
||||
|
||||
|
||||
snprintf(tmp2,sizeof(tmp2),"%s?uriHeader=myUriHeader",tmp);
|
||||
marie_identity=linphone_address_new(tmp2);
|
||||
ms_free(tmp);
|
||||
|
|
@ -1738,7 +1739,7 @@ static void call_with_custom_headers(void) {
|
|||
params=linphone_core_create_call_params(marie->lc, NULL);
|
||||
linphone_call_params_add_custom_header(params,"Weather","bad");
|
||||
linphone_call_params_add_custom_header(params,"Working","yes");
|
||||
|
||||
|
||||
linphone_core_cbs_set_call_created(core_cbs, call_created);
|
||||
linphone_core_add_callbacks(marie->lc, core_cbs);
|
||||
linphone_core_add_callbacks(pauline->lc, core_cbs);
|
||||
|
|
@ -1773,11 +1774,11 @@ static void call_with_custom_headers(void) {
|
|||
BC_ASSERT_PTR_NOT_NULL(marie_remote_contact_header);
|
||||
BC_ASSERT_STRING_EQUAL(pauline_remote_contact,pauline_remote_contact_header);
|
||||
BC_ASSERT_STRING_EQUAL(marie_remote_contact,marie_remote_contact_header);
|
||||
|
||||
|
||||
|
||||
|
||||
/*we need to wait for the ack to arrive*/
|
||||
wait_for_until(marie->lc, pauline->lc, NULL, 0, 3000);
|
||||
|
||||
|
||||
BC_ASSERT_TRUE(linphone_call_get_user_data(call_marie) == (void*)1);
|
||||
BC_ASSERT_TRUE(linphone_call_get_user_data(call_pauline) == (void*)1);
|
||||
|
||||
|
|
@ -5035,6 +5036,7 @@ static void recovered_call_on_network_switch_during_reinvite_1(void) {
|
|||
wait_for(marie->lc, pauline->lc, &marie->stat.number_of_NetworkReachableTrue, 2);
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallPaused, 1));
|
||||
wait_for_until(marie->lc, pauline->lc, NULL, 1, 2000);
|
||||
linphone_call_terminate(incoming_call);
|
||||
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1));
|
||||
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallReleased, 1));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue