diff --git a/coreapi/local_conference.cpp b/coreapi/local_conference.cpp index c379b73b593be99791d8b1b655da941d54c5d422..18e3ce71aa3674c58d6490c15d8ce463effe6c8f 100644 --- a/coreapi/local_conference.cpp +++ b/coreapi/local_conference.cpp @@ -939,7 +939,6 @@ int LocalConference::participantDeviceSsrcChanged(const std::shared_ptr<Linphone int LocalConference::getParticipantDeviceVolume(const std::shared_ptr<LinphonePrivate::ParticipantDevice> &device) { MS2AudioMixer *mixer = dynamic_cast<MS2AudioMixer *>(mMixerSession->getMixerByType(SalAudio)); - if (mixer) { MSAudioConference *conf = mixer->getAudioConference(); return ms_audio_conference_get_participant_volume(conf, device->getSsrc(LinphoneStreamTypeAudio)); diff --git a/coreapi/remote_conference.cpp b/coreapi/remote_conference.cpp index f5e747176ef9b1f27a9dcf9bb4b234d6b73e06df..2aec803f4f80ba0504a96739b9364ff13414058c 100644 --- a/coreapi/remote_conference.cpp +++ b/coreapi/remote_conference.cpp @@ -355,7 +355,6 @@ void RemoteConference::setLocalParticipantStreamCapability(const LinphoneMediaDi int RemoteConference::getParticipantDeviceVolume(const std::shared_ptr<LinphonePrivate::ParticipantDevice> &device) { AudioStream *as = getAudioStream(); - if (as != nullptr) { return audio_stream_get_participant_volume(as, device->getSsrc(LinphoneStreamTypeAudio)); } diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index a92528638fe37ba1cf080a80a0d090439e2f9ca2..7bcdd449cb4c8aca984912e2d2aafaddd56e25f8 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -1896,8 +1896,18 @@ shared_ptr<ConferenceInfo> MainDbPrivate::selectConferenceInfo(const soci::row & } conferenceInfo = ConferenceInfo::create(); - std::shared_ptr<Address> uri = Address::create(row.get<string>(2)); + const std::string uriString = row.get<string>(2); + std::shared_ptr<Address> uri = Address::create(uriString); conferenceInfo->setUri(uri); + const auto &uriStringOrdered = uri->toStringUriOnlyOrdered(); + if (uriStringOrdered != uriString) { + // Update conference address to ensure that a conference info can be successfully searched by its address + const long long &uriSipAddressId = insertSipAddress(uri); + *dbSession.getBackendSession() + << "UPDATE conference_info SET uri_sip_address_id = :uriSipAddressId WHERE id = :conferenceInfoId", + soci::use(uriSipAddressId), soci::use(dbConferenceInfoId); + } + conferenceInfo->setDateTime(dbSession.getTime(row, 3)); conferenceInfo->setDuration(dbSession.getUnsignedInt(row, 4, 0)); conferenceInfo->setUtf8Subject(row.get<string>(5)); diff --git a/tester/audio_video_conference_tester.c b/tester/audio_video_conference_tester.c index 72439e3aab6406744a110ff96c1edc1cea821c06..22f8a0b5fefbd4f57734c7acba8d62a45d020ba3 100644 --- a/tester/audio_video_conference_tester.c +++ b/tester/audio_video_conference_tester.c @@ -421,27 +421,24 @@ static void check_conference_volumes(LinphoneCall *call) { for (bctbx_list_t *it_d = devices; it_d != NULL; it_d = it_d->next) { LinphoneParticipantDevice *d = (LinphoneParticipantDevice *)it_d->data; + uint32_t audioSsrc = linphone_participant_device_get_ssrc(d, LinphoneStreamTypeAudio); if (linphone_participant_device_get_stream_capability(d, LinphoneStreamTypeAudio) == LinphoneMediaDirectionInactive) { - BC_ASSERT_EQUAL((unsigned long)linphone_participant_device_get_ssrc(d, LinphoneStreamTypeAudio), 0, - unsigned long, "%0lu"); + BC_ASSERT_EQUAL((unsigned long)audioSsrc, 0, unsigned long, "%0lu"); } else { - BC_ASSERT_NOT_EQUAL((unsigned long)linphone_participant_device_get_ssrc(d, LinphoneStreamTypeAudio), - 0, unsigned long, "%0lu"); + BC_ASSERT_NOT_EQUAL((unsigned long)audioSsrc, 0, unsigned long, "%0lu"); if (linphone_participant_device_get_stream_availability(d, LinphoneStreamTypeAudio)) { - BC_ASSERT_NOT_EQUAL(linphone_conference_get_participant_device_volume(conference, d), - AUDIOSTREAMVOLUMES_NOT_FOUND, int, "%d"); - BC_ASSERT_GREATER(linphone_conference_get_participant_device_volume(conference, d), - MS_VOLUME_DB_LOWEST, int, "%d"); + const int volume = linphone_conference_get_participant_device_volume(conference, d); + BC_ASSERT_NOT_EQUAL(volume, AUDIOSTREAMVOLUMES_NOT_FOUND, int, "%d"); + BC_ASSERT_GREATER(volume, MS_VOLUME_DB_LOWEST, int, "%d"); } } + uint32_t videoSsrc = linphone_participant_device_get_ssrc(d, LinphoneStreamTypeVideo); if (linphone_participant_device_get_stream_capability(d, LinphoneStreamTypeVideo) == LinphoneMediaDirectionInactive) { - BC_ASSERT_EQUAL((unsigned long)linphone_participant_device_get_ssrc(d, LinphoneStreamTypeVideo), 0, - unsigned long, "%0lu"); + BC_ASSERT_EQUAL((unsigned long)videoSsrc, 0, unsigned long, "%0lu"); } else { - BC_ASSERT_NOT_EQUAL((unsigned long)linphone_participant_device_get_ssrc(d, LinphoneStreamTypeVideo), - 0, unsigned long, "%0lu"); + BC_ASSERT_NOT_EQUAL((unsigned long)videoSsrc, 0, unsigned long, "%0lu"); } } bctbx_list_free_with_data(devices, (void (*)(void *))linphone_participant_device_unref); @@ -462,6 +459,8 @@ static void simple_conference_base(LinphoneCoreManager *marie, stats initial_pauline_stat; stats initial_laure_stat; + char *filepath = bc_tester_res("sounds/vrroom.wav"); + LinphoneCall *marie_call_pauline = NULL; LinphoneCall *pauline_called_by_marie = NULL; LinphoneCall *marie_call_laure = NULL; @@ -621,9 +620,22 @@ static void simple_conference_base(LinphoneCoreManager *marie, liblinphone_tester_sip_timeout)); } + linphone_core_enable_mic(pauline->lc, FALSE); + linphone_core_enable_mic(laure->lc, FALSE); + linphone_core_enable_mic(marie->lc, FALSE); // wait a bit to ensure that should NOTIFYs be sent, they reach their destination wait_for_list(lcs, NULL, 0, liblinphone_tester_sip_timeout); + // Let all participant to speak simultaneously to send their volumes + int talking_time = 4000; + linphone_core_enable_mic(pauline->lc, TRUE); + linphone_core_enable_mic(laure->lc, TRUE); + linphone_core_enable_mic(marie->lc, TRUE); + linphone_core_set_play_file(pauline->lc, filepath); + linphone_core_set_play_file(marie->lc, filepath); + linphone_core_set_play_file(laure->lc, filepath); + wait_for_list(lcs, NULL, 0, talking_time); + // Check that laure received volumes from other participant's devices LinphoneCall *laure_call = linphone_core_get_current_call(laure->lc); BC_ASSERT_PTR_NOT_NULL(laure_call); @@ -862,6 +874,7 @@ static void simple_conference_base(LinphoneCoreManager *marie, wait_for_list(lcs, &focus->stat.number_of_LinphoneCallReleased, 3, liblinphone_tester_sip_timeout)); end: + if (filepath) bctbx_free(filepath); BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCoreLastCallEnded, 1, int, "%d"); BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCoreLastCallEnded, 1, int, "%d"); BC_ASSERT_EQUAL(laure->stat.number_of_LinphoneCoreLastCallEnded, 1, int, "%d"); diff --git a/tester/main-db-tester.cpp b/tester/main-db-tester.cpp index 2a253fac1f89fb62145388cfd2bc70608885e8b8..aaf90f60ed83e02b859ed5acb3d5070d6e8f3506 100644 --- a/tester/main-db-tester.cpp +++ b/tester/main-db-tester.cpp @@ -376,6 +376,10 @@ static void load_chatroom_conference(void) { list<shared_ptr<ConferenceInfo>> conferenceInfos = mainDb.getConferenceInfos(); BC_ASSERT_EQUAL(conferenceInfos.size(), 1, size_t, "%zu"); + + for (const auto &conferenceInfo : conferenceInfos) { + BC_ASSERT_PTR_NOT_NULL(mainDb.getConferenceInfoFromURI(conferenceInfo->getUri())); + } } else { BC_FAIL("Database not initialized"); }