diff --git a/coreapi/call_log.c b/coreapi/call_log.c index ee478263f..abfea81b7 100644 --- a/coreapi/call_log.c +++ b/coreapi/call_log.c @@ -281,6 +281,7 @@ static void _linphone_call_log_destroy(LinphoneCallLog *cl) { if (cl->call_id) ms_free(cl->call_id); if (cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]); if (cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]); + if (cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]); } LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *from, LinphoneAddress *to) { @@ -296,6 +297,7 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *fr cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]=linphone_reporting_new(); cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]=linphone_reporting_new(); + cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]=linphone_reporting_new(); cl->connected_date_time=0; return cl; } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 4a4c2d854..c9142ccf8 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4262,15 +4262,16 @@ void linphone_call_stats_uninit(LinphoneCallStats *stats){ } void linphone_call_notify_stats_updated(LinphoneCall *call, int stream_index){ - LinphoneCallStats *stats=&call->stats[stream_index]; - LinphoneCore *lc=call->core; + LinphoneCallStats *stats = &call->stats[stream_index]; + LinphoneCore *lc = call->core; if (stats->updated){ switch(stats->updated) { case LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE: case LINPHONE_CALL_STATS_SENT_RTCP_UPDATE: - linphone_reporting_on_rtcp_update(call, stream_index); + linphone_reporting_on_rtcp_update(call, stream_index == call->main_audio_stream_index ? SalAudio : stream_index == call->main_video_stream_index ? SalVideo : SalText); + break; + default: break; - default:break; } linphone_core_notify_call_stats_updated(lc, call, stats); stats->updated = 0; diff --git a/coreapi/private.h b/coreapi/private.h index f41a472fe..70de18d88 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -153,7 +153,7 @@ BELLE_SIP_DECLARE_VPTR(LinphoneCallParams); struct _LinphoneQualityReporting{ - reporting_session_report_t * reports[2]; /**Store information on audio and video media streams (RFC 6035) */ + reporting_session_report_t * reports[3]; /**Store information on audio and video media streams (RFC 6035) */ bool_t was_video_running; /*Keep video state since last check in order to detect its (de)activation*/ LinphoneQualityReportingReportSendCb on_report_sent; };