Quality reporting: check it is enabled before processing call state changes

This commit is contained in:
Gautier Pelloux-Prayer 2014-06-12 15:07:22 +02:00
parent 0b6492f7e5
commit dda79c7bc4
2 changed files with 9 additions and 4 deletions

View file

@ -502,13 +502,15 @@ void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *
if (collector!=NULL && strlen(collector)>0){
LinphoneAddress *addr=linphone_address_new(collector);
if (!addr || linphone_address_get_username(addr)==NULL){
ms_warning("Invalid sip collector identity: %s",collector);
if (addr)
linphone_address_destroy(addr);
ms_error("Invalid SIP collector URI: %s. Quality reporting will be DISABLED.",collector);
} else {
if (cfg->quality_reporting_collector != NULL)
if (cfg->quality_reporting_collector != NULL){
ms_free(cfg->quality_reporting_collector);
}
cfg->quality_reporting_collector = ms_strdup(collector);
}
if (addr){
linphone_address_destroy(addr);
}
}

View file

@ -592,6 +592,9 @@ int linphone_reporting_publish_interval_report(LinphoneCall* call) {
void linphone_reporting_call_state_updated(LinphoneCall *call){
LinphoneCallState state=linphone_call_get_state(call);
if (! quality_reporting_enabled(call)){
return;
}
switch (state){
case LinphoneCallStreamsRunning:{
bool_t video_enabled=media_report_enabled(call, LINPHONE_CALL_STATS_VIDEO);