Add. Display both CPM for all calls and for answered only. (#2707)

This commit is contained in:
Alexey Melnichuk 2017-06-22 18:04:44 +03:00 committed by FusionPBX
parent d3a128bcb7
commit 9ccf44e059
2 changed files with 5 additions and 2 deletions

View File

@ -229,7 +229,7 @@ else {
}
echo " <td valign='top' class='".$row_style[$c]."'>".$row['volume']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(round($row['minutes'],2))."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(round($row['avg_min'],2))."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(round($row['avg_min'],2))."&nbsp;/&nbsp;".(round($row['cpm_ans'],2))."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href=\"xml_cdr.php?missed=true&direction=$direction&start_epoch=".$row['start_epoch']."&stop_epoch=".$row['stop_epoch']."\">".$row['missed']."</a>&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(round($row['asr'],2))."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(round($row['aloc'],2))."&nbsp;</td>\n";

View File

@ -294,8 +294,11 @@ else {
$delta_min = ($stop_epoch - $start_epoch) / 60;
$success_volume = ($stats[$i]['volume']==0) ? 0 : ($stats[$i]['volume'] - $stats[$i]['missed']);
// Calls per minute (answered)
$stats[$i]['cpm_ans'] = $success_volume / $delta_min;
// Calls per minute
$stats[$i]['avg_min'] = $success_volume / $delta_min;
$stats[$i]['avg_min'] = $stats[$i]['volume'] / $delta_min;
//answer / seizure ratio
$stats[$i]['asr'] = ($stats[$i]['volume']==0) ? 0 : ($success_volume / $stats[$i]['volume'] * 100);