Update CDR Stats application. (#2704)

* Update CDR Stats application.

Fix. Number of calls always calculate only for all domain.
Fix. Number of missed calls ignores any search parameters and use only `inbound` filter.
Fix. Calls duration for days use only domain filter and do not use any other filters.
Add. Limit setting for number of hours to calculate statistic.
Add. When timestamp set then calculate statistic only for this period.

* Fix. Calculate `Calls per minute`
Fix. Prevent divide `0/0` when calculate `ALOC`

* Fix. `Hours` have to be integer type.
This commit is contained in:
Alexey Melnichuk
2017-06-21 08:20:29 -06:00
committed by FusionPBX
parent 0fecdec093
commit 74454b738f
3 changed files with 93 additions and 170 deletions
+3 -8
View File
@@ -215,14 +215,9 @@ else {
echo " <th>ALOC</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td valign='top' class='".$row_style[$c]."'>1</td>\n";
}
elseif ($i == $hours+2) {
echo "<tr>\n";
echo " <td valign='top' class='".$row_style[$c]."'>7</td>\n";
}
elseif ($i == $hours+3) {
echo " <td valign='top' class='".$row_style[$c]."'>30</td>\n";
if ($i > $hours) {
echo " <td valign='top' class='".$row_style[$c]."'>" . floor($row['hours']/24) . "</td>\n";
}
if ($i <= $hours) {
echo " <td valign='top' class='".$row_style[$c]."'>".date('j M', $row['start_epoch'])."</td>\n";
@@ -235,7 +230,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]."'><a href=\"xml_cdr.php?missed=true&direction=inbound&start_epoch=".$row['start_epoch']."&stop_epoch=".$row['stop_epoch']."\">".$row['missed']."</a>&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";
echo "</tr >\n";