Quality reporting: rename parameters send_statistics to...

Quality reporting: rename parameters send_statistics to quality_reporting_enabled and statistics_collector to quality_repotring_collector
parent f9c01ebd
......@@ -840,10 +840,10 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *
* @param val if true, quality statistics publish will be stored and sent to the collector
*
*/
LINPHONE_PUBLIC void linphone_proxy_config_enable_statistics(LinphoneProxyConfig *cfg, bool_t val);
LINPHONE_PUBLIC bool_t linphone_proxy_config_send_statistics_enabled(LinphoneProxyConfig *cfg);
LINPHONE_PUBLIC void linphone_proxy_config_set_statistics_collector(LinphoneProxyConfig *cfg, const char *collector);
LINPHONE_PUBLIC const char *linphone_proxy_config_get_statistics_collector(const LinphoneProxyConfig *obj);
LINPHONE_PUBLIC void linphone_proxy_config_enable_quality_reporting(LinphoneProxyConfig *cfg, bool_t val);
LINPHONE_PUBLIC bool_t linphone_proxy_config_quality_reporting_enabled(LinphoneProxyConfig *cfg);
LINPHONE_PUBLIC void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *cfg, const char *collector);
LINPHONE_PUBLIC const char *linphone_proxy_config_get_quality_reporting_collector(const LinphoneProxyConfig *obj);
/**
* Get the registration state of the given proxy config.
......
......@@ -415,7 +415,7 @@ struct _LinphoneProxyConfig
char *reg_proxy;
char *reg_identity;
char *reg_route;
char *statistics_collector;
char *quality_reporting_collector;
char *realm;
char *contact_params;
char *contact_uri_params;
......@@ -433,7 +433,7 @@ struct _LinphoneProxyConfig
bool_t publish;
bool_t dial_escape_plus;
bool_t send_publish;
bool_t send_statistics;
bool_t quality_reporting_enabled;
bool_t avpf_enabled;
bool_t pad;
uint8_t avpf_rr_interval;
......
......@@ -59,7 +59,7 @@ bool_t linphone_proxy_config_is_server_config_changed(const LinphoneProxyConfig*
LinphoneAddress *current_identity=obj->reg_identity?linphone_address_new(obj->reg_identity):NULL;
LinphoneAddress *current_proxy=obj->reg_proxy?linphone_address_new(obj->reg_proxy):NULL;
bool_t result=FALSE;
if (!linphone_proxy_config_address_equal(obj->saved_identity,current_identity)){
result=TRUE;
goto end;
......@@ -94,7 +94,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *ob
const char *identity = lc ? lp_config_get_default_string(lc->config, "proxy", "reg_identity", NULL) : NULL;
const char *proxy = lc ? lp_config_get_default_string(lc->config, "proxy", "reg_proxy", NULL) : NULL;
const char *route = lc ? lp_config_get_default_string(lc->config, "proxy", "reg_route", NULL) : NULL;
const char *statistics_collector = lc ? lp_config_get_default_string(lc->config, "proxy", "statistics_collector", NULL) : NULL;
const char *quality_reporting_collector = lc ? lp_config_get_default_string(lc->config, "proxy", "quality_reporting_collector", NULL) : NULL;
const char *contact_params = lc ? lp_config_get_default_string(lc->config, "proxy", "contact_parameters", NULL) : NULL;
const char *contact_uri_params = lc ? lp_config_get_default_string(lc->config, "proxy", "contact_uri_parameters", NULL) : NULL;
......@@ -108,8 +108,8 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *ob
obj->reg_identity = identity ? ms_strdup(identity) : NULL;
obj->reg_proxy = proxy ? ms_strdup(proxy) : NULL;
obj->reg_route = route ? ms_strdup(route) : NULL;
obj->statistics_collector = statistics_collector ? ms_strdup(statistics_collector) : NULL;
obj->send_statistics = lc ? lp_config_get_default_int(lc->config, "proxy", "send_statistics", 0) : 0;
obj->quality_reporting_collector = quality_reporting_collector ? ms_strdup(quality_reporting_collector) : NULL;
obj->quality_reporting_enabled = lc ? lp_config_get_default_int(lc->config, "proxy", "quality_reporting_enabled", 0) : 0;
obj->contact_params = contact_params ? ms_strdup(contact_params) : NULL;
obj->contact_uri_params = contact_uri_params ? ms_strdup(contact_uri_params) : NULL;
obj->avpf_enabled = lc ? lp_config_get_default_int(lc->config, "proxy", "avpf", 0) : 0;
......@@ -147,7 +147,7 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
if (obj->reg_identity!=NULL) ms_free(obj->reg_identity);
if (obj->reg_route!=NULL) ms_free(obj->reg_route);
if (obj->statistics_collector!=NULL) ms_free(obj->statistics_collector);
if (obj->quality_reporting_collector!=NULL) ms_free(obj->quality_reporting_collector);
if (obj->ssctx!=NULL) sip_setup_context_free(obj->ssctx);
if (obj->realm!=NULL) ms_free(obj->realm);
if (obj->type!=NULL) ms_free(obj->type);
......@@ -480,16 +480,16 @@ bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg
return cfg->dial_escape_plus;
}
void linphone_proxy_config_enable_statistics(LinphoneProxyConfig *cfg, bool_t val){
cfg->send_statistics = val;
void linphone_proxy_config_enable_quality_reporting(LinphoneProxyConfig *cfg, bool_t val){
cfg->quality_reporting_enabled = val;
}
bool_t linphone_proxy_config_send_statistics_enabled(LinphoneProxyConfig *cfg){
bool_t linphone_proxy_config_quality_reporting_enabled(LinphoneProxyConfig *cfg){
// ensure that collector address is set too!
return cfg->send_statistics && cfg->statistics_collector != NULL;
return cfg->quality_reporting_enabled && cfg->quality_reporting_collector != NULL;
}
void linphone_proxy_config_set_statistics_collector(LinphoneProxyConfig *cfg, const char *collector){
void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *cfg, const char *collector){
if (collector!=NULL && strlen(collector)>0){
LinphoneAddress *addr=linphone_address_new(collector);
if (!addr || linphone_address_get_username(addr)==NULL){
......@@ -497,16 +497,16 @@ void linphone_proxy_config_set_statistics_collector(LinphoneProxyConfig *cfg, co
if (addr)
linphone_address_destroy(addr);
} else {
if (cfg->statistics_collector != NULL)
ms_free(cfg->statistics_collector);
cfg->statistics_collector = ms_strdup(collector);
if (cfg->quality_reporting_collector != NULL)
ms_free(cfg->quality_reporting_collector);
cfg->quality_reporting_collector = ms_strdup(collector);
linphone_address_destroy(addr);
}
}
}
const char *linphone_proxy_config_get_statistics_collector(const LinphoneProxyConfig *cfg){
return cfg->statistics_collector;
const char *linphone_proxy_config_get_quality_reporting_collector(const LinphoneProxyConfig *cfg){
return cfg->quality_reporting_collector;
}
......@@ -1174,8 +1174,8 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
if (obj->reg_route!=NULL){
lp_config_set_string(config,key,"reg_route",obj->reg_route);
}
if (obj->statistics_collector!=NULL){
lp_config_set_string(config,key,"statistics_collector",obj->statistics_collector);
if (obj->quality_reporting_collector!=NULL){
lp_config_set_string(config,key,"quality_reporting_collector",obj->quality_reporting_collector);
}
if (obj->reg_identity!=NULL){
lp_config_set_string(config,key,"reg_identity",obj->reg_identity);
......@@ -1192,7 +1192,7 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
lp_config_set_int(config, key, "avpf", obj->avpf_enabled);
lp_config_set_int(config, key, "avpf_rr_interval", obj->avpf_rr_interval);
lp_config_set_int(config,key,"dial_escape_plus",obj->dial_escape_plus);
lp_config_set_int(config,key,"send_statistics",obj->send_statistics);
lp_config_set_int(config,key,"quality_reporting_enabled",obj->quality_reporting_enabled);
lp_config_set_string(config,key,"dial_prefix",obj->dial_prefix);
lp_config_set_int(config,key,"privacy",obj->privacy);
}
......@@ -1224,9 +1224,9 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config
tmp=lp_config_get_string(config,key,"reg_route",NULL);
if (tmp!=NULL) linphone_proxy_config_set_route(cfg,tmp);
tmp=lp_config_get_string(config,key,"statistics_collector",NULL);
if (tmp!=NULL) linphone_proxy_config_set_statistics_collector(cfg,tmp);
linphone_proxy_config_enable_statistics(cfg,lp_config_get_int(config,key,"send_statistics",0));
tmp=lp_config_get_string(config,key,"quality_reporting_collector",NULL);
if (tmp!=NULL) linphone_proxy_config_set_quality_reporting_collector(cfg,tmp);
linphone_proxy_config_enable_quality_reporting(cfg,lp_config_get_int(config,key,"quality_reporting_enabled",0));
linphone_proxy_config_set_contact_parameters(cfg,lp_config_get_string(config,key,"contact_parameters",NULL));
......
......@@ -299,7 +299,7 @@ static void send_report(const LinphoneCall* call, reporting_session_report_t * r
return;
}
addr = linphone_address_new(call->dest_proxy->statistics_collector);
addr = linphone_address_new(linphone_proxy_config_get_quality_reporting_collector(call->dest_proxy));
if (addr == NULL) {
ms_warning("Asked to submit reporting statistics but no collector address found");
return;
......@@ -384,7 +384,7 @@ static void update_ip(LinphoneCall * call, int stats_type) {
}
static bool_t is_reporting_enabled(const LinphoneCall * call) {
return (call->dest_proxy != NULL && linphone_proxy_config_send_statistics_enabled(call->dest_proxy));
return (call->dest_proxy != NULL && linphone_proxy_config_quality_reporting_enabled(call->dest_proxy));
}
static void qos_analyser_on_action_suggested(void *user_data, const char * input, const char * output){
......
......@@ -259,17 +259,17 @@ static void call_with_specified_codec_bitrate(void) {
ms_warning("opus codec not supported, test skipped.");
goto end;
}
disable_all_codecs_except_one(marie->lc,"opus");
disable_all_codecs_except_one(pauline->lc,"opus");
linphone_core_set_payload_type_bitrate(marie->lc,
linphone_core_find_payload_type(marie->lc,"opus",48000,-1),
50);
linphone_core_set_payload_type_bitrate(pauline->lc,
linphone_core_find_payload_type(pauline->lc,"opus",48000,-1),
24);
CU_ASSERT_TRUE((call_ok=call(pauline,marie)));
if (!call_ok) goto end;
liblinphone_tester_check_rtcp(marie,pauline);
......@@ -663,9 +663,9 @@ static void call_with_ice_no_sdp(void){
linphone_core_set_firewall_policy(pauline->lc,LinphonePolicyUseIce);
linphone_core_set_stun_server(pauline->lc,"stun.linphone.org");
call(pauline,marie);
liblinphone_tester_check_rtcp(marie,pauline);
linphone_core_manager_destroy(marie);
......@@ -2136,7 +2136,7 @@ static void call_rejected_without_403_because_wrong_credentials_no_auth_req_cb()
call_rejected_because_wrong_credentials_with_params("tester-no-403",FALSE);
}
void create_call_for_statistics_tests(
void create_call_for_quality_reporting_tests(
LinphoneCoreManager* marie,
LinphoneCoreManager* pauline,
LinphoneCall** call_marie,
......@@ -2148,20 +2148,20 @@ void create_call_for_statistics_tests(
CU_ASSERT_PTR_NOT_NULL(*call_pauline);
}
static void statistics_not_used_without_config() {
static void quality_reporting_not_used_without_config() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCall* call_marie = NULL;
LinphoneCall* call_pauline = NULL;
create_call_for_statistics_tests(marie, pauline, &call_marie, &call_pauline);
create_call_for_quality_reporting_tests(marie, pauline, &call_marie, &call_pauline);
// marie has stats collection enabled since pauline has not
CU_ASSERT_TRUE(linphone_proxy_config_send_statistics_enabled(call_marie->dest_proxy));
CU_ASSERT_FALSE(linphone_proxy_config_send_statistics_enabled(call_pauline->dest_proxy));
CU_ASSERT_TRUE(linphone_proxy_config_quality_reporting_enabled(call_marie->dest_proxy));
CU_ASSERT_FALSE(linphone_proxy_config_quality_reporting_enabled(call_pauline->dest_proxy));
CU_ASSERT_EQUAL(strcmp("sip:collector@sip.example.org",
linphone_proxy_config_get_statistics_collector(call_marie->dest_proxy)), 0);
linphone_proxy_config_get_quality_reporting_collector(call_marie->dest_proxy)), 0);
// this field should be already filled
CU_ASSERT_PTR_NOT_NULL(call_marie->log->reports[0]->info.local_addr.ip);
......@@ -2173,7 +2173,7 @@ static void statistics_not_used_without_config() {
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void statistics_not_sent_if_call_not_started() {
static void quality_reporting_not_sent_if_call_not_started() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCallLog* out_call_log;
......@@ -2201,14 +2201,14 @@ static void statistics_not_sent_if_call_not_started() {
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void statistics_sent_at_call_termination() {
static void quality_reporting_at_call_termination() {
// int return_code = -1;
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCall* call_marie = NULL;
LinphoneCall* call_pauline = NULL;
create_call_for_statistics_tests(marie, pauline, &call_marie, &call_pauline);
create_call_for_quality_reporting_tests(marie, pauline, &call_marie, &call_pauline);
linphone_core_terminate_all_calls(marie->lc);
CU_ASSERT_TRUE(wait_for_until(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallReleased,1, 10000));
......@@ -2243,12 +2243,12 @@ static void multiple_early_media(void) {
int dummy=0;
char ringbackpath[256];
snprintf(ringbackpath,sizeof(ringbackpath), "%s/sounds/hello8000.wav" /*use hello because rinback is too short*/, liblinphone_tester_file_prefix);
pol.automatically_accept=1;
pol.automatically_initiate=1;
linphone_core_enable_video(pauline->lc,TRUE,TRUE);
linphone_core_enable_video(marie1->lc,TRUE,TRUE);
linphone_core_set_video_policy(marie1->lc,&pol);
/*use playfile for marie1 to avoid locking on capture card*/
......@@ -2262,44 +2262,44 @@ static void multiple_early_media(void) {
/*use playfile for marie2 to avoid locking on capture card*/
linphone_core_use_files(marie2->lc,TRUE);
linphone_core_set_play_file(marie2->lc,ringbackpath);
lcs=ms_list_append(lcs,marie1->lc);
lcs=ms_list_append(lcs,marie2->lc);
lcs=ms_list_append(lcs,pauline->lc);
linphone_call_params_enable_early_media_sending(params,TRUE);
linphone_call_params_enable_video(params,TRUE);
linphone_core_invite_address_with_params(pauline->lc,marie1->identity,params);
linphone_call_params_destroy(params);
CU_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000));
CU_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000));
CU_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallOutgoingEarlyMedia,1,3000));
pauline_call=linphone_core_get_current_call(pauline->lc);
marie1_call=linphone_core_get_current_call(marie1->lc);
marie2_call=linphone_core_get_current_call(marie2->lc);
/*wait a bit that streams are established*/
wait_for_list(lcs,&dummy,1,6000);
CU_ASSERT_TRUE(linphone_call_get_audio_stats(pauline_call)->download_bandwidth>70);
CU_ASSERT_TRUE(linphone_call_get_audio_stats(marie1_call)->download_bandwidth>70);
CU_ASSERT_TRUE(linphone_call_get_audio_stats(marie2_call)->download_bandwidth>70);
linphone_core_accept_call(marie1->lc,linphone_core_get_current_call(marie1->lc));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallStreamsRunning,1,3000));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,3000));
/*marie2 should get her call terminated*/
CU_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000));
/*wait a bit that streams are established*/
wait_for_list(lcs,&dummy,1,1000);
CU_ASSERT_TRUE(linphone_call_get_audio_stats(pauline_call)->download_bandwidth>71);
CU_ASSERT_TRUE(linphone_call_get_audio_stats(marie1_call)->download_bandwidth>71);
linphone_core_terminate_all_calls(pauline->lc);
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallEnd,1,1000));
......@@ -2374,9 +2374,9 @@ test_t call_tests[] = {
{ "Call established with rejected incoming RE-INVITE", call_established_with_rejected_incoming_reinvite },
{ "Call established with rejected RE-INVITE in error", call_established_with_rejected_reinvite_with_error},
{ "Call redirected by callee", call_redirect},
{ "Call statistics not used if no config", statistics_not_used_without_config},
{ "Call statistics not sent if call did not start", statistics_not_sent_if_call_not_started},
{ "Call statistics sent if call ended normally", statistics_sent_at_call_termination},
{ "Call quality reporting not used if no config", quality_reporting_not_used_without_config},
{ "Call quality reporting not sent if call did not start", quality_reporting_not_sent_if_call_not_started},
{ "Call quality reporting sent if call ended normally", quality_reporting_at_call_termination},
{ "Call with specified codec bitrate", call_with_specified_codec_bitrate}
};
......
......@@ -22,8 +22,8 @@ reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0
statistics_collector=sip:collector@sip.example.org
send_statistics=1
quality_reporting_collector=sip:collector@sip.example.org
quality_reporting_enabled=1
[friend_0]
url="Paupoche" <sip:pauline@sip.example.org>
......
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