Active Queues: Hide array warnings.

This commit is contained in:
Nate 2019-09-16 06:48:50 -06:00
parent 231ac12381
commit afca52f267
1 changed files with 73 additions and 69 deletions

View File

@ -134,65 +134,67 @@
echo "<th>".$text['label-duration']."</th>\n";
echo "</tr>\n";
foreach ($xml->fifo->callers->caller as $row) {
/*
$username = $row->caller_profile->username;
$dialplan = $row->caller_profile->dialplan;
$caller_id_name = urldecode($row->caller_profile->caller_id_name);
$caller_id_number = $row->caller_profile->caller_id_number;
$ani = $row->caller_profile->ani;
$aniii = $row->caller_profile->aniii;
$network_addr = $row->caller_profile->network_addr;
$destination_number = $row->destination_number->rdnis;
$rdnis = $row->caller_profile->rdnis;
$uuid = $row->caller_profile->uuid;
$source = $row->caller_profile->source;
$context = $row->caller_profile->context;
$chan_name = $row->caller_profile->chan_name;
$default_language = $row->variables->default_language;
$fifo_position = $row->variables->fifo_position;
$fifo_priority = $row->variables->fifo_priority;
$fifo_status = $row->variables->fifo_status;
$fifo_timestamp = urldecode($row->variables->fifo_timestamp);
$fifo_time = strtotime($fifo_timestamp);
$fifo_duration = time() - $fifo_time;
$fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ;
*/
if (is_array($xml->fifo->callers->caller) && @sizeof($xml->fifo->callers->caller) != 0) {
foreach ($xml->fifo->callers->caller as $row) {
/*
$username = $row->caller_profile->username;
$dialplan = $row->caller_profile->dialplan;
$caller_id_name = urldecode($row->caller_profile->caller_id_name);
$caller_id_number = $row->caller_profile->caller_id_number;
$ani = $row->caller_profile->ani;
$aniii = $row->caller_profile->aniii;
$network_addr = $row->caller_profile->network_addr;
$destination_number = $row->destination_number->rdnis;
$rdnis = $row->caller_profile->rdnis;
$uuid = $row->caller_profile->uuid;
$source = $row->caller_profile->source;
$context = $row->caller_profile->context;
$chan_name = $row->caller_profile->chan_name;
$default_language = $row->variables->default_language;
$fifo_position = $row->variables->fifo_position;
$fifo_priority = $row->variables->fifo_priority;
$fifo_status = $row->variables->fifo_status;
$fifo_timestamp = urldecode($row->variables->fifo_timestamp);
$fifo_time = strtotime($fifo_timestamp);
$fifo_duration = time() - $fifo_time;
$fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ;
*/
$username = $row->cdr->callflow->caller_profile->username;
$dialplan = $row->cdr->callflow->caller_profile->dialplan;
$caller_id_name = urldecode($row->cdr->callflow->caller_profile->caller_id_name);
$caller_id_number = $row->cdr->callflow->caller_profile->caller_id_number;
$ani = $row->cdr->callflow->caller_profile->ani;
$aniii = $row->cdr->callflow->caller_profile->aniii;
$network_addr = $row->cdr->callflow->caller_profile->network_addr;
$destination_number = $row->cdr->callflow->caller_profile->destination_number;
$rdnis = $row->cdr->callflow->caller_profile->rdnis;
$uuid = $row->cdr->callflow->caller_profile->uuid;
$source = $row->cdr->callflow->caller_profile->source;
$context = $row->cdr->callflow->caller_profile->context;
$chan_name = $row->cdr->callflow->caller_profile->chan_name;
$default_language = $row->cdr->variables->default_language;
$fifo_position = $row->cdr->variables->fifo_position;
$fifo_priority = $row->cdr->variables->fifo_priority;
$fifo_status = $row->cdr->variables->fifo_status;
$fifo_timestamp = urldecode($row->cdr->variables->fifo_timestamp);
$fifo_time = strtotime($fifo_timestamp);
$fifo_duration = time() - $fifo_time;
$fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ;
$username = $row->cdr->callflow->caller_profile->username;
$dialplan = $row->cdr->callflow->caller_profile->dialplan;
$caller_id_name = urldecode($row->cdr->callflow->caller_profile->caller_id_name);
$caller_id_number = $row->cdr->callflow->caller_profile->caller_id_number;
$ani = $row->cdr->callflow->caller_profile->ani;
$aniii = $row->cdr->callflow->caller_profile->aniii;
$network_addr = $row->cdr->callflow->caller_profile->network_addr;
$destination_number = $row->cdr->callflow->caller_profile->destination_number;
$rdnis = $row->cdr->callflow->caller_profile->rdnis;
$uuid = $row->cdr->callflow->caller_profile->uuid;
$source = $row->cdr->callflow->caller_profile->source;
$context = $row->cdr->callflow->caller_profile->context;
$chan_name = $row->cdr->callflow->caller_profile->chan_name;
$default_language = $row->cdr->variables->default_language;
$fifo_position = $row->cdr->variables->fifo_position;
$fifo_priority = $row->cdr->variables->fifo_priority;
$fifo_status = $row->cdr->variables->fifo_status;
$fifo_timestamp = urldecode($row->cdr->variables->fifo_timestamp);
$fifo_time = strtotime($fifo_timestamp);
$fifo_duration = time() - $fifo_time;
$fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ;
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($username)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($caller_id_name)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($caller_id_number)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($default_language)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($destination_number)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_position)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_priority)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_status)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_duration_formatted)." &nbsp;</td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($username)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($caller_id_name)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($caller_id_number)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($default_language)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($destination_number)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_position)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_priority)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_status)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_duration_formatted)." &nbsp;</td>\n";
echo "</tr>\n";
$c = $c ? 0 : 1;
}
}
echo "</table>\n";
@ -216,20 +218,22 @@
echo "</tr>\n";
//print_r($xml->fifo->outbound->member[0]);
//print_r($xml->fifo->outbound->member[1]);
foreach ($xml->fifo->outbound->member as $row) {
$username=explode("@",$row);
$username=explode("/",$username[0]);
$username=$username[1];
if (is_array($xml->fifo->outbound->member) && @sizeof($xml->fifo->outbound->member) != 0) {
foreach ($xml->fifo->outbound->member as $row) {
$username=explode("@",$row);
$username=explode("/",$username[0]);
$username=$username[1];
$fifo_duration_formatted=$row["logged-on-since"];
$fifo_total_inbound_calls=$row["outbound-call-total-count"];
$fifo_duration_formatted=$row["logged-on-since"];
$fifo_total_inbound_calls=$row["outbound-call-total-count"];
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($username)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_total_inbound_calls)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_duration_formatted)." &nbsp;</td>\n";
echo "</tr>\n";
$c = $c ? 0 : 1;
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($username)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_total_inbound_calls)." &nbsp;</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".escape($fifo_duration_formatted)." &nbsp;</td>\n";
echo "</tr>\n";
$c = $c ? 0 : 1;
}
}
echo "</table>\n";
}