Commit 9526e4c0 authored by Julien Wadel's avatar Julien Wadel
Browse files

- Add recv_fmtp save, mime load. - Write in config file when changing...

- Add recv_fmtp save, mime load. - Write in config file when changing recv_fmtp. - Add quality tester. - Fix error on runtime check ('cannot increment value-initialized list iterator'). - Allow to use filemane on hold_music, local_ring and remote_ring in order to use resource files without knowing path. - Add silence sound file
parent 2034d281
......@@ -1362,7 +1362,11 @@ static void sound_config_read(LinphoneCore *lc) {
if (bctbx_file_exist(tmpbuf) == 0) {
linphone_core_set_ring(lc, tmpbuf);
} else {
ms_warning("'%s' ring file does not exist", tmpbuf);
string soundResource = static_cast<PlatformHelpers *>(lc->platform_helper)->getSoundResource(tmpbuf);
if( bctbx_file_exist(soundResource.c_str()) == 0)
linphone_core_set_ring(lc, soundResource.c_str());
else
ms_warning("'%s' ring file does not exist", tmpbuf);
}
} else {
linphone_core_set_ring(lc, get_default_local_ring(lc).c_str());
......@@ -1378,9 +1382,13 @@ static void sound_config_read(LinphoneCore *lc) {
string defaultRemoteRing = static_cast<PlatformHelpers *>(lc->platform_helper)->getSoundResource(REMOTE_RING_WAV);
tmpbuf = linphone_config_get_string(lc->config, "sound", "remote_ring", defaultRemoteRing.c_str());
if (bctbx_file_exist(tmpbuf) == -1){
if(tmpbuf && strstr(tmpbuf, ".wav") != NULL){
string soundResource = static_cast<PlatformHelpers *>(lc->platform_helper)->getSoundResource(tmpbuf);
if( bctbx_file_exist(soundResource.c_str()) == 0)
defaultRemoteRing = soundResource;
}
tmpbuf = defaultRemoteRing.c_str();
}
if (strstr(tmpbuf, ".wav") == NULL) {
}else if (strstr(tmpbuf, ".wav") == NULL) {
/* It currently uses old sound files, so replace them */
tmpbuf = defaultRemoteRing.c_str();
}
......@@ -1391,7 +1399,11 @@ static void sound_config_read(LinphoneCore *lc) {
if (bctbx_file_exist(tmpbuf) == 0) {
linphone_core_set_play_file(lc, tmpbuf);
} else {
ms_warning("'%s' on-hold music file does not exist", tmpbuf);
string soundResource = static_cast<PlatformHelpers *>(lc->platform_helper)->getSoundResource(tmpbuf);
if( bctbx_file_exist(soundResource.c_str()) == 0)
linphone_core_set_play_file(lc, soundResource.c_str());
else
ms_warning("'%s' on-hold music file does not exist", tmpbuf);
}
} else {
linphone_core_set_play_file(lc, get_default_onhold_music(lc).c_str());
......@@ -1836,6 +1848,7 @@ static bool_t get_codec(LinphoneCore *lc, SalStreamType type, int index, Payload
fmtp=linphone_config_get_string(config,codeckey,"recv_fmtp",NULL);
channels=linphone_config_get_int(config,codeckey,"channels",0);
enabled=linphone_config_get_int(config,codeckey,"enabled",1);
mime=linphone_config_get_string(config,codeckey,"mime",NULL);
if (!linphone_core_codec_supported(lc, type, mime)){
ms_warning("Codec %s/%i read from conf is not supported by mediastreamer2, ignored.",mime,rate);
return TRUE;
......@@ -6625,6 +6638,7 @@ void _linphone_core_codec_config_write(LinphoneCore *lc){
linphone_config_set_int(lc->config,key,"rate",pt->clock_rate);
linphone_config_set_int(lc->config,key,"channels",pt->channels);
linphone_config_set_int(lc->config,key,"enabled",payload_type_enabled(pt));
linphone_config_set_string(lc->config,key,"recv_fmtp",pt->recv_fmtp);
index++;
}
sprintf(key,"audio_codec_%i",index);
......
......@@ -254,6 +254,7 @@ void linphone_payload_type_set_recv_fmtp(LinphonePayloadType *pt, const char *re
if (pt->pt->recv_fmtp != NULL) bctbx_free(pt->pt->recv_fmtp);
if (recv_fmtp != NULL) pt->pt->recv_fmtp = bctbx_strdup(recv_fmtp);
else recv_fmtp = NULL;
_linphone_core_codec_config_write(pt->lc);
}
const char *linphone_payload_type_get_send_fmtp(const LinphonePayloadType *pt) {
......
......@@ -42,6 +42,7 @@ set(SOUND_FILES
ringback.wav
dont_wait_too_long.mkv
toy-mono.wav
silence.mkv
)
if(ENABLE_ASSETS)
......
......@@ -4,7 +4,7 @@ SUBDIRS=C fr it ja cs xml
LINPHONE_ONHOLD_MUSIC= toy-mono.wav \
dont_wait_too_long.mkv
LINPHONE_SOUNDS=ringback.wav hello8000.wav hello16000.wav incoming_chat.wav $(LINPHONE_ONHOLD_MUSIC)
LINPHONE_SOUNDS=ringback.wav hello8000.wav hello16000.wav incoming_chat.wav silence.mkv $(LINPHONE_ONHOLD_MUSIC)
LINPHONE_RINGS= \
rings/oldphone-mono.wav \
......
......@@ -266,6 +266,7 @@ if(ENABLE_LIME_X3DH)
endif()
set(SOURCE_FILES_CXX
audio_quality_tester.cpp
clonable-object-tester.cpp
contents-tester.cpp
cpim-tester.cpp
......@@ -285,6 +286,7 @@ if(ENABLE_DB_STORAGE)
endif()
set(HEADER_FILES
audio_quality_tester.h
liblinphone_tester.h
tools/private-access.h
tools/tester.h
......
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
*
* This file is part of Liblinphone.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "address/address.h"
#include "chat/chat-message/chat-message.h"
#include "chat/chat-room/basic-chat-room.h"
#include "content/content-type.h"
#include "content/content.h"
#include "content/file-content.h"
#include "core/core.h"
// TODO: Remove me later.
#include "private.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include <vector>
#include <map>
// =============================================================================
using namespace std;
using namespace LinphonePrivate;
class FmtpManager{
public:
FmtpManager(){}
void setFmtp(const std::string& key, const std::string& value){
mFmtp[key] = value;
}
std::string toString(){
return toString(mFmtp);
}
std::string toString(std::map<std::string, std::string> data){
std::string merge;
for(auto i : data){
if(merge != "")
merge += ';';
if( i.second != "")
merge += i.first+"="+i.second;
else
merge += i.first;
}
return merge;
}
std::map<std::string, std::string> mFmtp;
};
#if !defined(__arm__) && !defined(__arm64__) && !TARGET_IPHONE_SIMULATOR && !defined(__ANDROID__)
static void completion_cb(void *user_data, int percentage){
fprintf(stdout,"%i %% completed\r",percentage);
fflush(stdout);
}
#endif
static void audio_call_stereo_call(const char *codec_name, int clock_rate, int bitrate_override, bool_t stereo) {
LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
PayloadType *pt;
char *stereo_file = bc_tester_res("sounds/vrroom.wav");
char *recordpath = bc_tester_file("stereo-record.wav");
bool_t audio_cmp_failed = FALSE;
unlink(recordpath);
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
/*make sure we have opus*/
pt = linphone_core_find_payload_type(marie->lc, codec_name, clock_rate, 2);
if (!pt) {
ms_warning("%s not available, stereo with %s not tested.",codec_name, codec_name);
goto end;
}
if (stereo) payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(marie->lc, pt, bitrate_override);
pt = linphone_core_find_payload_type(pauline->lc, codec_name, clock_rate, 2);
if (stereo) payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(pauline->lc, pt, bitrate_override);
disable_all_audio_codecs_except_one(marie->lc, codec_name, clock_rate);
disable_all_audio_codecs_except_one(pauline->lc, codec_name, clock_rate);
linphone_core_set_use_files(marie->lc, TRUE);
linphone_core_set_play_file(marie->lc, stereo_file);
linphone_core_set_use_files(pauline->lc, TRUE);
linphone_core_set_record_file(pauline->lc, recordpath);
/*stereo is supported only without volume control, echo canceller...*/
linphone_config_set_string(linphone_core_get_config(marie->lc),"sound","features","REMOTE_PLAYING");
linphone_config_set_string(linphone_core_get_config(pauline->lc),"sound","features","REMOTE_PLAYING");
if (!BC_ASSERT_TRUE(call(pauline,marie))) goto end;
wait_for_until(marie->lc, pauline->lc, NULL, 0, 6000);
end_call(pauline, marie);
if (clock_rate!=48000) {
ms_warning("Similarity checking not implemented for files not having the same sampling rate");
}else{
#if !defined(__arm__) && !defined(__arm64__) && !TARGET_IPHONE_SIMULATOR && !defined(__ANDROID__)
double similar;
double min_threshold = .75f; /*should be above 0.8 in best conditions*/
double max_threshold = 1.f;
if (!stereo){
/*when opus doesn't transmit stereo, the cross correlation is around 0.6 : as expected, it is not as good as in full stereo mode*/
min_threshold = .4f;
max_threshold = .68f;
}
BC_ASSERT_EQUAL(ms_audio_diff(stereo_file, recordpath,&similar,&audio_cmp_params,completion_cb,NULL), 0, int, "%d");
BC_ASSERT_GREATER(similar, min_threshold, double, "%g");
BC_ASSERT_LOWER(similar, max_threshold, double, "%g");
if (similar<min_threshold || similar>max_threshold){
audio_cmp_failed = TRUE;
}
#endif
}
if (!audio_cmp_failed) unlink(recordpath);
end:
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
ms_free(stereo_file);
bc_free(recordpath);
}
static void audio_stereo_call_l16(void){
audio_call_stereo_call("L16", 44100, 0, TRUE);
}
static void audio_stereo_call_opus(void){
audio_call_stereo_call("opus", 48000, 150, TRUE);
}
static void audio_mono_call_opus(void){
/*actually a call where input/output is made with stereo but opus transmits everything as mono*/
audio_call_stereo_call("opus", 48000, 150, FALSE);
}
static void audio_call_loss_resilience(const char *codec_name, int clock_rate, int bitrate_override, int jitterBufferMs, bool_t stereo, std::pair<double,double> threshold ) {
LinphoneCoreManager *marie, *pauline;
PayloadType *mariePt, *paulinePt;
char *referenceFile = bc_tester_res("sounds/vrroom.wav");
int sampleLength = 6000;
std::string recordFileNameRoot = "loss-record.wav", recordFileName, refRecordFileName;
char *recordPath = nullptr;
FmtpManager marieFmtp, paulineFmtp;
std::vector<std::string> useinbandfec = {"1"};
std::vector<float> lossRates = {50};
std::vector<std::string> packetLossPercentage = {"50","100"};
OrtpNetworkSimulatorParams simparams = { 0 };
MSAudioDiffParams audioCmpParams = audio_cmp_params;
// Add jitterBufferMs to the shift
audioCmpParams.max_shift_percent = static_cast<int>(std::floor((audioCmpParams.max_shift_percent*sampleLength+jitterBufferMs)/((double)sampleLength+jitterBufferMs)));
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
if (!BC_ASSERT_PTR_NOT_NULL(marie) || !BC_ASSERT_PTR_NOT_NULL(pauline)) goto end;
/*make sure we have opus*/
mariePt = linphone_core_find_payload_type(marie->lc, codec_name, clock_rate, 2);
paulinePt = linphone_core_find_payload_type(pauline->lc, codec_name, clock_rate, 2);
if (!BC_ASSERT_PTR_NOT_NULL(mariePt) || !BC_ASSERT_PTR_NOT_NULL(paulinePt)) {
ms_warning("%s not available, stereo with %s and fec not tested.",codec_name, codec_name);
goto end;
}
if (stereo){
marieFmtp.setFmtp("stereo", "1");
marieFmtp.setFmtp("sprop-stereo", "1");
}
disable_all_audio_codecs_except_one(marie->lc, codec_name, clock_rate);
disable_all_audio_codecs_except_one(pauline->lc, codec_name, clock_rate);
if(bitrate_override) linphone_core_set_payload_type_bitrate(marie->lc, mariePt, bitrate_override);
if(bitrate_override) linphone_core_set_payload_type_bitrate(pauline->lc, paulinePt, bitrate_override);
linphone_core_set_use_files(marie->lc, TRUE);
linphone_core_set_play_file(marie->lc, referenceFile);
linphone_core_set_use_files(pauline->lc, TRUE);
linphone_core_set_record_file(pauline->lc, recordPath);
/*stereo is supported only without volume control, echo canceller...*/
linphone_config_set_string(linphone_core_get_config(marie->lc),"sound","features","REMOTE_PLAYING");
linphone_config_set_string(linphone_core_get_config(pauline->lc),"sound","features","REMOTE_PLAYING");
linphone_config_set_int(linphone_core_get_config(pauline->lc), "rtp", "jitter_buffer_min_size", jitterBufferMs);
linphone_core_set_audio_jittcomp(pauline->lc, jitterBufferMs);
linphone_core_enable_adaptive_rate_control(marie->lc, FALSE); // We don't want adaptive rate control here, in order to not interfere with loss recovery algorithms
simparams.mode = OrtpNetworkSimulatorOutbound;
simparams.enabled = TRUE;
simparams.consecutive_loss_probability = 0.000001f;// Ensure to have fec in n+1 packets
#if !defined(__arm__) && !defined(__arm64__) && !TARGET_IPHONE_SIMULATOR && !defined(__ANDROID__)
for(size_t inbandIndex = 0 ; inbandIndex < useinbandfec.size() ; ++inbandIndex){// Loop to test the impact of useinbandfec
marieFmtp.setFmtp("useinbandfec", useinbandfec[inbandIndex]);
for(size_t lossRateIndex = 0 ; lossRateIndex < lossRates.size() ; ++lossRateIndex){// Loop to test the impact of loosing packets
double similarityRef = 0.0, similarity=0.0;
bool_t noError = TRUE;
simparams.loss_rate = lossRates[lossRateIndex];
linphone_core_set_network_simulator_params(marie->lc, &simparams);
// Compute similarity reference
marieFmtp.setFmtp("packetlosspercentage", "0");
paulineFmtp = marieFmtp;
payload_type_set_recv_fmtp(mariePt, marieFmtp.toString().c_str());
payload_type_set_recv_fmtp(paulinePt, paulineFmtp.toString().c_str());
refRecordFileName= useinbandfec[inbandIndex]+"_"+std::to_string(lossRates[lossRateIndex])+"_ref_"+recordFileNameRoot;
bc_free(recordPath);
recordPath = bc_tester_file(refRecordFileName.c_str());
linphone_core_set_record_file(pauline->lc, recordPath);
unlink(recordPath);
if (BC_ASSERT_TRUE(call(pauline,marie))){
wait_for_until(marie->lc, pauline->lc, NULL, 0, sampleLength+jitterBufferMs);
end_call(pauline, marie);
BC_ASSERT_EQUAL(ms_audio_diff(referenceFile, recordPath,&similarityRef,&audioCmpParams,NULL,NULL), 0, int, "%d");
}
for(size_t packetLossIndex = 0 ; packetLossIndex < packetLossPercentage.size() ; ++packetLossIndex){
// Set packetloss. Similarity must be greater than having no packetloss
marieFmtp.setFmtp("packetlosspercentage", packetLossPercentage[packetLossIndex]);
paulineFmtp = marieFmtp;
payload_type_set_recv_fmtp(mariePt, marieFmtp.toString().c_str());
payload_type_set_recv_fmtp(paulinePt, paulineFmtp.toString().c_str());
recordFileName= useinbandfec[inbandIndex]+"_"+std::to_string(lossRates[lossRateIndex])+"_"+packetLossPercentage[packetLossIndex]+"_out_"+recordFileNameRoot;
bc_free(recordPath);
recordPath = bc_tester_file(recordFileName.c_str());
linphone_core_set_record_file(pauline->lc, recordPath);
unlink(recordPath);
if (BC_ASSERT_TRUE(call(pauline,marie))){
wait_for_until(marie->lc, pauline->lc, NULL, 0, sampleLength+jitterBufferMs);
end_call(pauline, marie);
BC_ASSERT_EQUAL(ms_audio_diff(referenceFile, recordPath,&similarity,&audioCmpParams,NULL,NULL), 0, int, "%d");
}
BC_ASSERT_GREATER(similarity, similarityRef, double, "%g");
if(similarity>=similarityRef){
unlink(refRecordFileName.c_str());
}else
noError = FALSE;
similarityRef = similarity;
}
if(noError){
unlink(recordFileName.c_str());
}
}
}
#endif
end:
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
bc_free(recordPath);
bc_free(referenceFile);
}
static void audio_call_loss_resilience_opus(){
audio_call_loss_resilience("opus", 48000, 120, 300, TRUE, std::pair<double,double>(0.8,1.0));
}
static void audio_call_test_diff() {
char *stereo_file = bc_tester_res("sounds/vrroom.wav");
const char *recordPath = "1_50_0_0.5915.wav";
std::vector<double> values;
for(int i = 0 ; i < 20 ; ++i) {
double similar = 1.0;
ms_audio_diff(stereo_file, recordPath,&similar,&audio_cmp_params,NULL,NULL);
values.push_back(similar);
}
for(size_t i = 0 ; i < values.size() ; ++i)
printf("%f", values[i]);
}
static void audio_call_test_audio_diff() {
char *stereo_file = bc_tester_res("sounds/vrroom.wav");
std::vector<double> values;
for(int i = 0 ; i < 20 ; ++i) {
double similar = 1.0;
ms_audio_diff(stereo_file, stereo_file,&similar,&audio_cmp_params,NULL,NULL);
values.push_back(similar);
}
for(size_t i = 0 ; i < values.size() ; ++i)
printf("%f", values[i]);
bc_free(stereo_file);
}
test_t audio_quality_tests[] = {
TEST_NO_TAG("Audio loss rate resilience opus", audio_call_loss_resilience_opus),
TEST_NO_TAG("Simple stereo call with L16", audio_stereo_call_l16),
TEST_NO_TAG("Simple stereo call with opus", audio_stereo_call_opus),
TEST_NO_TAG("Simple mono call with opus", audio_mono_call_opus),
TEST_NO_TAG("Audio test diff", audio_call_test_diff),
TEST_NO_TAG("Audio test audio diff", audio_call_test_audio_diff),
};
test_suite_t audio_quality_test_suite = {
"Audio Call quality", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
sizeof(audio_quality_tests) / sizeof(audio_quality_tests[0]), audio_quality_tests
};
/*
* Copyright (c) 2010-2019 Belledonne Communications SARL.
*
* This file is part of Liblinphone.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
......@@ -4024,91 +4024,6 @@ static void unsucessfull_call_with_transport_change_after_released(void) {
call_with_transport_change_base(FALSE);
}
#if !defined(__arm__) && !defined(__arm64__) && !TARGET_IPHONE_SIMULATOR && !defined(__ANDROID__)
static void completion_cb(void *user_data, int percentage){
fprintf(stdout,"%i %% completed\r",percentage);
fflush(stdout);
}
#endif
static void simple_stereo_call(const char *codec_name, int clock_rate, int bitrate_override, bool_t stereo) {
LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
PayloadType *pt;
char *stereo_file = bc_tester_res("sounds/vrroom.wav");
char *recordpath = bc_tester_file("stereo-record.wav");
bool_t audio_cmp_failed = FALSE;
unlink(recordpath);
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
/*make sure we have opus*/
pt = linphone_core_find_payload_type(marie->lc, codec_name, clock_rate, 2);
if (!pt) {
ms_warning("%s not available, stereo with %s not tested.",codec_name, codec_name);
goto end;
}
if (stereo) payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(marie->lc, pt, bitrate_override);
pt = linphone_core_find_payload_type(pauline->lc, codec_name, clock_rate, 2);
if (stereo) payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(pauline->lc, pt, bitrate_override);
disable_all_audio_codecs_except_one(marie->lc, codec_name, clock_rate);
disable_all_audio_codecs_except_one(pauline->lc, codec_name, clock_rate);
linphone_core_set_use_files(marie->lc, TRUE);
linphone_core_set_play_file(marie->lc, stereo_file);
linphone_core_set_use_files(pauline->lc, TRUE);
linphone_core_set_record_file(pauline->lc, recordpath);
/*stereo is supported only without volume control, echo canceller...*/
linphone_config_set_string(linphone_core_get_config(marie->lc),"sound","features","REMOTE_PLAYING");
linphone_config_set_string(linphone_core_get_config(pauline->lc),"sound","features","REMOTE_PLAYING");
if (!BC_ASSERT_TRUE(call(pauline,marie))) goto end;
wait_for_until(marie->lc, pauline->lc, NULL, 0, 6000);
end_call(pauline, marie);
if (clock_rate!=48000) {
ms_warning("Similarity checking not implemented for files not having the same sampling rate");
}else{
#if !defined(__arm__) && !defined(__arm64__) && !TARGET_IPHONE_SIMULATOR && !defined(__ANDROID__)
double similar;
double min_threshold = .75f; /*should be above 0.8 in best conditions*/
double max_threshold = 1.f;
if (!stereo){
/*when opus doesn't transmit stereo, the cross correlation is around 0.6 : as expected, it is not as good as in full stereo mode*/
min_threshold = .4f;
max_threshold = .68f;
}
BC_ASSERT_EQUAL(ms_audio_diff(stereo_file, recordpath,&similar,&audio_cmp_params,completion_cb,NULL), 0, int, "%d");
BC_ASSERT_GREATER(similar, min_threshold, double, "%g");
BC_ASSERT_LOWER(similar, max_threshold, double, "%g");
if (similar<min_threshold || similar>max_threshold){
audio_cmp_failed = TRUE;
}
#endif
}
if (!audio_cmp_failed) unlink(recordpath);
end:
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
ms_free(stereo_file);
bc_free(recordpath);
}
static void simple_stereo_call_l16(void){
simple_stereo_call("L16", 44100, 0, TRUE);
}
static void simple_stereo_call_opus(void){
simple_stereo_call("opus", 48000, 150, TRUE);
}
static void call_with_complex_late_offering(void){
LinphoneCallParams *params;
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
......@@ -4224,10 +4139,6 @@ end:
linphone_core_manager_destroy(pauline);
}
static void simple_mono_call_opus(void){
/*actually a call where input/output is made with stereo but opus transmits everything as mono*/
simple_stereo_call("opus", 48000, 150, FALSE);
}
/* because SIP ALG (like in android phones) crash when seing a domain name in SDP, we prefer using SIP/TLS for both participants*/
static void call_with_fqdn_in_sdp(void) {
......@@ -5299,9 +5210,6 @@ test_t call_tests[] = {
TEST_NO_TAG("Call with generic CN", call_with_generic_cn),
TEST_NO_TAG("Call with transport change after released", call_with_transport_change_after_released),
TEST_NO_TAG("Unsuccessful call with transport change after released", unsucessfull_call_with_transport_change_after_released),
TEST_NO_TAG("Simple stereo call with L16", simple_stereo_call_l16),
TEST_NO_TAG("Simple stereo call with opus", simple_stereo_call_opus),
TEST_NO_TAG("Simple mono call with opus", simple_mono_call_opus),
TEST_NO_TAG("Call with FQDN in SDP", call_with_fqdn_in_sdp),
TEST_NO_TAG("Call with RTP IO mode", call_with_rtp_io_mode),
TEST_NO_TAG("Call with generic NACK RTCP feedback", call_with_generic_nack_rtcp_feedback),
......
......@@ -405,6 +405,7 @@ void liblinphone_tester_add_suites() {
#endif // ifdef VIDEO_ENABLED
bc_tester_add_suite(&audio_bypass_suite);
bc_tester_add_suite(&audio_routes_test_suite);
bc_tester_add_suite(&audio_quality_test_suite);
bc_tester_add_suite(&audio_video_conference_test_suite);
bc_tester_add_suite(&multi_call_test_suite);
bc_tester_add_suite(&message_test_suite);
......
......@@ -105,6 +105,7 @@ extern test_suite_t external_domain_test_suite;
extern test_suite_t audio_bypass_suite;
extern test_suite_t audio_routes_test_suite;
extern test_suite_t audio_quality_test_suite;
#if HAVE_SIPP
extern test_suite_t complex_sip_call_test_suite;
#endif
......
......@@ -34,8 +34,8 @@ using namespace {{{namespace}}};
static {{{returnType}}} {{{cbName}}}({{{declArgs}}}) {
{{{cListenerName}}} *cbs = {{{currentCallbacksGetter}}}({{{firstArgName}}});
if (cbs) {
auto &listeners = *static_cast<std::list<std::shared_ptr<Listener> > *>(belle_sip_object_data_get((::belle_sip_object_t *)cbs, MultiListenableObject::sListenerListName));
for(auto it=listeners.begin(); it!=listeners.end(); it++) {
std::list<std::shared_ptr<Listener> > *listeners = static_cast<std::list<std::shared_ptr<Listener> > *>(belle_sip_object_data_get((::belle_sip_object_t *)cbs, MultiListenableObject::sListenerListName));
for(std::list<std::shared_ptr<Listener> >::iterator it=listeners->begin(); it!=listeners->end(); it++) {
std::shared_ptr<{{{cppListenerName}}}> listener = std::static_pointer_cast<{{{cppListenerName}}},Listener>(*it);
{{{cppMethodCallingLine}}};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment