Commit ddff1d84 authored by Simon Morlat's avatar Simon Morlat

display average quality in call logs

parent 4f2c73c2
......@@ -1015,6 +1015,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
static void linphone_call_log_fill_stats(LinphoneCallLog *log, AudioStream *st){
audio_stream_get_local_rtp_stats (st,&log->local_stats);
log->quality=audio_stream_get_average_quality_rating(st);
}
void linphone_call_stop_media_streams(LinphoneCall *call){
......
......@@ -124,6 +124,7 @@ void call_logs_write_to_config_file(LinphoneCore *lc){
lp_config_set_string(cfg,logsection,"start_date",cl->start_date);
lp_config_set_int(cfg,logsection,"duration",cl->duration);
if (cl->refkey) lp_config_set_string(cfg,logsection,"refkey",cl->refkey);
lp_config_set_float(cfg,logsection,"quality",cl->quality);
}
for(;i<lc->max_call_logs;++i){
snprintf(logsection,sizeof(logsection),"call_log_%i",i);
......@@ -151,6 +152,7 @@ static void call_logs_read_from_config_file(LinphoneCore *lc){
cl->duration=lp_config_get_int(cfg,logsection,"duration",0);
tmp=lp_config_get_string(cfg,logsection,"refkey",NULL);
if (tmp) cl->refkey=ms_strdup(tmp);
cl->quality=lp_config_get_float(cfg,logsection,"quality",-1);
lc->call_logs=ms_list_append(lc->call_logs,cl);
}else break;
}
......
......@@ -152,6 +152,7 @@ typedef struct _LinphoneCallLog{
void *user_pointer;
rtp_stats_t local_stats;
rtp_stats_t remote_stats;
float quality;
struct _LinphoneCore *lc;
} LinphoneCallLog;
......
......@@ -307,9 +307,14 @@ void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *ke
void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, int value){
char tmp[30];
snprintf(tmp,30,"%i",value);
snprintf(tmp,sizeof(tmp),"%i",value);
lp_config_set_string(lpconfig,section,key,tmp);
}
void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value){
char tmp[30];
snprintf(tmp,sizeof(tmp),"%f",value);
lp_config_set_string(lpconfig,section,key,tmp);
lpconfig->modified++;
}
void lp_item_write(LpItem *item, FILE *file){
......
......@@ -86,6 +86,12 @@ void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *ke
* @ingroup misc
**/
void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, int value);
/**
* Sets a float config item
*
* @ingroup misc
**/
void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value);
/**
* Writes the config file to disk.
*
......
......@@ -40,14 +40,20 @@ void linphone_gtk_call_log_update(GtkWidget *w){
char *addr= linphone_address_as_string_uri_only (la);
const char *display;
gchar *logtxt;
gchar quality[20];
display=linphone_address_get_display_name (la);
if (display==NULL){
display=linphone_address_get_username (la);
if (display==NULL)
display=linphone_address_get_domain (la);
}
logtxt=g_markup_printf_escaped("<big><b>%s</b></big>\t<small><i>%s</i></small>\n"
"%s\t%i minutes %i seconds",display, addr, cl->start_date,
if (cl->quality!=-1){
snprintf(quality,sizeof(quality),"%.1f",cl->quality);
}
logtxt=g_markup_printf_escaped("<big><b>%s</b></big>\t<small><i>%s</i>\t<i>Quality: %s</i></small>\n"
"%s\t%i minutes %i seconds\t",display, addr, cl->quality!=-1 ? quality : _("n/a"),
cl->start_date,
cl->duration/60,cl->duration%60);
gtk_list_store_append (store,&iter);
gtk_list_store_set (store,&iter,
......
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