2006-06-08 snapshot
git-svn-id: svn://192.168.202.10@8 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -90,7 +90,10 @@ echo "ASTERISK: Inbound Calls Stats $NOW_TIME\n";
|
||||
echo "\n";
|
||||
echo "---------- TOTALS\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$extenSQL = "and extension='$group'";
|
||||
if (eregi("\*",$group))
|
||||
{$extenSQL = "and extension LIKE \"%$group\"";}
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -106,7 +109,7 @@ echo "Average Call Length(seconds) for all Calls: $average_hold_seconds\n";
|
||||
echo "\n";
|
||||
echo "---------- DROPS\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$group' and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -131,11 +134,11 @@ echo "Average Call Length(seconds) for DROP Calls: $average_hold_seconds\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL LISTINGS\n";
|
||||
echo "+------------+-----------------+--------+---------------------+\n";
|
||||
echo "| CALLERID | CALLERIDNAME | LENGTH | DATE TIME |\n";
|
||||
echo "+------------+-----------------+--------+---------------------+\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
echo "| CALLERID | CALLERIDNAME | LENGTH | DATE TIME |\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
@@ -144,8 +147,8 @@ while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$CID = sprintf("%-10s", $row[0]);
|
||||
$CIDname = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
$CID = sprintf("%-20s", $row[0]);
|
||||
$CIDname = sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
$datetime = sprintf("%-19s", $row[3]);
|
||||
$USERavgTALK = $row[2];
|
||||
|
||||
@@ -164,7 +167,7 @@ while ($i < $users_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------------+-----------------+--------+---------------------+\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
@@ -183,14 +186,14 @@ if ($output == 'FULL')
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' and extension='$group' and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -198,42 +201,42 @@ if ($output == 'FULL')
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' and extension='$group' and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' and extension='$group' and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' and extension='$group';";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' and extension='$group' and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$stmt="select count(*) from call_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
Reference in New Issue
Block a user