diff --git a/coreapi/remote_conference.cpp b/coreapi/remote_conference.cpp index 2aec803f4f80ba0504a96739b9364ff13414058c..6f9bccbaa23d2e46561d44cefce8b842d63d9d59 100644 --- a/coreapi/remote_conference.cpp +++ b/coreapi/remote_conference.cpp @@ -1412,6 +1412,7 @@ void RemoteConference::onParticipantDeviceStateChanged( return (*devAddr == contactAddress); }); + const auto &deviceAddress = device->getAddress(); const auto &audioAvailable = device->getStreamAvailability(LinphoneStreamTypeAudio); const auto &confSecurityLevel = confParams->getSecurityLevel(); const auto audioNeedsReInvite = ((confSecurityLevel == ConferenceParams::SecurityLevel::EndToEnd) && @@ -1419,13 +1420,14 @@ void RemoteConference::onParticipantDeviceStateChanged( const auto &videoAvailable = device->getStreamAvailability(LinphoneStreamTypeVideo); const auto videoNeedsReInvite = (confParams->videoEnabled() && params->videoEnabled() && videoAvailable); if ((getState() == ConferenceInterface::State::Created) && (callIt == m_pendingCalls.cend()) && isIn() && - (device->getState() == ParticipantDevice::State::Present) && ((videoNeedsReInvite || audioNeedsReInvite))) { - auto updateSession = [this, device]() -> LinphoneStatus { - lInfo() << "Sending re-INVITE in order to get streams for participant device " << *device->getAddress() + (device->getState() == ParticipantDevice::State::Present) && ((videoNeedsReInvite || audioNeedsReInvite)) && + !isMe(deviceAddress)) { + auto updateSession = [this, deviceAddress]() -> LinphoneStatus { + lInfo() << "Sending re-INVITE in order to get streams for participant device " << *deviceAddress << " that joined recently the conference " << *getConferenceAddress(); auto ret = updateMainSession(); if (ret != 0) { - lInfo() << "re-INVITE to get streams for participant device " << *device->getAddress() + lInfo() << "re-INVITE to get streams for participant device " << *deviceAddress << " that recently joined the conference " << *getConferenceAddress() << " cannot be sent right now"; } diff --git a/src/conference/conference-scheduler.cpp b/src/conference/conference-scheduler.cpp index aa44a4a8f8c1429c8648febe13761fdfd60c00c9..71df127fb5e8cdc3bf4a589c8fbc339e3a727145 100644 --- a/src/conference/conference-scheduler.cpp +++ b/src/conference/conference-scheduler.cpp @@ -525,7 +525,7 @@ void ConferenceScheduler::sendInvitations(shared_ptr<ChatRoomParams> chatRoomPar if (!sender->weakEqual(*participant)) { mInvitationsToSend.push_back(participant); } else { - lInfo() << "[Conference Scheduler] [" << this << "] Removed conference participant [" << participant + lInfo() << "[Conference Scheduler] [" << this << "] Removed conference participant [" << *participant << "] from chat room participants as it is ourselves"; } @@ -568,7 +568,7 @@ void ConferenceScheduler::sendInvitations(shared_ptr<ChatRoomParams> chatRoomPar const bool organizerFound = (std::find(mInvitationsToSend.cbegin(), mInvitationsToSend.cend(), organizer) != mInvitationsToSend.cend()); if (!organizerFound) { - lInfo() << "[Conference Scheduler] [" << this << "] Organizer [" << organizer + lInfo() << "[Conference Scheduler] [" << this << "] Organizer [" << *organizer << "] not found in conference participants, adding it to chat room participants"; mInvitationsToSend.push_back(organizer); } @@ -583,7 +583,7 @@ void ConferenceScheduler::sendInvitations(shared_ptr<ChatRoomParams> chatRoomPar mInvitationsSent = 0; // Sending the ICS once for each participant in a separated chat room each time. - for (auto participant : invitees) { + for (auto participant : mInvitationsToSend) { list<std::shared_ptr<Address>> chatRoomParticipantList; chatRoomParticipantList.push_back(participant); list<std::shared_ptr<Address>> participantList; diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 7bcdd449cb4c8aca984912e2d2aafaddd56e25f8..371ac81d796d56f082155cf515758352fe0d7e60 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -1989,6 +1989,7 @@ shared_ptr<ConferenceInfo> MainDbPrivate::selectConferenceInfo(const soci::row & "conference_info_participant.is_participant = 1"; soci::rowset<soci::row> participantRows = (session->prepare << participantQuery, soci::use(dbConferenceInfoId)); + std::string emptyString; for (const auto &participantRow : participantRows) { int deleted = participantRow.get<int>(1); if (deleted == 0) { @@ -2006,7 +2007,7 @@ shared_ptr<ConferenceInfo> MainDbPrivate::selectConferenceInfo(const soci::row & // Set parameter string to an empty string *session << "UPDATE conference_info_participant SET params = :paramsStr WHERE conference_info_id = " ":conferenceInfoId", - soci::use(std::string()), soci::use(dbConferenceInfoId); + soci::use(emptyString), soci::use(dbConferenceInfoId); } participantInfo->setParameters(participantParams); conferenceInfo->addParticipant(participantInfo); diff --git a/tester/capability_negotiation_tester.cpp b/tester/capability_negotiation_tester.cpp index 59faec37507b05a6a97a1c8b93e377b56302c463..e46e2514651567604532c15f1111e03c2d0bb4a0 100644 --- a/tester/capability_negotiation_tester.cpp +++ b/tester/capability_negotiation_tester.cpp @@ -418,6 +418,14 @@ void encrypted_call_with_params_base(LinphoneCoreManager *caller, BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(calleeCall))); BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(callerCall))); + if ((expectedEncryption == LinphoneMediaEncryptionDTLS) || + (expectedEncryption == LinphoneMediaEncryptionZRTP)) { + BC_ASSERT_TRUE(wait_for_until(callee->lc, caller->lc, &caller->stat.number_of_LinphoneCallEncryptedOn, + caller_stat.number_of_LinphoneCallEncryptedOn + 1, 10000)); + BC_ASSERT_TRUE(wait_for_until(callee->lc, caller->lc, &callee->stat.number_of_LinphoneCallEncryptedOn, + callee_stat.number_of_LinphoneCallEncryptedOn + 1, 10000)); + } + int dummy = 0; wait_for_until(caller->lc, callee->lc, &dummy, 1, 3000); /*just to sleep while iterating 1s*/ @@ -1795,7 +1803,12 @@ static void call_with_no_sdp_on_update_base(const bool_t caller_cap_neg, liblinphone_tester_check_rtcp(marie, pauline); - wait_for_until(marie->lc, pauline->lc, NULL, 5, 2000); + if ((expectedEncryption == LinphoneMediaEncryptionZRTP) || (expectedEncryption == LinphoneMediaEncryptionDTLS)) { + BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneCallEncryptedOn, + (marie_stat.number_of_LinphoneCallEncryptedOn + 1))); + BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneCallEncryptedOn, + (pauline_stat.number_of_LinphoneCallEncryptedOn + 1))); + } // Check that encryption has not changed after sending update BC_ASSERT_EQUAL(expectedEncryption, encryptionAfterUpdate, int, "%i"); diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 1793108e1dad5a1b0c79fcaa1668313fe7cd0fb5..b6dd2063e32e83765f6d320e33e5e7af72cc7e41 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -483,88 +483,88 @@ void liblinphone_tester_add_suite_with_default_time(test_suite_t *suite, int ave } void liblinphone_tester_add_suites(void) { - liblinphone_tester_add_suite_with_default_time(&setup_test_suite, 83); + liblinphone_tester_add_suite_with_default_time(&setup_test_suite, 157); liblinphone_tester_add_suite_with_default_time(®ister_test_suite, 267); #ifdef HAVE_ADVANCED_IM liblinphone_tester_add_suite_with_default_time(&group_chat_test_suite, 230); liblinphone_tester_add_suite_with_default_time(&group_chat2_test_suite, 402); - liblinphone_tester_add_suite_with_default_time(&group_chat3_test_suite, 136); - liblinphone_tester_add_suite_with_default_time(&group_chat4_test_suite, 250); + liblinphone_tester_add_suite_with_default_time(&group_chat3_test_suite, 166); + liblinphone_tester_add_suite_with_default_time(&group_chat4_test_suite, 285); liblinphone_tester_add_suite_with_default_time(&cpim_test_suite, 3); liblinphone_tester_add_suite_with_default_time(&ics_test_suite, 28); #ifdef HAVE_LIME_X3DH - liblinphone_tester_add_suite_with_default_time(&secure_group_chat_test_suite, 332); + liblinphone_tester_add_suite_with_default_time(&secure_group_chat_test_suite, 506); liblinphone_tester_add_suite_with_default_time(&secure_group_chat_exhume_test_suite, 100); - liblinphone_tester_add_suite_with_default_time(&secure_message_test_suite, 352); - liblinphone_tester_add_suite_with_default_time(&secure_message2_test_suite, 170); + liblinphone_tester_add_suite_with_default_time(&secure_message_test_suite, 423); + liblinphone_tester_add_suite_with_default_time(&secure_message2_test_suite, 204); liblinphone_tester_add_suite_with_default_time(&lime_server_auth_test_suite, 125); liblinphone_tester_add_suite_with_default_time(&ephemeral_group_chat_test_suite, 514); - liblinphone_tester_add_suite_with_default_time(&ephemeral_group_chat_basic_test_suite, 141); + liblinphone_tester_add_suite_with_default_time(&ephemeral_group_chat_basic_test_suite, 189); #endif - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_conference_edition, 67); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_conference_edition, 150); liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_scheduled_conference_basic, 540); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_scheduled_conference_advanced, 757); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_scheduled_conference_advanced, 574); liblinphone_tester_add_suite_with_default_time( - &local_conference_test_suite_scheduled_conference_audio_only_participant, 300); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_scheduled_ice_conference, 371); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_inpromptu_conference, 351); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_inpromptu_mismatch_conference, 198); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_basic, 300); + &local_conference_test_suite_scheduled_conference_audio_only_participant, 581); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_scheduled_ice_conference, 563); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_inpromptu_conference, 504); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_inpromptu_mismatch_conference, 210); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_basic, 481); liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_advanced, 300); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_error, 246); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_imdn, 215); - liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_ephemeral_chat, 201); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_error, 261); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_chat_imdn, 315); + liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_ephemeral_chat, 281); liblinphone_tester_add_suite_with_default_time(&local_conference_test_suite_secure_chat, 441); #endif liblinphone_tester_add_suite_with_default_time(&tunnel_test_suite, 0); - liblinphone_tester_add_suite_with_default_time(&offeranswer_test_suite, 185); - liblinphone_tester_add_suite_with_default_time(&call_test_suite, 409); - liblinphone_tester_add_suite_with_default_time(&call2_test_suite, 244); + liblinphone_tester_add_suite_with_default_time(&offeranswer_test_suite, 221); + liblinphone_tester_add_suite_with_default_time(&call_test_suite, 545); + liblinphone_tester_add_suite_with_default_time(&call2_test_suite, 370); bc_tester_add_suite(&call_not_established_test_suite); - liblinphone_tester_add_suite_with_default_time(&push_incoming_call_test_suite, 40); - liblinphone_tester_add_suite_with_default_time(&call_recovery_test_suite, 246); - liblinphone_tester_add_suite_with_default_time(&call_with_ice_test_suite, 324); - liblinphone_tester_add_suite_with_default_time(&call_secure_test_suite, 324); - liblinphone_tester_add_suite_with_default_time(&capability_negotiation_test_suite, 328); + liblinphone_tester_add_suite_with_default_time(&push_incoming_call_test_suite, 65); + liblinphone_tester_add_suite_with_default_time(&call_recovery_test_suite, 283); + liblinphone_tester_add_suite_with_default_time(&call_with_ice_test_suite, 494); + liblinphone_tester_add_suite_with_default_time(&call_secure_test_suite, 771); + liblinphone_tester_add_suite_with_default_time(&capability_negotiation_test_suite, 378); liblinphone_tester_add_suite_with_default_time(&capability_negotiation_parameters_test_suite, 236); liblinphone_tester_add_suite_with_default_time(&capability_negotiation_no_sdp_test_suite, 266); - liblinphone_tester_add_suite_with_default_time(&srtp_capability_negotiation_basic_test_suite, 363); + liblinphone_tester_add_suite_with_default_time(&srtp_capability_negotiation_basic_test_suite, 495); liblinphone_tester_add_suite_with_default_time(&srtp_capability_negotiation_test_suite, 395); liblinphone_tester_add_suite_with_default_time(&zrtp_capability_negotiation_basic_test_suite, 468); - liblinphone_tester_add_suite_with_default_time(&zrtp_capability_negotiation_test_suite, 286); - liblinphone_tester_add_suite_with_default_time(&dtls_srtp_capability_negotiation_basic_test_suite, 271); - liblinphone_tester_add_suite_with_default_time(&dtls_srtp_capability_negotiation_test_suite, 144); + liblinphone_tester_add_suite_with_default_time(&zrtp_capability_negotiation_test_suite, 331); + liblinphone_tester_add_suite_with_default_time(&dtls_srtp_capability_negotiation_basic_test_suite, 301); + liblinphone_tester_add_suite_with_default_time(&dtls_srtp_capability_negotiation_test_suite, 173); liblinphone_tester_add_suite_with_default_time(&ice_capability_negotiation_test_suite, 10); - liblinphone_tester_add_suite_with_default_time(&srtp_ice_capability_negotiation_test_suite, 98); - liblinphone_tester_add_suite_with_default_time(&zrtp_ice_capability_negotiation_test_suite, 79); + liblinphone_tester_add_suite_with_default_time(&srtp_ice_capability_negotiation_test_suite, 116); + liblinphone_tester_add_suite_with_default_time(&zrtp_ice_capability_negotiation_test_suite, 95); liblinphone_tester_add_suite_with_default_time(&dtls_srtp_ice_capability_negotiation_test_suite, 101); #ifdef VIDEO_ENABLED liblinphone_tester_add_suite_with_default_time(&video_test_suite, 19); - liblinphone_tester_add_suite_with_default_time(&call_video_test_suite, 478); + liblinphone_tester_add_suite_with_default_time(&call_video_test_suite, 598); liblinphone_tester_add_suite_with_default_time(&call_video_msogl_test_suite, - 475); // Conditionals are defined in suite + 577); // Conditionals are defined in suite liblinphone_tester_add_suite_with_default_time(&call_video_advanced_scenarios_test_suite, 168); liblinphone_tester_add_suite_with_default_time(&call_video_quality_test_suite, 455); - liblinphone_tester_add_suite_with_default_time(&alerts_test_suite, 70); + liblinphone_tester_add_suite_with_default_time(&alerts_test_suite, 90); liblinphone_tester_add_suite_with_default_time(&call_flexfec_suite, 57); #endif // ifdef VIDEO_ENABLED liblinphone_tester_add_suite_with_default_time(&audio_bypass_suite, 11); liblinphone_tester_add_suite_with_default_time(&audio_routes_test_suite, 349); - liblinphone_tester_add_suite_with_default_time(&audio_quality_test_suite, 119); + liblinphone_tester_add_suite_with_default_time(&audio_quality_test_suite, 293); liblinphone_tester_add_suite_with_default_time(&audio_video_conference_basic_test_suite, 336); - liblinphone_tester_add_suite_with_default_time(&audio_video_conference_basic2_test_suite, 159); - liblinphone_tester_add_suite_with_default_time(&audio_conference_test_suite, 283); + liblinphone_tester_add_suite_with_default_time(&audio_video_conference_basic2_test_suite, 199); + liblinphone_tester_add_suite_with_default_time(&audio_conference_test_suite, 302); liblinphone_tester_add_suite_with_default_time(&audio_conference_local_participant_test_suite, 105); liblinphone_tester_add_suite_with_default_time(&audio_conference_remote_participant_test_suite, 126); - liblinphone_tester_add_suite_with_default_time(&video_conference_test_suite, 555); - liblinphone_tester_add_suite_with_default_time(&video_conference_layout_test_suite, 235); - liblinphone_tester_add_suite_with_default_time(&ice_conference_test_suite, 123); + liblinphone_tester_add_suite_with_default_time(&video_conference_test_suite, 291); + liblinphone_tester_add_suite_with_default_time(&video_conference_layout_test_suite, 259); + liblinphone_tester_add_suite_with_default_time(&ice_conference_test_suite, 163); liblinphone_tester_add_suite_with_default_time(&multi_call_test_suite, 73); liblinphone_tester_add_suite_with_default_time(&message_test_suite, 521); // liblinphone_tester_add_suite_with_default_time(&lime_message_test_suite, 27); liblinphone_tester_add_suite_with_default_time(&rtt_message_test_suite, 95); liblinphone_tester_add_suite_with_default_time(&session_timers_test_suite, 110); - liblinphone_tester_add_suite_with_default_time(&presence_test_suite, 62); + liblinphone_tester_add_suite_with_default_time(&presence_test_suite, 77); liblinphone_tester_add_suite_with_default_time(&presence_server_test_suite, 339); liblinphone_tester_add_suite_with_default_time(&account_creator_xmlrpc_test_suite, 140); liblinphone_tester_add_suite_with_default_time(&account_creator_local_test_suite, 3); @@ -572,7 +572,7 @@ void liblinphone_tester_add_suites(void) { liblinphone_tester_add_suite_with_default_time(&flexiapiclient_suite, 4); liblinphone_tester_add_suite_with_default_time(&account_creator_flexiapi_test_suite, 20); #endif - liblinphone_tester_add_suite_with_default_time(&stun_test_suite, 248); + liblinphone_tester_add_suite_with_default_time(&stun_test_suite, 259); liblinphone_tester_add_suite_with_default_time(&event_test_suite, 70); #ifdef HAVE_ADVANCED_IM liblinphone_tester_add_suite_with_default_time(&conference_event_test_suite, 32); @@ -580,14 +580,14 @@ void liblinphone_tester_add_suites(void) { liblinphone_tester_add_suite_with_default_time(&contents_test_suite, 0); liblinphone_tester_add_suite_with_default_time(&flexisip_test_suite, 495); liblinphone_tester_add_suite_with_default_time(&remote_provisioning_test_suite, 11); - liblinphone_tester_add_suite_with_default_time(&quality_reporting_test_suite, 47); + liblinphone_tester_add_suite_with_default_time(&quality_reporting_test_suite, 71); liblinphone_tester_add_suite_with_default_time(&log_collection_test_suite, 5); liblinphone_tester_add_suite_with_default_time(&player_test_suite, 81); - liblinphone_tester_add_suite_with_default_time(&recorder_test_suite, 15); + liblinphone_tester_add_suite_with_default_time(&recorder_test_suite, 33); liblinphone_tester_add_suite_with_default_time(&multipart_test_suite, 20); liblinphone_tester_add_suite_with_default_time(&clonable_object_test_suite, 0); #ifdef HAVE_DB_STORAGE - liblinphone_tester_add_suite_with_default_time(&main_db_test_suite, 6); + liblinphone_tester_add_suite_with_default_time(&main_db_test_suite, 25); liblinphone_tester_add_suite_with_default_time(&conference_info_tester, 2); #endif liblinphone_tester_add_suite_with_default_time(&property_container_test_suite, 0); @@ -601,10 +601,10 @@ void liblinphone_tester_add_suites(void) { liblinphone_tester_add_suite_with_default_time(&vcard_test_suite, 58); #endif liblinphone_tester_add_suite_with_default_time(&utils_test_suite, 0); - liblinphone_tester_add_suite_with_default_time(&call_with_rtp_bundle_test_suite, 96); + liblinphone_tester_add_suite_with_default_time(&call_with_rtp_bundle_test_suite, 148); liblinphone_tester_add_suite_with_default_time(&shared_core_test_suite, 22); liblinphone_tester_add_suite_with_default_time(&vfs_encryption_test_suite, 57); - liblinphone_tester_add_suite_with_default_time(&external_domain_test_suite, 143); + liblinphone_tester_add_suite_with_default_time(&external_domain_test_suite, 165); liblinphone_tester_add_suite_with_default_time(&potential_configuration_graph_test_suite, 0); liblinphone_tester_add_suite_with_default_time(&call_race_conditions_suite, 20); #ifdef CXX_WRAPPER_ENABLED @@ -628,7 +628,7 @@ void liblinphone_tester_init(void (*ftester_printf)(int level, const char *fmt, bc_tester_init(ftester_printf, ORTP_MESSAGE, ORTP_ERROR, "rcfiles"); liblinphone_tester_add_suites(); bc_tester_set_max_parallel_suites(20); /* empiricaly defined as sustainable for our lab 12 threads machine.*/ - bc_tester_set_global_timeout(18 * 60); /* 18 mn max */ + bc_tester_set_global_timeout(20 * 60); /* 20 mn max */ } int liblinphone_tester_set_log_file(const char *filename) { diff --git a/tester/local_conference_tester_functions.cpp b/tester/local_conference_tester_functions.cpp index f640110a33c28f172cd4013988e5a3f46d3a35f2..58f0b080b1d374cd7e59faf9cbb6a684a051885c 100644 --- a/tester/local_conference_tester_functions.cpp +++ b/tester/local_conference_tester_functions.cpp @@ -3707,8 +3707,8 @@ void create_conference_base(time_t start_time, */ if (enable) { participant_streams_running = 1; - focus_streams_running = static_cast<int>(members.size() + 1); - pauline_streams_running = 2; + focus_streams_running = static_cast<int>(members.size()); + pauline_streams_running = 1; } else { focus_streams_running = 1; pauline_streams_running = 1; @@ -3719,8 +3719,8 @@ void create_conference_base(time_t start_time, } } else { participant_streams_running = ((enable) ? 1 : 0); - focus_streams_running = static_cast<int>((enable) ? (members.size() + 1) : 1); - pauline_streams_running = ((enable) ? 2 : 1); + focus_streams_running = static_cast<int>((enable) ? (members.size()) : 1); + pauline_streams_running = 1; } BC_ASSERT_TRUE(wait_for_list(coresList, &pauline.getStats().number_of_LinphoneCallResuming, @@ -3995,10 +3995,10 @@ void create_conference_base(time_t start_time, if (enable_ice) { BC_ASSERT_TRUE(check_ice(michelle.getCMgr(), focus.getCMgr(), LinphoneIceStateHostConnection)); - BC_ASSERT_TRUE(wait_for_list(coresList, &michelle.getStats().number_of_LinphoneCallUpdating, 2, + BC_ASSERT_TRUE(wait_for_list(coresList, &michelle.getStats().number_of_LinphoneCallUpdating, 1, liblinphone_tester_sip_timeout)); BC_ASSERT_TRUE(wait_for_list(coresList, - &michelle.getStats().number_of_LinphoneCallStreamsRunning, 3, + &michelle.getStats().number_of_LinphoneCallStreamsRunning, 2, liblinphone_tester_sip_timeout)); } } @@ -4232,6 +4232,8 @@ void create_conference_base(time_t start_time, members.erase(itMembers); } + participantList.erase(laure.getCMgr()); + BC_ASSERT_TRUE(wait_for_list(coresList, &laure.getStats().number_of_LinphoneCallEnd, 1, liblinphone_tester_sip_timeout)); BC_ASSERT_TRUE(wait_for_list(coresList, &laure.getStats().number_of_LinphoneCallReleased, 1, @@ -4316,6 +4318,11 @@ void create_conference_base(time_t start_time, extraParticipantMgrs.push_back(berthe.getCMgr()); conferenceMgrs.push_back(berthe.getCMgr()); members.push_back(berthe.getCMgr()); + participantList.insert(std::make_pair( + berthe.getCMgr(), add_participant_info_to_list(&participants_info, michelle.getCMgr()->identity, + (listenerAllowed) ? LinphoneParticipantRoleListener + : LinphoneParticipantRoleSpeaker, + 0))); ms_message("%s is entering conference %s", linphone_core_get_identity(berthe.getLc()), conference_address_str); @@ -4344,10 +4351,10 @@ void create_conference_base(time_t start_time, if (enable_ice) { BC_ASSERT_TRUE(check_ice(berthe.getCMgr(), focus.getCMgr(), LinphoneIceStateHostConnection)); - BC_ASSERT_TRUE(wait_for_list(coresList, &berthe.getStats().number_of_LinphoneCallUpdating, 2, + BC_ASSERT_TRUE(wait_for_list(coresList, &berthe.getStats().number_of_LinphoneCallUpdating, 1, liblinphone_tester_sip_timeout)); BC_ASSERT_TRUE(wait_for_list(coresList, &berthe.getStats().number_of_LinphoneCallStreamsRunning, - 3, liblinphone_tester_sip_timeout)); + 2, liblinphone_tester_sip_timeout)); } BC_ASSERT_TRUE(wait_for_list( coresList, &focus.getStats().number_of_LinphoneCallUpdatedByRemote, @@ -4397,6 +4404,11 @@ void create_conference_base(time_t start_time, BC_ASSERT_TRUE(wait_for_list(coresList, &michelle.getStats().number_of_participant_devices_joined, michelle_stat2.number_of_participant_devices_joined + 1, liblinphone_tester_sip_timeout)); + + std::map<LinphoneCoreManager *, LinphoneParticipantInfo *> memberList = + fill_memmber_list(members, participantList, marie.getCMgr(), participants_info); + wait_for_conference_streams({focus, marie, pauline, laure, michelle, berthe}, conferenceMgrs, + focus.getCMgr(), memberList, confAddr, enable_video); } else if (participant_list_type == LinphoneConferenceParticipantListTypeClosed) { extra_participants = 0; @@ -7883,7 +7895,12 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, linphone_proxy_config_set_conference_factory_uri(marie_proxy, focus_uri); linphone_proxy_config_done(marie_proxy); - for (auto mgr : {focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + std::list<LinphoneCoreManager *> conferenceMgrs{focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), + laure.getCMgr()}; + std::list<LinphoneCoreManager *> members{marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}; + std::list<LinphoneCoreManager *> participants{pauline.getCMgr(), laure.getCMgr()}; + + for (auto mgr : conferenceMgrs) { if (toggle_video) { LinphoneVideoActivationPolicy *pol = linphone_factory_create_video_activation_policy(linphone_factory_get()); @@ -7909,7 +7926,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, BC_ASSERT_TRUE(call(marie.getCMgr(), pauline.getCMgr())); - for (auto mgr : {focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : conferenceMgrs) { enable_stun_in_mgr(mgr, enable_ice, enable_ice, enable_ice, enable_ice); } @@ -7933,10 +7950,15 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, BC_ASSERT_PTR_NOT_NULL(conf); bctbx_list_t *participants_info = NULL; + std::map<LinphoneCoreManager *, LinphoneParticipantInfo *> participantList; std::list<stats> participant_stats; - for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { - participant_stats.push_back(mgr->stat); - add_participant_info_to_list(&participants_info, mgr->identity, LinphoneParticipantRoleSpeaker, -1); + for (auto mgr : members) { + if (mgr != marie.getCMgr()) { + participant_stats.push_back(mgr->stat); + } + participantList.insert( + std::make_pair(mgr, add_participant_info_to_list(&participants_info, mgr->identity, + LinphoneParticipantRoleSpeaker, -1))); } if (conf) { @@ -7959,7 +7981,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, BC_ASSERT_PTR_NOT_NULL(confAddr); int counter = 0; - for (auto mgr : {pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : participants) { counter++; auto old_stats = participant_stats.front(); BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneConferenceStateCreationPending, @@ -8000,13 +8022,18 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, participant_stats.pop_front(); } + std::map<LinphoneCoreManager *, LinphoneParticipantInfo *> memberList = + fill_memmber_list(members, participantList, marie.getCMgr(), participants_info); + wait_for_conference_streams({focus, marie, pauline, laure}, conferenceMgrs, focus.getCMgr(), memberList, + confAddr, toggle_video); + BC_ASSERT_TRUE(wait_for_list(coresList, &focus.getStats().number_of_participants_added, 3, liblinphone_tester_sip_timeout)); // wait bit more to detect side effect if any CoreManagerAssert({focus, marie, pauline, laure}).waitUntil(chrono::seconds(2), [] { return false; }); - for (auto mgr : {focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : conferenceMgrs) { LinphoneAddress *uri = mgr->identity; LinphoneConference *pconference = linphone_core_search_conference(mgr->lc, NULL, uri, confAddr, NULL); BC_ASSERT_PTR_NOT_NULL(pconference); @@ -8054,7 +8081,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, CoreManagerAssert({focus, marie, pauline, laure}).waitUntil(chrono::seconds(2), [] { return false; }); participant_stats.clear(); - for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : members) { participant_stats.push_back(mgr->stat); } @@ -8064,7 +8091,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, BC_ASSERT_TRUE(wait_for_list(coresList, &focus.getStats().number_of_subject_changed, focus_stat.number_of_subject_changed + 1, liblinphone_tester_sip_timeout)); - for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : members) { auto old_stats = participant_stats.front(); BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_subject_changed, old_stats.number_of_subject_changed + 1, liblinphone_tester_sip_timeout)); @@ -8083,7 +8110,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, linphone_core_search_conference(focus.getLc(), NULL, focus_addr, confAddr, NULL); BC_ASSERT_PTR_NOT_NULL(fconference); - for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : members) { // Explicitely terminate conference as those on server are static by default LinphoneAddress *uri = mgr->identity; LinphoneConference *pconference = linphone_core_search_conference(mgr->lc, NULL, uri, confAddr, NULL); @@ -8204,7 +8231,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, liblinphone_tester_sip_timeout)); } - for (auto mgr : {focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { + for (auto mgr : conferenceMgrs) { LinphoneAddress *uri = mgr->identity; LinphoneConference *pconference = linphone_core_search_conference(mgr->lc, NULL, uri, confAddr, NULL); BC_ASSERT_PTR_NOT_NULL(pconference); @@ -8250,7 +8277,6 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, // wait bit more to detect side effect if any CoreManagerAssert({focus, marie, pauline, laure}).waitUntil(chrono::seconds(5), [] { return false; }); - std::list<LinphoneCoreManager *> participantsMgr = {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}; std::list<LinphoneCoreManager *> mgrList = {pauline.getCMgr()}; if (toggle_all_mananger_video) { mgrList.push_back(marie.getCMgr()); @@ -8276,9 +8302,17 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, } } - set_video_settings_in_conference(focus.getCMgr(), mgr, participantsMgr, confAddr, TRUE, + set_video_settings_in_conference(focus.getCMgr(), mgr, participants, confAddr, TRUE, video_direction, TRUE, video_direction); + // wait bit more to detect side effect if any. During this time, some participants light enable or + // disable video streams due to video toggling actions. It occurs for example when everybody is + // using a Grid layout and one participants enables its video stream with direction either SendOnly + // or SendRecv. + CoreManagerAssert({focus, marie, pauline, laure}).waitUntil(chrono::seconds(5), [] { + return false; + }); + LinphoneAddress *uri = mgr->identity; LinphoneConference *pconference = linphone_core_search_conference(mgr->lc, NULL, uri, confAddr, NULL); @@ -8437,8 +8471,7 @@ void create_simple_conference_merging_calls_base(bool_t enable_ice, linphone_conference_terminate(fconference); } - for (auto mgr : {focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { - + for (auto mgr : conferenceMgrs) { // Wait for all conferences to be terminated BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneConferenceStateTerminationPending, 1, liblinphone_tester_sip_timeout)); diff --git a/tester/local_ice_conference_tester.cpp b/tester/local_ice_conference_tester.cpp index f8bd676c45ae9fc1c716d5bd98180b95a914d76a..36e6ea5cdbf3fe632d0282ea06b0012225a809a3 100644 --- a/tester/local_ice_conference_tester.cpp +++ b/tester/local_ice_conference_tester.cpp @@ -132,7 +132,11 @@ static void abort_call_to_ice_conference(void) { linphone_core_set_file_transfer_server(marie.getLc(), file_transfer_url); + std::list<LinphoneCoreManager *> conferenceMgrs{focus.getCMgr(), marie.getCMgr(), pauline.getCMgr(), + laure.getCMgr()}; std::list<LinphoneCoreManager *> participants{pauline.getCMgr(), laure.getCMgr()}; + auto members = participants; + members.push_back(marie.getCMgr()); time_t start_time = ms_time(NULL); int duration = -1; @@ -158,6 +162,7 @@ static void abort_call_to_ice_conference(void) { initialSubject, description, TRUE, security_level); BC_ASSERT_PTR_NOT_NULL(confAddr); + char *confAddrStr = (confAddr) ? linphone_address_as_string(confAddr) : NULL; // Chat room creation to send ICS BC_ASSERT_TRUE(wait_for_list(coresList, &marie.getStats().number_of_LinphoneConferenceStateCreated, 2, @@ -165,6 +170,7 @@ static void abort_call_to_ice_conference(void) { for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { LinphoneCallParams *new_params = linphone_core_create_call_params(mgr->lc, nullptr); + ms_message("%s calls conference %s", linphone_core_get_identity(mgr->lc), confAddrStr); LinphoneCall *call = linphone_core_invite_address_with_params_2(mgr->lc, confAddr, new_params, NULL, nullptr); BC_ASSERT_PTR_NOT_NULL(call); @@ -191,6 +197,7 @@ static void abort_call_to_ice_conference(void) { for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { reset_counters(&mgr->stat); + ms_message("%s calls again conference %s", linphone_core_get_identity(mgr->lc), confAddrStr); LinphoneCallParams *new_params = linphone_core_create_call_params(mgr->lc, nullptr); linphone_core_invite_address_with_params_2(mgr->lc, confAddr, new_params, NULL, nullptr); linphone_call_params_unref(new_params); @@ -199,7 +206,7 @@ static void abort_call_to_ice_conference(void) { for (auto mgr : {marie.getCMgr(), pauline.getCMgr(), laure.getCMgr()}) { BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallOutgoingProgress, 1, liblinphone_tester_sip_timeout)); - int no_streams_running = 3; + int no_streams_running = 2; BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallUpdating, (no_streams_running - 1), liblinphone_tester_sip_timeout)); BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallStreamsRunning, no_streams_running, @@ -217,7 +224,7 @@ static void abort_call_to_ice_conference(void) { BC_ASSERT_TRUE(wait_for_list(coresList, &focus.getStats().number_of_LinphoneCallIncomingReceived, focus_stat.number_of_LinphoneCallIncomingReceived + 3, liblinphone_tester_sip_timeout)); - int focus_no_streams_running = 9; + int focus_no_streams_running = 6; BC_ASSERT_TRUE(wait_for_list(coresList, &focus.getStats().number_of_LinphoneCallUpdatedByRemote, focus_stat.number_of_LinphoneCallUpdatedByRemote + (focus_no_streams_running - 3), liblinphone_tester_sip_timeout)); @@ -243,6 +250,11 @@ static void abort_call_to_ice_conference(void) { focus_stat.number_of_participant_devices_joined + 3, liblinphone_tester_sip_timeout)); + std::map<LinphoneCoreManager *, LinphoneParticipantInfo *> memberList = + fill_memmber_list(members, participantList, marie.getCMgr(), participant_infos); + wait_for_conference_streams({focus, marie, pauline, laure}, conferenceMgrs, focus.getCMgr(), memberList, + confAddr, FALSE); + LinphoneConference *fconference = linphone_core_search_conference_2(focus.getLc(), confAddr); BC_ASSERT_PTR_NOT_NULL(fconference); @@ -463,6 +475,7 @@ static void abort_call_to_ice_conference(void) { CoreManagerAssert({focus, marie, pauline, laure}).waitUntil(chrono::seconds(2), [] { return false; }); bctbx_list_free_with_data(participant_infos, (bctbx_list_free_func)linphone_participant_info_unref); + if (confAddrStr) ms_free(confAddrStr); linphone_address_unref(confAddr); bctbx_list_free(coresList); } diff --git a/tester/local_scheduled_conference_tester.cpp b/tester/local_scheduled_conference_tester.cpp index 4a51c1f4a15df614c30d1f0ed0a6f3cf833768ee..e45dbade0f1a2746480f8b838cd7255fb047a232 100644 --- a/tester/local_scheduled_conference_tester.cpp +++ b/tester/local_scheduled_conference_tester.cpp @@ -966,8 +966,7 @@ static void create_conference_with_codec_mismatch_base(bool_t organizer_codec_mi for (auto [mgr, info] : participantList) { BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallOutgoingProgress, 1, liblinphone_tester_sip_timeout)); - int no_streams_running = - (linphone_participant_info_get_role(info) == LinphoneParticipantRoleSpeaker) ? 3 : 2; + int no_streams_running = 2; BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallUpdating, (no_streams_running - 1), liblinphone_tester_sip_timeout)); BC_ASSERT_TRUE(wait_for_list(coresList, &mgr->stat.number_of_LinphoneCallStreamsRunning, no_streams_running,