User Dashboard: Add blocks with additional customizable information (voicemail count, missed calls, recent calls, system counts, domain limits, and system status).

CDR: Adjust icon status and missed call filter to be more accurate, simplify User's view of CDR, add additional call result filter.
This commit is contained in:
reliberate 2016-03-10 16:29:47 -07:00
parent 833860e067
commit 49bb6c1ded
29 changed files with 3235 additions and 1658 deletions

File diff suppressed because it is too large Load Diff

View File

@ -78,36 +78,36 @@ else {
echo "<td align='left' nowrap='nowrap' style='vertical-align: top;'><b>".$text['title']."</b><br><br><br></td>\n";
echo "<td align='right' width='100%' style='vertical-align: top;'>\n";
echo " <form id='frm_export' method='post' action='xml_cdr_export.php'>\n";
echo " <input type='hidden' name='cdr_id' value='$cdr_id'>\n";
echo " <input type='hidden' name='missed' value='$missed'>\n";
echo " <input type='hidden' name='direction' value='$direction'>\n";
echo " <input type='hidden' name='caller_id_name' value='$caller_id_name'>\n";
echo " <input type='hidden' name='start_stamp_begin' value='$start_stamp_begin'>\n";
echo " <input type='hidden' name='start_stamp_end' value='$start_stamp_end'>\n";
echo " <input type='hidden' name='hangup_cause' value='$hangup_cause'>\n";
echo " <input type='hidden' name='caller_extension_uuid' value='$caller_extension_uuid'>\n";
echo " <input type='hidden' name='caller_id_number' value='$caller_id_number'>\n";
echo " <input type='hidden' name='destination_number' value='$destination_number'>\n";
echo " <input type='hidden' name='context' value='$context'>\n";
echo " <input type='hidden' name='answer_stamp_begin' value='$answer_stamp_begin'>\n";
echo " <input type='hidden' name='answer_stamp_end' value='$answer_stamp_end'>\n";
echo " <input type='hidden' name='end_stamp_begin' value='$end_stamp_begin'>\n";
echo " <input type='hidden' name='end_stamp_end' value='$end_stamp_end'>\n";
echo " <input type='hidden' name='start_epoch' value='$start_epoch'>\n";
echo " <input type='hidden' name='stop_epoch' value='$stop_epoch'>\n";
echo " <input type='hidden' name='duration' value='$duration'>\n";
echo " <input type='hidden' name='billsec' value='$billsec'>\n";
echo " <input type='hidden' name='uuid' value='$uuid'>\n";
echo " <input type='hidden' name='bleg_uuid' value='$bleg_uuid'>\n";
echo " <input type='hidden' name='accountcode' value='$accountcode'>\n";
echo " <input type='hidden' name='read_codec' value='$read_codec'>\n";
echo " <input type='hidden' name='write_codec' value='$write_codec'>\n";
echo " <input type='hidden' name='remote_media_ip' value='$remote_media_ip'>\n";
echo " <input type='hidden' name='network_addr' value='$network_addr'>\n";
echo " <input type='hidden' name='bridge_uuid' value='$bridge_uuid'>\n";
echo " <input type='hidden' name='cdr_id' value='".$cdr_id."'>\n";
echo " <input type='hidden' name='direction' value='".$direction."'>\n";
echo " <input type='hidden' name='caller_id_name' value='".$caller_id_name."'>\n";
echo " <input type='hidden' name='start_stamp_begin' value='".$start_stamp_begin."'>\n";
echo " <input type='hidden' name='start_stamp_end' value='".$start_stamp_end."'>\n";
echo " <input type='hidden' name='hangup_cause' value='".$hangup_cause."'>\n";
echo " <input type='hidden' name='call_result' value='".$call_result."'>\n";
echo " <input type='hidden' name='caller_extension_uuid' value='".$caller_extension_uuid."'>\n";
echo " <input type='hidden' name='caller_id_number' value='".$caller_id_number."'>\n";
echo " <input type='hidden' name='destination_number' value='".$destination_number."'>\n";
echo " <input type='hidden' name='context' value='".$context."'>\n";
echo " <input type='hidden' name='answer_stamp_begin' value='".$answer_stamp_begin."'>\n";
echo " <input type='hidden' name='answer_stamp_end' value='".$answer_stamp_end."'>\n";
echo " <input type='hidden' name='end_stamp_begin' value='".$end_stamp_begin."'>\n";
echo " <input type='hidden' name='end_stamp_end' value='".$end_stamp_end."'>\n";
echo " <input type='hidden' name='start_epoch' value='".$start_epoch."'>\n";
echo " <input type='hidden' name='stop_epoch' value='".$stop_epoch."'>\n";
echo " <input type='hidden' name='duration' value='".$duration."'>\n";
echo " <input type='hidden' name='billsec' value='".$billsec."'>\n";
echo " <input type='hidden' name='uuid' value='".$uuid."'>\n";
echo " <input type='hidden' name='bleg_uuid' value='".$bleg_uuid."'>\n";
echo " <input type='hidden' name='accountcode' value='".$accountcode."'>\n";
echo " <input type='hidden' name='read_codec' value='".$read_codec."'>\n";
echo " <input type='hidden' name='write_codec' value='".$write_codec."'>\n";
echo " <input type='hidden' name='remote_media_ip' value='".$remote_media_ip."'>\n";
echo " <input type='hidden' name='network_addr' value='".$network_addr."'>\n";
echo " <input type='hidden' name='bridge_uuid' value='".$bridge_uuid."'>\n";
if (isset($order_by)) {
echo " <input type='hidden' name='order_by' value='$order_by'>\n";
echo " <input type='hidden' name='order' value='$order'>\n";
echo " <input type='hidden' name='order_by' value='".$order_by."'>\n";
echo " <input type='hidden' name='order' value='".$order."'>\n";
}
if (permission_exists('xml_cdr_all' && $_REQUEST['showall'] == 'true')) {
echo " <input type='hidden' name='showall' value='true'>\n";
@ -126,8 +126,8 @@ else {
}
echo " <input type='button' class='btn' value='".$text['button-advanced_search']."' onclick=\"window.location='xml_cdr_search.php?$query_string';\">\n";
}
if ($_GET['missed'] != 'true') {
echo " <input type='button' class='btn' value='".$text['button-missed']."' onclick=\"document.location.href='xml_cdr.php?missed=true';\">\n";
if ($_GET['call_result'] != 'missed') {
echo " <input type='button' class='btn' value='".$text['button-missed']."' onclick=\"document.location.href='xml_cdr.php?call_result=missed';\">\n";
}
echo " <input type='button' class='btn' value='".$text['button-statistics']."' onclick=\"document.location.href='xml_cdr_statistics.php';\">\n";
echo " <input type='button' class='btn' value='".$text['button-export']."' onclick=\"toggle_select('export_format');\">\n";
@ -151,14 +151,12 @@ else {
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "".$text['description']." \n";
echo "".$text['description2']." \n";
echo "".$text['description-3']." \n";
echo "".$text['description-4']." \n";
//To do an advanced search of the call detail records click on the following advanced button.
echo $text['description']." \n";
echo $text['description2']." \n";
echo $text['description-3']." \n";
echo $text['description-4']." \n";
echo "<br />\n";
echo "<br />\n";
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
@ -171,140 +169,154 @@ else {
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='33%' style='vertical-align: top;'>\n";
echo "<td width='".((if_group("admin") || if_group("superadmin") || if_group("cdr")) ? '19%' : '30%')."' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-direction']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <td class='vtable' align='left'>\n";
echo " <select name='direction' class='formfld'>\n";
echo " <option value=''></option>\n";
if ($direction == "inbound") {
echo " <option value='inbound' selected='selected'>".$text['label-inbound']."</option>\n";
}
else {
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
}
if ($direction == "outbound") {
echo " <option value='outbound' selected='selected'>".$text['label-outbound']."</option>\n";
}
else {
echo " <option value='outbound'>".$text['label-outbound']."</option>\n";
}
if ($direction == "local") {
echo " <option value='local' selected='selected'>".$text['label-local']."</option>\n";
}
else {
echo " <option value='local'>".$text['label-local']."</option>\n";
}
echo " <option value='inbound' ".(($direction == "inbound") ? "selected='selected'" : null).">".$text['label-inbound']."</option>\n";
echo " <option value='outbound' ".(($direction == "outbound") ? "selected='selected'" : null).">".$text['label-outbound']."</option>\n";
echo " <option value='local' ".(($direction == "local") ? "selected='selected'" : null).">".$text['label-local']."</option>\n";
echo " </select>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-status']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <select name=\"hangup_cause\" class='formfld'>\n";
echo " <td class='vtable' align='left'>\n";
echo " <select name='call_result' class='formfld'>\n";
echo " <option value=''></option>\n";
$cdr_status_options = array(
'NORMAL_CLEARING',
'ORIGINATOR_CANCEL',
'BLIND_TRANSFER',
'LOSE_RACE',
'NO_ANSWER',
'NORMAL_UNSPECIFIED',
'NO_USER_RESPONSE',
'NO_ROUTE_DESTINATION',
'SUBSCRIBER_ABSENT',
'NORMAL_TEMPORARY_FAILURE',
'ATTENDED_TRANSFER',
'PICKED_OFF',
'USER_BUSY',
'CALL_REJECTED',
'INVALID_NUMBER_FORMAT',
'NETWORK_OUT_OF_ORDER',
'DESTINATION_OUT_OF_ORDER',
'RECOVERY_ON_TIMER_EXPIRE',
'MANAGER_REQUEST',
'MEDIA_TIMEOUT',
'UNALLOCATED_NUMBER',
'NONE',
'EXCHANGE_ROUTING_ERROR',
'ALLOTTED_TIMEOUT',
'CHAN_NOT_IMPLEMENTED',
'INCOMPATIBLE_DESTINATION',
'USER_NOT_REGISTERED',
'SYSTEM_SHUTDOWN',
'MANDATORY_IE_MISSING'
);
sort($cdr_status_options);
foreach ($cdr_status_options as $cdr_status) {
$selected = ($hangup_cause == $cdr_status) ? "selected='selected'" : null;
$cdr_status_label = ucwords(strtolower(str_replace("_", " ", $cdr_status)));
echo " <option value='".$cdr_status."' ".$selected.">".$cdr_status_label."</option>\n";
}
echo " <option value='answered' ".(($call_result == 'answered') ? 'selected' : null).">".$text['label-answered']."</option>\n";
echo " <option value='missed' ".(($call_result == 'missed') ? 'selected' : null).">".$text['label-missed']."</option>\n";
echo " <option value='voicemail' ".(($call_result == 'voicemail') ? 'selected' : null).">".$text['label-voicemail']."</option>\n";
echo " <option value='cancelled' ".(($call_result == 'cancelled') ? 'selected' : null).">".$text['label-cancelled']."</option>\n";
echo " <option value='failed' ".(($call_result == 'failed') ? 'selected' : null).">".$text['label-failed']."</option>\n";
echo " </select>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
echo "<td width='33%' style='vertical-align: top;'>\n";
echo "<td width='".((if_group("admin") || if_group("superadmin") || if_group("cdr")) ? '24%' : '30%')."' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-source']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left' style='white-space: nowrap;'>\n";
echo " <td class='vtable' align='left' style='white-space: nowrap;'>\n";
echo " <input type='text' class='formfld' style='".$style['caller_id_number']."' name='caller_id_number' id='caller_id_number' value='".$caller_id_number."'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-destination']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left' style='white-space: nowrap;'>\n";
echo " <td class='vtable' align='left' style='white-space: nowrap;'>\n";
echo " <input type='text' class='formfld' name='destination_number' id='destination_number' value='".$destination_number."'>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
echo "<td width='34%' style='vertical-align: top;'>\n";
echo "<td width='".((if_group("admin") || if_group("superadmin") || if_group("cdr")) ? '30%' : '40%')."' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-start_range']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left' style='white-space: nowrap;'>\n";
echo " <td class='vtable' align='left' style='white-space: nowrap;'>\n";
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='start_stamp_begin' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-from']."' value='$start_stamp_begin'>\n";
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='start_stamp_end' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-to']."' value='$start_stamp_end'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-cid-name']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <td class='vtable' align='left'>\n";
echo " <input type='text' class='formfld' name='caller_id_name' value='$caller_id_name'>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
// show hangup clause filter to super/admin
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<td width='27%' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap'>\n";
echo " ".$text['label-hangup_cause']."\n";
echo " </td>\n";
echo " <td class='vtable' align='left'>\n";
echo " <select name='hangup_cause' class='formfld'>\n";
echo " <option value=''></option>\n";
$cdr_status_options = array(
'NORMAL_CLEARING',
'ORIGINATOR_CANCEL',
'BLIND_TRANSFER',
'LOSE_RACE',
'NO_ANSWER',
'NORMAL_UNSPECIFIED',
'NO_USER_RESPONSE',
'NO_ROUTE_DESTINATION',
'SUBSCRIBER_ABSENT',
'NORMAL_TEMPORARY_FAILURE',
'ATTENDED_TRANSFER',
'PICKED_OFF',
'USER_BUSY',
'CALL_REJECTED',
'INVALID_NUMBER_FORMAT',
'NETWORK_OUT_OF_ORDER',
'DESTINATION_OUT_OF_ORDER',
'RECOVERY_ON_TIMER_EXPIRE',
'MANAGER_REQUEST',
'MEDIA_TIMEOUT',
'UNALLOCATED_NUMBER',
'NONE',
'EXCHANGE_ROUTING_ERROR',
'ALLOTTED_TIMEOUT',
'CHAN_NOT_IMPLEMENTED',
'INCOMPATIBLE_DESTINATION',
'USER_NOT_REGISTERED',
'SYSTEM_SHUTDOWN',
'MANDATORY_IE_MISSING'
);
sort($cdr_status_options);
foreach ($cdr_status_options as $cdr_status) {
$selected = ($hangup_cause == $cdr_status) ? "selected='selected'" : null;
$cdr_status_label = ucwords(strtolower(str_replace("_", " ", $cdr_status)));
echo " <option value='".$cdr_status."' ".$selected.">".$cdr_status_label."</option>\n";
}
echo " </select>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
}
echo "</tr>";
echo "</table>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>";
echo "<td colspan='2' style='padding-top: 8px;' align='left'>";
echo "<td style='padding-top: 8px;' align='left'>";
echo $text['description_search'];
echo "</td>";
echo "<td style='padding-top: 8px;' align='right'>";
echo "<td style='padding-top: 8px;' align='right' nowrap>";
if (permission_exists('xml_cdr_all') && $_REQUEST['showall'] == 'true') {
echo "<input type='hidden' name='showall' value='true'>\n";
}
@ -332,44 +344,50 @@ else {
echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
$col_count++;
}
echo "<th>&nbsp;</th>\n";
if ($_REQUEST['showall'] && permission_exists('xml_cdr_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
$col_count++;
}
echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order, null, null, $param);
echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order, null, null, $param);
echo th_order_by('destination_number', $text['label-destination'], $order_by, $order, null, null, $param);
if (permission_exists('recording_play') || permission_exists('recording_download')) {
echo "<th>".$text['label-recording']."</th>\n";
$col_count++;
}
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param);
echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param);
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param);
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
// billing collumns
echo "<th>".$text['label-price']."</th>\n";
$col_count++;
}
if (permission_exists('xml_cdr_pdd')) {
echo th_order_by('pdd_ms', 'PDD', $order_by, $order, null, "style='text-align: right;'", $param);
$col_count++;
}
if (permission_exists('xml_cdr_mos')) {
echo th_order_by('rtp_audio_in_mos', 'MOS', $order_by, $order, null, "style='text-align: center;'", $param);
$col_count++;
}
echo th_order_by('hangup_cause', $text['label-status'], $order_by, $order, $param);
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<td class='list_control_icon'>";
if (permission_exists('xml_cdr_delete') && $result_count > 0) {
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
//column headings
echo "<th>&nbsp;</th>\n";
if ($_REQUEST['showall'] && permission_exists('xml_cdr_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
$col_count++;
}
echo "</td>\n";
$col_count++;
}
echo "</tr>\n";
echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order, null, null, $param);
echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order, null, null, $param);
echo th_order_by('destination_number', $text['label-destination'], $order_by, $order, null, null, $param);
if (permission_exists('recording_play') || permission_exists('recording_download')) {
echo "<th>".$text['label-recording']."</th>\n";
$col_count++;
}
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param);
echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param);
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param);
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
echo "<th>".$text['label-price']."</th>\n";
$col_count++;
}
if (permission_exists('xml_cdr_pdd')) {
echo th_order_by('pdd_ms', 'PDD', $order_by, $order, null, "style='text-align: right;'", $param);
$col_count++;
}
if (permission_exists('xml_cdr_mos')) {
echo th_order_by('rtp_audio_in_mos', 'MOS', $order_by, $order, null, "style='text-align: center;'", $param);
$col_count++;
}
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo th_order_by('hangup_cause', $text['label-hangup_cause'], $order_by, $order, null, null, $param);
}
else {
echo "<th>".$text['label-status']."</th>\n";
}
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<td class='list_control_icon'>";
if (permission_exists('xml_cdr_delete') && $result_count > 0) {
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
}
echo "</td>\n";
$col_count++;
}
echo "</tr>\n";
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
require_once "app/billing/resources/functions/rating.php";
require_once "resources/classes/database.php";
@ -377,6 +395,22 @@ else {
}
if ($result_count > 0) {
//determine if theme images exist
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/";
$theme_cdr_images_exist = (
file_exists($theme_image_path."icon_cdr_inbound_answered.png") &&
file_exists($theme_image_path."icon_cdr_inbound_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_inbound_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_inbound_failed.png") &&
file_exists($theme_image_path."icon_cdr_outbound_answered.png") &&
file_exists($theme_image_path."icon_cdr_outbound_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_outbound_failed.png") &&
file_exists($theme_image_path."icon_cdr_local_answered.png") &&
file_exists($theme_image_path."icon_cdr_local_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_local_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_local_failed.png")
) ? true : false;
foreach($result as $index => $row) {
$tmp_year = date("Y", strtotime($row['start_stamp']));
$tmp_month = date("M", strtotime($row['start_stamp']));
@ -394,245 +428,212 @@ else {
$hangup_cause = ucwords($hangup_cause);
//if call cancelled, show the ring time, not the bill time.
$seconds = ($row['hangup_cause']=="ORIGINATOR_CANCEL") ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
$seconds = ($row['hangup_cause']=="ORIGINATOR_CANCEL") ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
//handle recordings
if (permission_exists('recording_play') || permission_exists('recording_download')) {
$tmp_rel_path = '/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION["domain_name"].$tmp_rel_path;
$tmp_name = '';
if(!empty($row['recording_file']) && file_exists($row['recording_file'])){
$tmp_name=$row['recording_file'];
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.wav')) {
$tmp_name = $row['uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.wav')) {
$tmp_name = $row['uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.mp3')) {
$tmp_name = $row['uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.mp3')) {
$tmp_name = $row['uuid']."_1.mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.wav')) {
$tmp_name = $row['bridge_uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.wav')) {
$tmp_name = $row['bridge_uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.mp3')) {
$tmp_name = $row['bridge_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.mp3')) {
$tmp_name = $row['bridge_uuid']."_1.mp3";
}
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name) && $seconds > 0) {
$recording_file_path = $tmp_rel_path.'/'.$tmp_name;
$recording_file_name = strtolower(pathinfo($tmp_name, PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
switch ($recording_file_ext) {
case "wav" : $recording_type = "audio/wav"; break;
case "mp3" : $recording_type = "audio/mpeg"; break;
case "ogg" : $recording_type = "audio/ogg"; break;
//determine recording properties
if (permission_exists('recording_play') || permission_exists('recording_download')) {
$tmp_rel_path = '/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION["domain_name"].$tmp_rel_path;
$tmp_name = '';
if (!empty($row['recording_file']) && file_exists($row['recording_file'])) { $tmp_name = $row['recording_file']; }
else if (file_exists($tmp_dir.'/'.$row['uuid'].'.wav')) { $tmp_name = $row['uuid'].".wav"; }
else if (file_exists($tmp_dir.'/'.$row['uuid'].'_1.wav')) { $tmp_name = $row['uuid']."_1.wav"; }
else if (file_exists($tmp_dir.'/'.$row['uuid'].'.mp3')) { $tmp_name = $row['uuid'].".mp3"; }
else if (file_exists($tmp_dir.'/'.$row['uuid'].'_1.mp3')) { $tmp_name = $row['uuid']."_1.mp3"; }
else if (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.wav')) { $tmp_name = $row['bridge_uuid'].".wav"; }
else if (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.wav')) { $tmp_name = $row['bridge_uuid']."_1.wav"; }
else if (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.mp3')) { $tmp_name = $row['bridge_uuid'].".mp3"; }
else if (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.mp3')) { $tmp_name = $row['bridge_uuid']."_1.mp3"; }
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name) && $seconds > 0) {
$recording_file_path = $tmp_rel_path.'/'.$tmp_name;
$recording_file_name = strtolower(pathinfo($tmp_name, PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
switch ($recording_file_ext) {
case "wav" : $recording_type = "audio/wav"; break;
case "mp3" : $recording_type = "audio/mpeg"; break;
case "ogg" : $recording_type = "audio/ogg"; break;
}
}
else {
unset($recording_file_path);
}
}
//recording playback
if (permission_exists('recording_play') && $recording_file_path != '') {
echo "<tr id='recording_progress_bar_".$row['uuid']."' style='display: none;'><td colspan='".((if_group("admin") || if_group("superadmin") || if_group("cdr")) ? ($col_count - 1) : $col_count)."'><span class='playback_progress_bar' id='recording_progress_".$row['uuid']."'></span></td></tr>\n";
}
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
$tr_link = "href='xml_cdr_details.php?uuid=".$row['uuid'].(($_REQUEST['showall']) ? "&showall=true" : null)."'";
}
else {
unset($recording_file_path);
$tr_link = null;
}
}
//recording playback progress bar
if (permission_exists('recording_play') && $recording_file_path != '') {
echo "<tr id='recording_progress_bar_".$row['uuid']."' style='display: none;'><td colspan='".((if_group("admin") || if_group("superadmin") || if_group("cdr")) ? ($col_count - 1) : $col_count)."'><span class='playback_progress_bar' id='recording_progress_".$row['uuid']."'></span></td></tr>\n";
}
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
$tr_link = "href='xml_cdr_details.php?uuid=".$row['uuid'].(($_REQUEST['showall']) ? "&showall=true" : null)."'";
}
else {
$tr_link = null;
}
echo "<tr ".$tr_link.">\n";
if (permission_exists('xml_cdr_delete')) {
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
echo " <input type='checkbox' name='id[".$index."]' id='checkbox_".$row['uuid']."' value='".$row['uuid']."' onclick=\"(this.checked) ? document.getElementById('recording_".$row['uuid']."').value='".base64_encode($recording_file_path)."' : document.getElementById('recording_".$row['uuid']."').value='';\">";
echo " <input type='hidden' name='rec[".$index."]' id='recording_".$row['uuid']."'>";
echo " </td>";
$xml_ids[] = 'checkbox_'.$row['uuid'];
}
if (
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_missed.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_connected.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_failed.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_connected.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_failed.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_connected.png")
) {
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>";
switch ($row['direction']) {
case "inbound" :
if ($row['billsec'] == 0)
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_missed.png' width='16' style='border: none;' title='".$text['label-inbound']." ".$text['label-missed']."'>\n";
else
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_connected.png' width='16' style='border: none;' title='".$text['label-inbound']."'>\n";
break;
case "outbound" :
if ($row['billsec'] == 0)
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_failed.png' width='16' style='border: none;' title='".$text['label-outbound']." ".$text['label-failed']."'>\n";
else
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_connected.png' width='16' style='border: none;' title='".$text['label-outbound']."'>\n";
break;
case "local" :
if ($row['billsec'] == 0)
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_failed.png' width='16' style='border: none;' title='".$text['label-local']." ".$text['label-failed']."'>\n";
else
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_connected.png' width='16' style='border: none;' title='".$text['label-local']."'>\n";
break;
default:
echo "&nbsp;";
echo "<tr ".$tr_link.">\n";
if (permission_exists('xml_cdr_delete')) {
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
echo " <input type='checkbox' name='id[".$index."]' id='checkbox_".$row['uuid']."' value='".$row['uuid']."' onclick=\"(this.checked) ? document.getElementById('recording_".$row['uuid']."').value='".base64_encode($recording_file_path)."' : document.getElementById('recording_".$row['uuid']."').value='';\">";
echo " <input type='hidden' name='rec[".$index."]' id='recording_".$row['uuid']."'>";
echo " </td>";
$xml_ids[] = 'checkbox_'.$row['uuid'];
}
echo " </td>\n";
}
else {
echo " <td class='".$row_style[$c]."'>&nbsp;</td>";
}
if ($_REQUEST['showall'] && permission_exists('xml_cdr_all')) {
echo " <td valign='top' class='".$row_style[$c]."'>";
echo $row['domain_name'].'&nbsp;';
echo " </td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'>";
echo $row['caller_id_name'].'&nbsp;';
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
if (is_numeric($row['caller_id_number'])) {
echo " ".format_phone($row['caller_id_number']).' ';
}
else {
echo " ".$row['caller_id_number'].' ';
}
echo " </a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['destination_number'])."&src_cid_number=".urlencode($row['destination_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['destination_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
if (is_numeric($row['destination_number'])) {
echo format_phone($row['destination_number'])."\n";
}
else {
echo " ".$row['destination_number']."\n";
}
echo " </a>\n";
echo " </td>\n";
if (permission_exists('recording_play') || permission_exists('recording_download')) {
if ($recording_file_path != '') {
echo " <td valign='top' align='center' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void' nowrap='nowrap'>";
if (permission_exists('recording_play')) {
echo "<audio id='recording_audio_".$row['uuid']."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$row['uuid']."')\" onended=\"recording_reset('".$row['uuid']."');\" src=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&filename=".base64_encode($recording_file_path)."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['uuid']."' onclick=\"recording_play('".$row['uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
//determine call result and appropriate icon
echo "<td valign='top' class='".$row_style[$c]."'>\n";
if ($theme_cdr_images_exist) {
if ($row['direction'] == 'inbound' || $row['direction'] == 'local') {
if ($row['answer_stamp'] != '' && $row['bridge_uuid'] != '') { $call_result = 'answered'; }
else if ($row['answer_stamp'] != '' && $row['bridge_uuid'] == '') { $call_result = 'voicemail'; }
else if ($row['answer_stamp'] == '' && $row['bridge_uuid'] == '' && $row['sip_hangup_disposition'] != 'send_refuse') { $call_result = 'cancelled'; }
else { $call_result = 'failed'; }
}
if (permission_exists('recording_download')) {
echo "<a href=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode($recording_file_path)."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
else if ($row['direction'] == 'outbound') {
if ($row['answer_stamp'] != '' && $row['bridge_uuid'] != '') { $call_result = 'answered'; }
else if ($row['answer_stamp'] == '' && $row['bridge_uuid'] != '') { $call_result = 'cancelled'; }
else { $call_result = 'failed'; }
}
echo "<img src='".PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none; cursor: help;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
}
else { echo "&nbsp;"; }
echo "</td>\n";
//domain name
if ($_REQUEST['showall'] && permission_exists('xml_cdr_all')) {
echo " <td valign='top' class='".$row_style[$c]."'>";
echo $row['domain_name'].'&nbsp;';
echo " </td>\n";
}
//caller id name
echo " <td valign='top' class='".$row_style[$c]."'>".$row['caller_id_name']."&nbsp;</td>\n";
//source
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
if (is_numeric($row['caller_id_number'])) {
echo " ".format_phone($row['caller_id_number']).' ';
}
else {
echo " ".$row['caller_id_number'].' ';
}
echo " </a>";
echo " </td>\n";
//destination
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['destination_number'])."&src_cid_number=".urlencode($row['destination_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['destination_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
if (is_numeric($row['destination_number'])) {
echo format_phone($row['destination_number'])."\n";
}
else {
echo " ".$row['destination_number']."\n";
}
echo " </a>\n";
echo " </td>\n";
//recording
if (permission_exists('recording_play') || permission_exists('recording_download')) {
if ($recording_file_path != '') {
echo " <td valign='top' align='center' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void' nowrap='nowrap'>";
if (permission_exists('recording_play')) {
echo "<audio id='recording_audio_".$row['uuid']."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$row['uuid']."')\" onended=\"recording_reset('".$row['uuid']."');\" src=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&filename=".base64_encode($recording_file_path)."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['uuid']."' onclick=\"recording_play('".$row['uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
}
if (permission_exists('recording_download')) {
echo "<a href=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode($recording_file_path)."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
}
echo " </td>\n";
}
else {
echo " <td valign='top' align='center' class='".$row_style[$c]."'>&nbsp;</td>\n";
}
}
//start
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
//tta (time to answer)
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".(($row['tta'] > 0) ? $row['tta']."s" : "&nbsp;")."</td>\n";
//duration
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".gmdate("G:i:s", $seconds)."</td>\n";
//billing
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$database->table = "v_xml_cdr";
$accountcode = (strlen($row["accountcode"])?$row["accountcode"]:$_SESSION[domain_name]);
$database->sql = "SELECT currency FROM v_billings WHERE type_value='$accountcode'";
$database->result = $database->execute();
$billing_currency = (strlen($database->result[0]['currency'])?$database->result[0]['currency']:'USD');
$billing_currency = (strlen($database->result[0]['currency'])?$database->result[0]['currency']:
(strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD')
);
unset($database->sql);
unset($database->result);
$sell_price = strlen($row['call_sell'])?$row['call_sell']:0;
$lcr_direction = (strlen($row['direction'])?$row['direction']:"outbound");
$xml_string = trim($row["xml"]);
$json_string = trim($row["json"]);
if (strlen($xml_string) > 0) {
$format = "xml";
}
if (strlen($json_string) > 0) {
$format = "json";
}
try {
if ($format == 'json') {
$array = json_decode($json_string,true);
}
if ($format == 'xml') {
$array = json_decode(json_encode((array)simplexml_load_string($xml_string)),true);
}
}
catch(Exception $e) {
echo $e->getMessage();
}
$n = (($lcr_direction == "inbound")?
check_str(urldecode($array["caller_profile"]["caller_id_number"])):
check_str(urldecode($array["variables"]["lcr_query_digits"]))
);
$database->table = "v_lcr";
$database->sql = "SELECT currency FROM v_lcr WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.enabled='true' AND v_lcr.lcr_direction='$lcr_direction' AND v_lcr.digits IN (".number_series($n).") ORDER BY digits DESC, rate ASC, date_start DESC LIMIT 1";
$database->result = $database->execute();
// print "<pre>"; print $database->sql . ":";print "[".$database->result[0]['currency']."]"; print_r($array); print "</pre>";
$lcr_currency = ((is_string($database->result[0]['currency']) && strlen($database->result[0]['currency']))?$database->result[0]['currency']:
(strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD')
); //billed currency
unset($database->sql);
unset($database->result);
if ($sell_price){
$price = currency_convert($sell_price, $billing_currency, $lcr_currency);
}
else {
$price = 0;
}
echo " <td valign='top' class='".$row_style[$c]."'>".number_format($price,6)." $billing_currency</td>\n";
unset ($sell_price, $price);
}
//pdd (post dial delay)
if (permission_exists("xml_cdr_pdd")) {
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".number_format($row['pdd_ms']/1000,2)."s</td>\n";
}
//mos (mean opinion score)
if (permission_exists("xml_cdr_mos")) {
echo " <td valign='top' class='".$row_style[$c]."' ".((strlen($row['rtp_audio_in_mos']) > 0) ? "title='".($row['rtp_audio_in_mos'] / 5 * 100)."%'" : null)." style='text-align: center;'>".((strlen($row['rtp_audio_in_mos']) > 0) ? $row['rtp_audio_in_mos'] : "&nbsp;")."</td>\n";
}
//hangup cause/call result
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'><a ".$tr_link.">".$hangup_cause."</a></td>\n";
}
else {
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>".ucwords($call_result)."</td>\n";
}
//control icons
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo " <td class='list_control_icons tr_link_void' nowrap='nowrap'>";
echo " <a $tr_link title='".$text['button-view']."'>$v_link_label_view</a>"; //CJB
if (permission_exists('xml_cdr_delete')) {
echo "<a href='xml_cdr_delete.php?id[]=".$row['uuid']."&rec[]=".(($recording_file_path != '') ? base64_encode($recording_file_path) : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
}
echo " </td>\n";
}
else {
echo " <td valign='top' align='center' class='".$row_style[$c]."'>&nbsp;</td>\n";
}
}
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".(($row['tta'] > 0) ? $row['tta']."s" : "&nbsp;")."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".gmdate("G:i:s", $seconds)."</td>\n";
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$database->table = "v_xml_cdr";
$accountcode = (strlen($row["accountcode"])?$row["accountcode"]:$_SESSION[domain_name]);
$database->sql = "SELECT currency FROM v_billings WHERE type_value='$accountcode'";
$database->result = $database->execute();
$billing_currency = (strlen($database->result[0]['currency'])?$database->result[0]['currency']:'USD');
$billing_currency = (strlen($database->result[0]['currency'])?$database->result[0]['currency']:
(strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD')
);
unset($database->sql);
unset($database->result);
$sell_price = strlen($row['call_sell'])?$row['call_sell']:0;
$lcr_direction = (strlen($row['direction'])?$row['direction']:"outbound");
$xml_string = trim($row["xml"]);
$json_string = trim($row["json"]);
if (strlen($xml_string) > 0) {
$format = "xml";
}
if (strlen($json_string) > 0) {
$format = "json";
}
try {
if ($format == 'json') {
$array = json_decode($json_string,true);
}
if ($format == 'xml') {
$array = json_decode(json_encode((array)simplexml_load_string($xml_string)),true);
}
}
catch(Exception $e) {
echo $e->getMessage();
}
$n = (($lcr_direction == "inbound")?
check_str(urldecode($array["caller_profile"]["caller_id_number"])):
check_str(urldecode($array["variables"]["lcr_query_digits"]))
);
$database->table = "v_lcr";
$database->sql = "SELECT currency FROM v_lcr WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.enabled='true' AND v_lcr.lcr_direction='$lcr_direction' AND v_lcr.digits IN (".number_series($n).") ORDER BY digits DESC, rate ASC, date_start DESC LIMIT 1";
$database->result = $database->execute();
// print "<pre>"; print $database->sql . ":";print "[".$database->result[0]['currency']."]"; print_r($array); print "</pre>";
$lcr_currency = ((is_string($database->result[0]['currency']) && strlen($database->result[0]['currency']))?$database->result[0]['currency']:
(strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD')
); //billed currency
unset($database->sql);
unset($database->result);
if ($sell_price){
$price = currency_convert($sell_price, $billing_currency, $lcr_currency);
}
else {
$price = 0;
}
echo " <td valign='top' class='".$row_style[$c]."'>".number_format($price,6)." $billing_currency</td>\n";
unset ($sell_price, $price);
}
if (permission_exists("xml_cdr_pdd")) {
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".number_format($row['pdd_ms']/1000,2)."s</td>\n";
}
if (permission_exists("xml_cdr_mos")) {
echo " <td valign='top' class='".$row_style[$c]."' ".((strlen($row['rtp_audio_in_mos']) > 0) ? "title='".($row['rtp_audio_in_mos'] / 5 * 100)."%'" : null)." style='text-align: center;'>".((strlen($row['rtp_audio_in_mos']) > 0) ? $row['rtp_audio_in_mos'] : "&nbsp;")."</td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>";
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<a $tr_link>".$hangup_cause."</a>";
}
else {
echo $hangup_cause;
}
echo " </td>\n";
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo " <td class='list_control_icons tr_link_void' nowrap='nowrap'>";
echo " <a $tr_link title='".$text['button-view']."'>$v_link_label_view</a>"; //CJB
if (permission_exists('xml_cdr_delete')) {
echo "<a href='xml_cdr_delete.php?id[]=".$row['uuid']."&rec[]=".(($recording_file_path != '') ? base64_encode($recording_file_path) : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
}
echo " </td>\n";
}
echo "</tr>\n";
$c = ($c) ? 0 : 1;
} //end foreach

View File

@ -43,7 +43,6 @@ else {
//get post or get variables from http
if (count($_REQUEST) > 0) {
$cdr_id = check_str($_REQUEST["cdr_id"]);
$missed = check_str($_REQUEST["missed"]);
$direction = check_str($_REQUEST["direction"]);
$caller_id_name = check_str($_REQUEST["caller_id_name"]);
$caller_id_number = check_str($_REQUEST["caller_id_number"]);
@ -61,6 +60,7 @@ else {
$duration = check_str($_REQUEST["duration"]);
$billsec = check_str($_REQUEST["billsec"]);
$hangup_cause = check_str($_REQUEST["hangup_cause"]);
$call_result = check_str($_REQUEST["call_result"]);
$uuid = check_str($_REQUEST["uuid"]);
$bleg_uuid = check_str($_REQUEST["bleg_uuid"]);
$accountcode = check_str($_REQUEST["accountcode"]);
@ -73,24 +73,12 @@ else {
$order = check_str($_REQUEST["order"]);
if (strlen(check_str($_REQUEST["mos_comparison"])) > 0) {
switch(check_str($_REQUEST["mos_comparison"])) {
case 'less':
$mos_comparison = "<";
break;
case 'greater':
$mos_comparison = ">";
break;
case 'lessorequal':
$mos_comparison = "<=";
break;
case 'greaterorequal':
$mos_comparison = ">=";
break;
case 'equal':
$mos_comparison = "<";
break;
case 'notequal':
$mos_comparison = "<>";
break;
case 'less': $mos_comparison = "<"; break;
case 'greater': $mos_comparison = ">"; break;
case 'lessorequal': $mos_comparison = "<="; break;
case 'greaterorequal': $mos_comparison = ">="; break;
case 'equal': $mos_comparison = "<"; break;
case 'notequal': $mos_comparison = "<>"; break;
}
} else {
$mos_comparison = '';
@ -102,9 +90,6 @@ else {
//build the sql where string
if ($missed == true) {
$sql_where_ands[] = "billsec = '0'";
}
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
$sql_where_ands[] = "start_epoch BETWEEN ".$start_epoch." AND ".$stop_epoch." ";
}
@ -144,6 +129,44 @@ else {
if (strlen($duration) > 0) { $sql_where_ands[] = "duration like '%".$duration."%'"; }
if (strlen($billsec) > 0) { $sql_where_ands[] = "billsec like '%".$billsec."%'"; }
if (strlen($hangup_cause) > 0) { $sql_where_ands[] = "hangup_cause like '%".$hangup_cause."%'"; }
if (strlen($call_result) > 0) {
switch ($call_result) {
case 'answered':
$sql_where_ands[] = "(answer_stamp is not null and bridge_uuid is not null)";
break;
case 'voicemail':
$sql_where_ands[] = "(answer_stamp is not null and bridge_uuid is null)";
break;
case 'missed':
$sql_missed_1 = "( (answer_stamp is not null and bridge_uuid is null) or (";
$sql_missed_2 = ") )";
case 'cancelled':
if ($direction == 'inbound' || $direction == 'local' || $call_result == 'missed') {
$sql_where_ands_cancelled = "(answer_stamp is null and bridge_uuid is null and sip_hangup_disposition <> 'send_refuse')";
}
else if ($direction == 'outbound') {
$sql_where_ands_cancelled = "(answer_stamp is null and bridge_uuid is not null)";
}
else {
$sql_where_ands_cancelled = "
((
(direction = 'inbound' or direction = 'local')
and answer_stamp is null
and bridge_uuid is null
and sip_hangup_disposition <> 'send_refuse'
)
or (
direction = 'outbound'
and answer_stamp is null
and bridge_uuid is not null
))";
}
$sql_where_ands[] = ($call_result == 'missed') ? $sql_missed_1.' '.$sql_where_ands_cancelled.' '.$sql_missed_2 : $sql_where_ands_cancelled;
break;
default: //failed
$sql_where_ands[] = "(answer_stamp is null and bridge_uuid is null and billsec = 0 and sip_hangup_disposition = 'send_refuse')";
}
}
if (strlen($uuid) > 0) { $sql_where_ands[] = "uuid = '".$uuid."'"; }
if (strlen($bleg_uuid) > 0) { $sql_where_ands[] = "bleg_uuid = '".$bleg_uuid."'"; }
if (strlen($accountcode) > 0) { $sql_where_ands[] = "accountcode = '".$accountcode."'"; }
@ -201,7 +224,6 @@ else {
//set the param variable which is used with paging
$param = "&cdr_id=".$cdr_id;
$param .= "&missed=".$missed;
$param .= "&direction=".$direction;
$param .= "&caller_id_name=".$caller_id_name;
$param .= "&caller_id_number=".$caller_id_number;
@ -219,6 +241,7 @@ else {
$param .= "&duration=".$duration;
$param .= "&billsec=".$billsec;
$param .= "&hangup_cause=".$hangup_cause;
$param .= "&call_result=".$call_result;
$param .= "&uuid=".$uuid;
$param .= "&bleg_uuid=".$bleg_uuid;
$param .= "&accountcode=".$accountcode;
@ -299,6 +322,8 @@ else {
$sql .= "caller_id_number, ";
$sql .= "destination_number, ";
$sql .= "accountcode, ";
$sql .= "answer_stamp, ";
$sql .= "sip_hangup_disposition, ";
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql .= "call_sell, ";
}

View File

@ -48,6 +48,7 @@ else {
echo "<tr>\n";
echo " <td width='30%' align='left' valign='top' nowrap='nowrap'><b>".$text['label-call-statistics']."</b></td>\n";
echo " <td width='70%' align='right' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='xml_cdr.php'\" value='".$text['button-back']."'>\n";
if (permission_exists('xml_cdr_search_advanced')) {
echo " <input type='button' class='btn' value='".$text['button-advanced_search']."' onclick=\"window.location='xml_cdr_search.php?redirect=xml_cdr_statistics';\">\n";
}
@ -56,7 +57,6 @@ else {
echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='xml_cdr_statistics.php?showall=true';\">\n";
}
}
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='xml_cdr.php'\" value='".$text['button-back']."'>\n";
echo " <input type='button' class='btn' value='".$text['button-extension_summary']."' onclick=\"document.location.href='xml_cdr_extension_summary.php';\">\n";
echo " <input type='button' class='btn' value='".$text['button-download_csv']."' onclick=\"document.location.href='xml_cdr_statistics_csv.php';\">\n";
echo " </td>\n";
@ -152,7 +152,7 @@ else {
if (data.length > 0)
$.plot($("#placeholder"), data, {
yaxis: { min: 0 },
<?php
<?php
if ($hours <= 48) {
echo "xaxis: {mode: \"time\",timeformat: \"%d:%H\",minTickSize: [1, \"hour\"]}";
} else if ($hours > 48 && $hours < 168) {
@ -160,9 +160,9 @@ else {
} else {
echo "xaxis: {mode: \"time\",timeformat: \"%m:%d\",minTickSize: [1, \"month\"]}";
}
?>
});
}

View File

@ -182,6 +182,53 @@ $text['login-message_attention']['ro'] = "Atenție!";
$text['login-message_attention']['fa'] = "";
$text['login-message_attention']['ar-eg'] = "برجاء الملاحظة";
$text['label-welcome']['en-us'] = "Welcome:";
$text['label-welcome']['es-cl'] = "Bienvenido:";
$text['label-welcome']['pt-pt'] = "Witamy:";
$text['label-welcome']['fr-fr'] = "Bienvenue:";
$text['label-welcome']['pt-br'] = "Bem vinda:";
$text['label-welcome']['pl'] = "Witamy:";
$text['label-welcome']['he'] = "ברוך הבא:";
$text['label-welcome']['uk'] = "Ласкаво просимо:";
$text['label-welcome']['sv-se'] = "Välkomna:";
$text['label-welcome']['de-at'] = "Herzlich willkommen:";
$text['label-welcome']['ro'] = "Bine ati venit:";
$text['label-welcome']['fa'] = "";
$text['label-welcome']['ar-eg'] = "أهلا بك:";
$text['label-voicemail']['en-us'] = "Voicemail";
$text['label-voicemail']['es-cl'] = "Correo de Voz";
$text['label-voicemail']['pt-pt'] = "Correio de Voz";
$text['label-voicemail']['fr-fr'] = "Messagerie Vocale";
$text['label-voicemail']['pt-br'] = "Correio de voz";
$text['label-voicemail']['pl'] = "Poczta głosowa";
$text['label-voicemail']['sv-se'] = "Röstbrevlåda";
$text['label-voicemail']['uk'] = "Голосова пошта";
$text['label-voicemail']['de-at'] = "Mailbox";
$text['label-voicemail']['he'] = "תא קולי";
$text['label-view_all']['en-us'] = "View All";
$text['label-view_all']['es-cl'] = "Mostrar Todos";
$text['label-view_all']['pt-pt'] = "Mostrar Todos";
$text['label-view_all']['fr-fr'] = "Tout Montrer";
$text['label-view_all']['pl'] = "Pokaż wszystkie";
$text['label-view_all']['uk'] = "Показати всі";
$text['label-view_all']['sv-se'] = "Visa Allt";
$text['label-view_all']['ro'] = "";
$text['label-view_all']['de-at'] = "Alle anzeigen";
$text['label-view_all']['he'] = "הצג הכל";
$text['label-value']['en-us'] = "Value";
$text['label-value']['es-cl'] = "Valor";
$text['label-value']['pt-pt'] = "Valor";
$text['label-value']['fr-fr'] = "Valeur";
$text['label-value']['nl-nl'] = "";
$text['label-value']['pt-br'] = "Valor";
$text['label-value']['pl'] = "Wartość";
$text['label-value']['sv-se'] = "Värde";
$text['label-value']['uk'] = "Значення";
$text['label-value']['de-at'] = "Wert";
$text['label-username']['en-us'] = "Username";
$text['label-username']['es-cl'] = "Nombre de Usuario";
$text['label-username']['pt-pt'] = "Nome de Utilizador";
@ -196,6 +243,16 @@ $text['label-username']['ro'] = "Utilizator";
$text['label-username']['fa'] = "";
$text['label-username']['ar-eg'] = "اسم المستخدم";
$text['label-users']['en-us'] = "Users";
$text['label-users']['es-cl'] = "Usuarios";
$text['label-users']['pt-pt'] = "Utilizadores";
$text['label-users']['fr-fr'] = "Utilisateurs";
$text['label-users']['pt-br'] = "Usuários";
$text['label-users']['pl'] = "Użytkownicy";
$text['label-users']['sv-se'] = "Användare";
$text['label-users']['uk'] = "Користувачі";
$text['label-users']['de-at'] = "Benutzer";
$text['label-user_language']['en-us'] = "Language";
$text['label-user_language']['es-cl'] = "Lengua";
$text['label-user_language']['pt-pt'] = "Língua";
@ -210,6 +267,31 @@ $text['label-user_language']['ro'] = "Limbă";
$text['label-user_language']['fa'] = "";
$text['label-user_language']['ar-eg'] = "اللغه";
$text['label-used']['en-us'] = "Used";
$text['label-used']['es-cl'] = "Usado";
$text['label-used']['pt-pt'] = "Usava";
$text['label-used']['fr-fr'] = "Utilisé";
$text['label-used']['pt-br'] = "Usava";
$text['label-used']['pl'] = "Używany";
$text['label-used']['he'] = "מְשׁוּמָשׁ";
$text['label-used']['uk'] = "використовується";
$text['label-used']['sv-se'] = "Begagnade";
$text['label-used']['de-at'] = "Benutzt";
$text['label-used']['ro'] = "Folosit";
$text['label-used']['fa'] = "";
$text['label-used']['ar-eg'] = "مستعمل";
$text['label-total']['en-us'] = "Total";
$text['label-total']['es-cl'] = "Total";
$text['label-total']['pt-pt'] = "Total";
$text['label-total']['fr-fr'] = "Total";
$text['label-total']['pt-br'] = "Total";
$text['label-total']['pl'] = "Podsumowanie";
$text['label-total']['sv-se'] = "Totalt";
$text['label-total']['uk'] = "Всього";
$text['label-total']['de-at'] = "Total";
$text['label-total']['he'] = "סה״כ";
$text['label-time']['en-us'] = "Time Zone";
$text['label-time']['es-cl'] = "Zona Horaria";
$text['label-time']['pt-pt'] = "Fuso Horário";
@ -224,6 +306,68 @@ $text['label-time']['ro'] = "Zonă fus orar";
$text['label-time']['fa'] = "";
$text['label-time']['ar-eg'] = "منطقة التوقيت";
$text['label-system_uptime']['en-us'] = "OS Uptime";
$text['label-system_uptime']['es-cl'] = "Tiempo de actividad del sistema";
$text['label-system_uptime']['pt-pt'] = "Uptime sistema";
$text['label-system_uptime']['fr-fr'] = "système Uptime";
$text['label-system_uptime']['pt-br'] = "Uptime sistema";
$text['label-system_uptime']['pl'] = "System Uptime";
$text['label-system_uptime']['he'] = "מערכת Uptime";
$text['label-system_uptime']['uk'] = "час роботи системи";
$text['label-system_uptime']['sv-se'] = "System Uptime";
$text['label-system_uptime']['de-at'] = "System-Uptime";
$text['label-system_uptime']['ro'] = "sistemul Uptime";
$text['label-system_uptime']['fa'] = "";
$text['label-system_uptime']['ar-eg'] = "نظام الجهوزية";
$text['label-system_status']['en-us'] = "System Status";
$text['label-system_status']['es-cl'] = "Estado del sistema";
$text['label-system_status']['pt-pt'] = "Status do sistema";
$text['label-system_status']['fr-fr'] = "État du système";
$text['label-system_status']['pt-br'] = "Status do sistema";
$text['label-system_status']['pl'] = "Status systemu";
$text['label-system_status']['he'] = "סטטוס מערכת";
$text['label-system_status']['uk'] = "стан системи";
$text['label-system_status']['sv-se'] = "Systemstatus ";
$text['label-system_status']['de-at'] = "Systemstatus";
$text['label-system_status']['ro'] = "Stare sistem";
$text['label-system_status']['fa'] = "";
$text['label-system_status']['ar-eg'] = "حالة النظام";
$text['label-system_counts']['en-us'] = "System Counts";
$text['label-system_counts']['es-cl'] = "Cuenta del sistema";
$text['label-system_counts']['pt-pt'] = "contagens do sistema";
$text['label-system_counts']['fr-fr'] = "Chiffres de système";
$text['label-system_counts']['pt-br'] = "contagens do sistema";
$text['label-system_counts']['pl'] = "Liczy systemowe";
$text['label-system_counts']['he'] = "ספירת מערכת";
$text['label-system_counts']['uk'] = "система зараховує";
$text['label-system_counts']['sv-se'] = "System Counts";
$text['label-system_counts']['de-at'] = "System zählt";
$text['label-system_counts']['ro'] = "Numără sistem";
$text['label-system_counts']['fa'] = "";
$text['label-system_counts']['ar-eg'] = "التهم النظام";
$text['label-switch_uptime']['en-us'] = "Switch Uptime";
$text['label-switch_uptime']['es-cl'] = "Tiempo de actividad Switch";
$text['label-switch_uptime']['pt-pt'] = "Uptime Switch";
$text['label-switch_uptime']['fr-fr'] = "Switch Uptime";
$text['label-switch_uptime']['pt-br'] = "Uptime Switch";
$text['label-switch_uptime']['pl'] = "Switch Uptime";
$text['label-switch_uptime']['sv-se'] = "Switch Uptime";
$text['label-switch_uptime']['uk'] = "Switch Uptime";
$text['label-switch_uptime']['de-at'] = "Switch Uptime";
$text['label-switch']['en-us'] = "Switch";
$text['label-switch']['es-cl'] = "Switch";
$text['label-switch']['pt-pt'] = "Switch";
$text['label-switch']['fr-fr'] = "Switch";
$text['label-switch']['pt-br'] = "Switch";
$text['label-switch']['pl'] = "Switch";
$text['label-switch']['sv-se'] = "Switch";
$text['label-switch']['uk'] = "Switch";
$text['label-switch']['de-at'] = "Switch";
$text['label-status']['en-us'] = "Status";
$text['label-status']['es-cl'] = "Estado";
$text['label-status']['pt-pt'] = "Estado";
@ -280,6 +424,41 @@ $text['label-repeat_password']['ro'] = "Repetare parolă";
$text['label-repeat_password']['fa'] = "";
$text['label-repeat_password']['ar-eg'] = "تاكيد كلمة السر";
$text['label-registrations']['en-us'] = "Registrations";
$text['label-registrations']['es-cl'] = "Inscripciones";
$text['label-registrations']['pt-pt'] = "Inscrições";
$text['label-registrations']['fr-fr'] = "Enregistrements SIP";
$text['label-registrations']['pt-br'] = "Inscrições";
$text['label-registrations']['pl'] = "Rejestracje";
$text['label-registrations']['sv-se'] = "Registreringar";
$text['label-registrations']['uk'] = "Реєстрації";
$text['label-registrations']['de-at'] = "Registrierungen";
$text['label-recent_calls']['en-us'] = "Recent Calls";
$text['label-recent_calls']['es-cl'] = "Llamadas recientes";
$text['label-recent_calls']['fr-fr'] = "Appels récents";
$text['label-recent_calls']['pt-pt'] = "chamadas recentes";
$text['label-recent_calls']['pt-br'] = "chamadas recentes";
$text['label-recent_calls']['pl'] = "Ostatnie połączenia";
$text['label-recent_calls']['sv-se'] = "Samtals";
$text['label-recent_calls']['de-at'] = "Kürzliche Anrufe";
$text['label-recent_calls']['ar-eg'] = "المكالمات الأخيرة";
$text['label-recent_calls']['he'] = "שיחות אחרונות";
$text['label-processor_usage']['en-us'] = "CPU Usage";
$text['label-processor_usage']['es-cl'] = "uso del procesador";
$text['label-processor_usage']['pt-pt'] = "O uso do processador";
$text['label-processor_usage']['fr-fr'] = "processeur Utilisation";
$text['label-processor_usage']['pt-br'] = "O uso do processador";
$text['label-processor_usage']['pl'] = "Wykorzystanie procesora";
$text['label-processor_usage']['he'] = "שימוש מעבד";
$text['label-processor_usage']['uk'] = "Використання процесора";
$text['label-processor_usage']['sv-se'] = "processor Usage";
$text['label-processor_usage']['de-at'] = "Prozessorauslastung ";
$text['label-processor_usage']['ro'] = "procesor de utilizare";
$text['label-processor_usage']['fa'] = "";
$text['label-processor_usage']['ar-eg'] = "معالج الاستخدام";
$text['label-password']['en-us'] = "Password";
$text['label-password']['es-cl'] = "Contraseña";
$text['label-password']['pt-pt'] = "Password";
@ -294,6 +473,31 @@ $text['label-password']['ro'] = "Parolă";
$text['label-password']['fa'] = "";
$text['label-password']['ar-eg'] = "كلمة السر";
$text['label-outbound']['en-us'] = "Outbound";
$text['label-outbound']['es-cl'] = "Salida";
$text['label-outbound']['pt-pt'] = "Saída";
$text['label-outbound']['fr-fr'] = "Sortant";
$text['label-outbound']['pt-br'] = "Saída";
$text['label-outbound']['pl'] = "Wychodzące";
$text['label-outbound']['sv-se'] = "Utgående";
$text['label-outbound']['uk'] = "";
$text['label-outbound']['de-at'] = "Ausgehend";
$text['label-outbound']['he'] = "";
$text['label-no_voicemail_assigned']['en-us'] = "No Voicemail Assigned";
$text['label-no_voicemail_assigned']['es-cl'] = "No Asignado correo de voz";
$text['label-no_voicemail_assigned']['pt-pt'] = "Sem Voicemail Assigned";
$text['label-no_voicemail_assigned']['fr-fr'] = "Non Voicemail Assigné";
$text['label-no_voicemail_assigned']['pt-br'] = "Sem Voicemail Assigned";
$text['label-no_voicemail_assigned']['pl'] = "Nie głosowa Przypisany";
$text['label-no_voicemail_assigned']['he'] = "אין שירות תא קולי Assigned";
$text['label-no_voicemail_assigned']['uk'] = "Ні Voicemail Assigned";
$text['label-no_voicemail_assigned']['sv-se'] = "Ingen röstmeddelande Delad";
$text['label-no_voicemail_assigned']['de-at'] = "Nein Voicemail Assigned";
$text['label-no_voicemail_assigned']['ro'] = "Nr Mesagerie vocală alocate";
$text['label-no_voicemail_assigned']['fa'] = "";
$text['label-no_voicemail_assigned']['ar-eg'] = "لا المخصصة البريد الصوتي";
$text['label-new_password']['en-us'] = "New Password";
$text['label-new_password']['es-cl'] = "Nueva Contraseña";
$text['label-new_password']['pt-pt'] = "Nova Senha";
@ -308,6 +512,102 @@ $text['label-new_password']['ro'] = "Parolă nouă";
$text['label-new_password']['fa'] = "";
$text['label-new_password']['ar-eg'] = "كلمة سر جديدة";
$text['label-new']['en-us'] = "New";
$text['label-new']['es-cl'] = "Nueva";
$text['label-new']['pt-pt'] = "Nova";
$text['label-new']['fr-fr'] = "Nouveau";
$text['label-new']['pt-br'] = "Nova";
$text['label-new']['pl'] = "Nowy";
$text['label-new']['sv-se'] = "Nytt";
$text['label-new']['de-at'] = "Neu";
$text['label-new']['ro'] = "Nou";
$text['label-new']['he'] = "חדש";
$text['label-missed_calls']['en-us'] = "Missed Calls";
$text['label-missed_calls']['es-cl'] = "Llamadas perdidas";
$text['label-missed_calls']['fr-fr'] = "Appels manqués";
$text['label-missed_calls']['pt-pt'] = "Chamadas perdidas";
$text['label-missed_calls']['pt-br'] = "Chamadas perdidas";
$text['label-missed_calls']['pl'] = "Nieodebrane połączenie";
$text['label-missed_calls']['sv-se'] = "Missade samtal";
$text['label-missed_calls']['de-at'] = "Anrufe in Abwesenheit";
$text['label-missed_calls']['ar-eg'] = "مكالمات فائتة";
$text['label-missed_calls']['he'] = "שיחות שלא נענו";
$text['label-missed']['en-us'] = "Missed";
$text['label-missed']['es-cl'] = "Perdido";
$text['label-missed']['fr-fr'] = "Raté";
$text['label-missed']['pt-pt'] = "Perdidas";
$text['label-missed']['pt-br'] = "Perdidas";
$text['label-missed']['pl'] = "Nie odebrany";
$text['label-missed']['sv-se'] = "Missade";
$text['label-missed']['de-at'] = "Verpasst";
$text['label-missed']['ar-eg'] = "";
$text['label-missed']['he'] = "שיחה שלא נענתה";
$text['label-memory_usage']['en-us'] = "Memory Usage";
$text['label-memory_usage']['es-cl'] = "Uso de memoria";
$text['label-memory_usage']['pt-pt'] = "Uso de memória";
$text['label-memory_usage']['fr-fr'] = "Utilisation de la mémoire";
$text['label-memory_usage']['pt-br'] = "Uso de memória";
$text['label-memory_usage']['pl'] = "Zużycie pamięci";
$text['label-memory_usage']['he'] = "שימוש בזיכרון";
$text['label-memory_usage']['uk'] = "Використання пам'яті";
$text['label-memory_usage']['sv-se'] = "Minnesanvändning";
$text['label-memory_usage']['de-at'] = "Speichernutzung";
$text['label-memory_usage']['ro'] = "Folosirea memoriei";
$text['label-memory_usage']['fa'] = "";
$text['label-memory_usage']['ar-eg'] = "استخدام الذاكرة";
$text['label-local']['en-us'] = "Local";
$text['label-local']['es-cl'] = "Local";
$text['label-local']['pt-pt'] = "Local";
$text['label-local']['fr-fr'] = "Local";
$text['label-local']['pt-br'] = "Local";
$text['label-local']['pl'] = "Lokalne";
$text['label-local']['sv-se'] = "Lokal";
$text['label-local']['uk'] = "Локальний";
$text['label-local']['de-at'] = "Lokal";
$text['label-local']['he'] = "מקומי";
$text['label-inbound']['en-us'] = "Inbound";
$text['label-inbound']['es-cl'] = "Entrada";
$text['label-inbound']['pt-pt'] = "Entrada";
$text['label-inbound']['fr-fr'] = "Entrant";
$text['label-inbound']['pt-br'] = "Entrada";
$text['label-inbound']['pl'] = "Przychodzące";
$text['label-inbound']['sv-se'] = "Inkommande";
$text['label-inbound']['uk'] = "Вихідний";
$text['label-inbound']['de-at'] = "Eingehend";
$text['label-inbound']['he'] = "";
$text['label-item']['en-us'] = "Item";
$text['label-item']['es-cl'] = "Ítem";
$text['label-item']['pt-pt'] = "Item";
$text['label-item']['fr-fr'] = "Article";
$text['label-item']['pt-br'] = "Item";
$text['label-item']['pl'] = "Pozycja";
$text['label-item']['he'] = "פריט";
$text['label-item']['uk'] = "пункт";
$text['label-item']['sv-se'] = "Punkt";
$text['label-item']['de-at'] = "Artikel";
$text['label-item']['ro'] = "Articol";
$text['label-item']['fa'] = "";
$text['label-item']['ar-eg'] = "بند";
$text['label-gateways']['en-us'] = "Gateways";
$text['label-gateways']['es-cl'] = "Pasarelas";
$text['label-gateways']['pt-pt'] = "Gateways";
$text['label-gateways']['fr-fr'] = "Passerelles";
$text['label-gateways']['pt-br'] = "Gateways";
$text['label-gateways']['pl'] = "Bramy wyjściowe (gateways)";
$text['label-gateways']['uk'] = "Шлюзи";
$text['label-gateways']['sv-se'] = "Gateways";
$text['label-gateways']['ro'] = "";
$text['label-gateways']['de-at'] = "Gateways";
$text['label-gateways']['ar-eg'] = "البوابات";
$text['label-gateways']['he'] = "שערים";
$text['label-followme']['en-us'] = "Follow Me";
$text['label-followme']['es-cl'] = "Sígueme";
$text['label-followme']['pt-pt'] = "Segue-me";
@ -322,6 +622,43 @@ $text['label-followme']['ro'] = "Urmează-mă";
$text['label-followme']['fa'] = "";
$text['label-followme']['ar-eg'] = "خدمة اتبعني";
$text['label-feature']['en-us'] = "Feature";
$text['label-feature']['es-cl'] = "Característica";
$text['label-feature']['pt-pt'] = "Característica";
$text['label-feature']['fr-fr'] = "Fonctionnalité";
$text['label-feature']['pt-br'] = "Característica";
$text['label-feature']['pl'] = "Cecha";
$text['label-feature']['uk'] = "особливість";
$text['label-feature']['sv-se'] = "Särdrag";
$text['label-feature']['ro'] = "trăsătură";
$text['label-feature']['de-at'] = "Feature";
$text['label-feature']['ar-eg'] = "ميزة";
$text['label-feature']['he'] = "מאפיין";
$text['label-failed']['en-us'] = "Failed";
$text['label-failed']['es-cl'] = "Fracasado";
$text['label-failed']['pt-pt'] = "Fracassado";
$text['label-failed']['fr-fr'] = "Manqué";
$text['label-failed']['pt-br'] = "Fracassado";
$text['label-failed']['pl'] = "Nie powiodło się";
$text['label-failed']['sv-se'] = "Misslyckad";
$text['label-failed']['uk'] = "";
$text['label-failed']['de-at'] = "Fehlgeschlagen";
$text['label-failed']['he'] = "נכשל";
$text['label-extensions']['en-us'] = "Extensions";
$text['label-extensions']['es-cl'] = "Extensiones";
$text['label-extensions']['pt-pt'] = "Extensões";
$text['label-extensions']['fr-fr'] = "Extensions";
$text['label-extensions']['pt-br'] = "Extensões";
$text['label-extensions']['pl'] = "Numery wewnętrzne";
$text['label-extensions']['uk'] = "Розширення";
$text['label-extensions']['sv-se'] = "Anknytningar";
$text['label-extensions']['ro'] = "Extensii";
$text['label-extensions']['de-at'] = "Nebenstellen";
$text['label-extensions']['ar-eg'] = "الأرقام الداخلية";
$text['label-extensions']['he'] = "שלוחות";
$text['label-extension']['en-us'] = "Extension";
$text['label-extension']['es-cl'] = "Extensión";
$text['label-extension']['pt-pt'] = "Extensão";
@ -350,6 +687,30 @@ $text['label-email_address']['ro'] = "Adresă email";
$text['label-email_address']['fa'] = "";
$text['label-email_address']['ar-eg'] = "البريد الإلكتروني";
$text['label-domains']['en-us'] = "Domains";
$text['label-domains']['es-cl'] = "Dominios";
$text['label-domains']['pt-pt'] = "Domínios";
$text['label-domains']['fr-fr'] = "Domaines";
$text['label-domains']['pt-br'] = "Dominios";
$text['label-domains']['pl'] = "Domeny";
$text['label-domains']['sv-se'] = "Domäner";
$text['label-domains']['uk'] = "Домени";
$text['label-domains']['de-at'] = "Domains";
$text['label-domain_limits']['en-us'] = "Domain Limits";
$text['label-domain_limits']['es-cl'] = "Límites de dominio";
$text['label-domain_limits']['pt-pt'] = "Limites de domínio";
$text['label-domain_limits']['fr-fr'] = "Limites de domaine";
$text['label-domain_limits']['pt-br'] = "Limites de domínio";
$text['label-domain_limits']['pl'] = "Granice domen";
$text['label-domain_limits']['he'] = "מגבלת הדומיין";
$text['label-domain_limits']['uk'] = "обмеження домену";
$text['label-domain_limits']['sv-se'] = "domän Gränser";
$text['label-domain_limits']['de-at'] = "Domain Limits";
$text['label-domain_limits']['ro'] = "Limite de domeniu";
$text['label-domain_limits']['fa'] = "";
$text['label-domain_limits']['ar-eg'] = "حدود نطاق";
$text['label-domain']['en-us'] = "Domain";
$text['label-domain']['es-cl'] = "Dominio";
$text['label-domain']['pt-pt'] = "Domínio";
@ -378,6 +739,85 @@ $text['label-dnd']['ro'] = "Nu deranjați";
$text['label-dnd']['fa'] = "";
$text['label-dnd']['ar-eg'] = "عدم الازعاج";
$text['label-disk_usage']['en-us'] = "Disk Usage";
$text['label-disk_usage']['es-cl'] = "Uso del disco";
$text['label-disk_usage']['pt-pt'] = "Uso de disco";
$text['label-disk_usage']['fr-fr'] = "Utilisation du disque";
$text['label-disk_usage']['pt-br'] = "Uso de disco";
$text['label-disk_usage']['pl'] = "Użycie dysku";
$text['label-disk_usage']['he'] = "שימוש בדיסק";
$text['label-disk_usage']['uk'] = "Використання диска";
$text['label-disk_usage']['sv-se'] = "Drive användning";
$text['label-disk_usage']['de-at'] = "Festplattennutzung";
$text['label-disk_usage']['ro'] = "utilizare disc";
$text['label-disk_usage']['fa'] = "";
$text['label-disk_usage']['ar-eg'] = "إستخدام القرص";
$text['label-disabled']['en-us'] = "Disabled";
$text['label-disabled']['es-cl'] = "Discapacitado";
$text['label-disabled']['pt-pt'] = "Inválido";
$text['label-disabled']['fr-fr'] = "Non Permis";
$text['label-disabled']['pt-br'] = "Inválido";
$text['label-disabled']['pl'] = "Wyłączony";
$text['label-disabled']['sv-se'] = "Inaktiverad";
$text['label-disabled']['uk'] = "Відключено";
$text['label-disabled']['de-at'] = "Ausgeschaltet";
$text['label-devices']['en-us'] = "Devices";
$text['label-devices']['es-cl'] = "Dispositivos";
$text['label-devices']['pt-pt'] = "Dispositivos";
$text['label-devices']['fr-fr'] = "Equipements";
$text['label-devices']['pt-br'] = "Dispositivos";
$text['label-devices']['pl'] = "Urządzenia";
$text['label-devices']['uk'] = "Пристрої";
$text['label-devices']['sv-se'] = "Enheter";
$text['label-devices']['ro'] = "Dispozitive";
$text['label-devices']['de-at'] = "Geräte";
$text['label-devices']['ar-eg'] = "الأجهزة";
$text['label-devices']['he'] = "התקנים";
$text['label-destinations']['en-us'] = "Destinations";
$text['label-destinations']['es-cl'] = "Destinos";
$text['label-destinations']['pt-pt'] = "Destinos";
$text['label-destinations']['fr-fr'] = "Destinations";
$text['label-destinations']['pt-br'] = "Destinos";
$text['label-destinations']['pl'] = "Destynacje";
$text['label-destinations']['sv-se'] = "Destinationer";
$text['label-destinations']['uk'] = "Номери";
$text['label-destinations']['ro'] = "Destinații";
$text['label-destinations']['de-at'] = "Kopfnummern";
$text['label-destinations']['fa'] = "";
$text['label-destinations']['ar-eg'] = "جهات الأتصال";
$text['label-destinations']['he'] = "יעדים";
$text['label-date_time']['en-us'] = "Date/Time";
$text['label-date_time']['es-cl'] = "Fecha y hora";
$text['label-date_time']['pt-pt'] = "Data hora";
$text['label-date_time']['fr-fr'] = "Date / Heure";
$text['label-date_time']['pt-br'] = "Data hora";
$text['label-date_time']['pl'] = "Data Godzina";
$text['label-date_time']['sv-se'] = "Datum Tid";
$text['label-date_time']['uk'] = "Дата, час";
$text['label-date_time']['ro'] = "Data / Ora";
$text['label-date_time']['de-at'] = "Terminzeit";
$text['label-date_time']['fa'] = "";
$text['label-date_time']['ar-eg'] = "تاريخ / وقت";
$text['label-date_time']['he'] = "תאריך שעה";
$text['label-database_connections']['en-us'] = "DB Connections";
$text['label-database_connections']['es-cl'] = "Conexiones de base de datos";
$text['label-database_connections']['pt-pt'] = "Conexões de banco de dados";
$text['label-database_connections']['fr-fr'] = "Connexions de base de données";
$text['label-database_connections']['pt-br'] = "Conexões de banco de dados";
$text['label-database_connections']['pl'] = "Połączenia z bazami danych";
$text['label-database_connections']['sv-se'] = "databasanslutningar ";
$text['label-database_connections']['uk'] = "з'єднання бази даних";
$text['label-database_connections']['ro'] = "Baza de date Conexiuni";
$text['label-database_connections']['de-at'] = "Datenbankverbindungen ";
$text['label-database_connections']['fa'] = "";
$text['label-database_connections']['ar-eg'] = "اتصالات قاعدة البيانات";
$text['label-database_connections']['he'] = "התחברויות למסד נתונים";
$text['label-confirm-password']['en-us'] = "Confirm Password";
$text['label-confirm-password']['es-cl'] = "Confirmar Contraseña";
$text['label-confirm-password']['pt-pt'] = "Confirmar Palavra-Passe";
@ -392,6 +832,55 @@ $text['label-confirm-password']['ro'] = "Confirmare parolă";
$text['label-confirm-password']['fa'] = "";
$text['label-confirm-password']['ar-eg'] = "تاكيد كلمة السر";
$text['label-cid_number']['en-us'] = "Number";
$text['label-cid_number']['es-cl'] = "Número";
$text['label-cid_number']['pt-pt'] = "Número";
$text['label-cid_number']['fr-fr'] = "Numéro";
$text['label-cid_number']['pt-br'] = "Número";
$text['label-cid_number']['pl'] = "Numer";
$text['label-cid_number']['sv-se'] = "Nummer";
$text['label-cid_number']['uk'] = "Номер";
$text['label-cid_number']['de-at'] = "Nummer";
$text['label-cid_number']['he'] = "מספר";
$text['label-cid_name']['en-us'] = "Name";
$text['label-cid_name']['es-cl'] = "Nombre";
$text['label-cid_name']['pt-pt'] = "Nome";
$text['label-cid_name']['fr-fr'] = "Nom";
$text['label-cid_name']['pt-br'] = "Nome";
$text['label-cid_name']['pl'] = "Nazwa";
$text['label-cid_name']['sv-se'] = "Namn";
$text['label-cid_name']['uk'] = "Назва";
$text['label-cid_name']['de-at'] = "Name";
$text['label-cid_name']['he'] = "שם";
$text['label-channels']['en-us'] = "Channels";
$text['label-channels']['es-cl'] = "Canales";
$text['label-channels']['pt-pt'] = "Canais";
$text['label-channels']['fr-fr'] = "Canaux";
$text['label-channels']['pt-br'] = "Canais";
$text['label-channels']['pl'] = "Kanały";
$text['label-channels']['uk'] = "Канали";
$text['label-channels']['sv-se'] = "Kanaler";
$text['label-channels']['ro'] = "Canale";
$text['label-channels']['de-at'] = "Kanäle";
$text['label-channels']['ar-eg'] = "";
$text['label-channels']['he'] = "ערוצים";
$text['label-cancelled']['en-us'] = "Cancelled";
$text['label-cancelled']['es-cl'] = "Cancelado";
$text['label-cancelled']['pt-pt'] = "Cancelado";
$text['label-cancelled']['fr-fr'] = "Annulé";
$text['label-cancelled']['pt-br'] = "Cancelado";
$text['label-cancelled']['pl'] = "Odwołany";
$text['label-cancelled']['he'] = "מבוטל";
$text['label-cancelled']['uk'] = "скасовано";
$text['label-cancelled']['sv-se'] = "Avbryts";
$text['label-cancelled']['de-at'] = "Abgebrochen";
$text['label-cancelled']['ro'] = "Anulat";
$text['label-cancelled']['fa'] = "";
$text['label-cancelled']['ar-eg'] = "ألغيت";
$text['label-cancel']['en-us'] = "Cancel";
$text['label-cancel']['es-cl'] = "Cancelar";
$text['label-cancel']['pt-pt'] = "Cancelar";
@ -420,6 +909,20 @@ $text['label-callforward']['ro'] = "Redirecționare apel";
$text['label-callforward']['fa'] = "";
$text['label-callforward']['ar-eg'] = "تحويل المكالمات";
$text['label-answered']['en-us'] = "Answered";
$text['label-answered']['es-cl'] = "Respondido";
$text['label-answered']['pt-pt'] = "Atendidas";
$text['label-answered']['fr-fr'] = "Répondu";
$text['label-answered']['pt-br'] = "Atendidas";
$text['label-answered']['pl'] = "Odebrano";
$text['label-answered']['he'] = "ענה";
$text['label-answered']['uk'] = "відповів";
$text['label-answered']['sv-se'] = "Besvarad";
$text['label-answered']['de-at'] = "Angenommen";
$text['label-answered']['ro'] = "Răspuns";
$text['label-answered']['fa'] = "";
$text['label-answered']['ar-eg'] = "تم الرد";
$text['header-user_dashboard']['en-us'] = "User Dashboard";
$text['header-user_dashboard']['es-cl'] = "Dashboard Usuario";
$text['header-user_dashboard']['pt-pt'] = "Painel de Controle do Usuário";

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
@ -73,21 +73,854 @@
echo " ".$text['description-user_dashboard'];
echo " </td>\n";
echo " <td valign='top' style='text-align: right; white-space: nowrap;'>\n";
echo " <input type='button' class='btn' value='".$_SESSION["username"]."' onclick=\"document.location.href='".PROJECT_PATH."/core/user_settings/user_edit.php';\">";
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/voicemails/voicemail_messages.php")) {
echo " <input type='button' class='btn' value='".$text['button-voicemail']."' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php';\">";
}
echo " ".$text['label-welcome']." <a href='".PROJECT_PATH."/core/user_settings/user_edit.php'>".$_SESSION["username"]."</a>";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br /><br />";
echo "<br />";
//display login message
if (if_group("superadmin") && $_SESSION['login']['message']['text'] != '') {
echo "<br /><br /><br />";
echo "<div class='login_message' width='100%'><b>".$text['login-message_attention']."</b>&nbsp;&nbsp;".$_SESSION['login']['message']['text']."&nbsp;&nbsp;(<a href='?msg=dismiss'>".$text['login-message_dismiss']."</a>)</div>";
}
//determine hud blocks
if (is_array($_SESSION['dashboard']) && sizeof($_SESSION['dashboard']) > 0) {
foreach ($_SESSION['groups'] as $index => $group) {
$group_name = $group['group_name'];
if (is_array($_SESSION['dashboard'][$group_name]) && sizeof($_SESSION['dashboard'][$group_name]) > 0) {
foreach ($_SESSION['dashboard'][$group_name] as $hud_block) {
$hud_blocks[] = strtolower($hud_block);
}
}
}
}
if (is_array($hud_blocks) && sizeof($hud_blocks) > 0) {
$selected_blocks = array_unique($hud_blocks);
sort($selected_blocks, SORT_NATURAL);
}
unset($group, $group_name, $index, $hud_block, $hud_blocks);
//collect stats for counts and limits
if (in_array('counts', $selected_blocks) || in_array('limits', $selected_blocks)) {
//domains
if (permission_exists('domain_view')) {
$stats['system']['domains']['total'] = sizeof($_SESSION['domains']);
$stats['system']['domains']['disabled'] = 0;
foreach ($_SESSION['domains'] as $domain) {
$stats['system']['domains']['disabled'] += ($domain['domain_enabled'] != 'true') ? 1 : 0;
}
}
//devices
if (permission_exists('device_view')) {
$stats['system']['devices']['total'] = 0;
$stats['system']['devices']['disabled'] = 0;
$stats['domain']['devices']['total'] = 0;
$stats['domain']['devices']['disabled'] = 0;
$sql = "select domain_uuid, device_provision_enabled from v_devices";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['system']['devices']['total'] = count($result);
foreach ($result as $row) {
$stats['system']['devices']['disabled'] += ($row['device_provision_enabled'] != 'true') ? 1 : 0;
if ($row['domain_uuid'] == $_SESSION['domain_uuid']) {
$stats['domain']['devices']['total']++;
$stats['domain']['devices']['disabled'] += ($row['device_provision_enabled'] != 'true') ? 1 : 0;
}
}
unset ($sql, $prep_statement, $result);
}
//extensions
if (permission_exists('extension_view')) {
$stats['system']['extensions']['total'] = 0;
$stats['system']['extensions']['disabled'] = 0;
$stats['domain']['extensions']['total'] = 0;
$stats['domain']['extensions']['disabled'] = 0;
$sql = "select domain_uuid, enabled from v_extensions";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['system']['extensions']['total'] = count($result);
foreach ($result as $row) {
$stats['system']['extensions']['disabled'] += ($row['enabled'] != 'true') ? 1 : 0;
if ($row['domain_uuid'] == $_SESSION['domain_uuid']) {
$stats['domain']['extensions']['total']++;
$stats['domain']['extensions']['disabled'] += ($row['enabled'] != 'true') ? 1 : 0;
}
}
unset ($sql, $prep_statement, $result);
}
//gateways
if (permission_exists('gateway_view')) {
$stats['system']['gateways']['total'] = 0;
$stats['system']['gateways']['disabled'] = 0;
$stats['domain']['gateways']['total'] = 0;
$stats['domain']['gateways']['disabled'] = 0;
$sql = "select domain_uuid, enabled from v_gateways";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['system']['gateways']['total'] = count($result);
foreach ($result as $row) {
$stats['system']['gateways']['disabled'] += ($row['enabled'] != 'true') ? 1 : 0;
if ($row['domain_uuid'] == $_SESSION['domain_uuid']) {
$stats['domain']['gateways']['total']++;
$stats['domain']['gateways']['disabled'] += ($row['enabled'] != 'true') ? 1 : 0;
}
}
unset ($sql, $prep_statement, $result);
}
//users
if (permission_exists('user_view') || if_group("superadmin")) {
$stats['system']['users']['total'] = 0;
$stats['system']['users']['disabled'] = 0;
$stats['domain']['users']['total'] = 0;
$stats['domain']['users']['disabled'] = 0;
$sql = "select domain_uuid, user_enabled from v_users";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['system']['users']['total'] = count($result);
foreach ($result as $row) {
$stats['system']['users']['disabled'] += ($row['user_enabled'] != 'true') ? 1 : 0;
if ($row['domain_uuid'] == $_SESSION['domain_uuid']) {
$stats['domain']['users']['total']++;
$stats['domain']['users']['disabled'] += ($row['user_enabled'] != 'true') ? 1 : 0;
}
}
unset ($sql, $prep_statement, $result);
}
//destinations
if (permission_exists('destination_view')) {
$stats['system']['destinations']['total'] = 0;
$stats['system']['destinations']['disabled'] = 0;
$stats['domain']['destinations']['total'] = 0;
$stats['domain']['destinations']['disabled'] = 0;
$sql = "select domain_uuid, destination_enabled from v_destinations";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['system']['destinations']['total'] = count($result);
foreach ($result as $row) {
$stats['system']['destinations']['disabled'] += ($row['destination_enabled'] != 'true') ? 1 : 0;
if ($row['domain_uuid'] == $_SESSION['domain_uuid']) {
$stats['domain']['destinations']['total']++;
$stats['domain']['destinations']['disabled'] += ($row['destination_enabled'] != 'true') ? 1 : 0;
}
}
unset ($sql, $prep_statement, $result);
}
//call center queues
if (permission_exists('call_center_active_view')) {
$sql = "select domain_uuid from v_call_center_queues where domain_uuid = '".$_SESSION['domain_uuid']."'";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['domain']['call_center_queues']['total'] = count($result);
unset ($sql, $prep_statement, $result);
}
//ivr menus
if (permission_exists('ivr_menu_view')) {
$stats['domain']['ivr_menus']['disabled'] = 0;
$sql = "select domain_uuid, ivr_menu_enabled from v_ivr_menus where domain_uuid = '".$_SESSION['domain_uuid']."'";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['domain']['ivr_menus']['total'] = count($result);
foreach ($result as $row) {
$stats['domain']['ivr_menus']['disabled'] += ($row['ivr_menu_enabled'] != 'true') ? 1 : 0;
}
unset ($sql, $prep_statement, $result);
}
//ring groups
if (permission_exists('ring_group_view')) {
$stats['domain']['ring_groups']['disabled'] = 0;
$sql = "select domain_uuid, ring_group_enabled from v_ring_groups where domain_uuid = '".$_SESSION['domain_uuid']."'";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$stats['domain']['ring_groups']['total'] = count($result);
foreach ($result as $row) {
$stats['domain']['ring_groups']['disabled'] += ($row['ring_group_enabled'] != 'true') ? 1 : 0;
}
unset ($sql, $prep_statement, $result);
}
}
//build hud block html
$n = 0;
define('TIME_24HR', 1); //set 24hr or 12hr clock
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/"; // used for missed and recent calls
//voicemail
if (in_array('voicemail', $selected_blocks) && permission_exists('voicemail_message_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/voicemails/")) {
$hud[$n]['title'] = $text['label-voicemail'];
//required class
require_once "app/voicemails/resources/classes/voicemail.php";
//get the voicemail
$vm = new voicemail;
$vm->db = $db;
$vm->domain_uuid = $_SESSION['domain_uuid'];
$vm->voicemail_uuid = $voicemail_uuid;
$vm->order_by = $order_by;
$vm->order = $order;
$voicemails = $vm->messages();
//sum total and new
$messages['total'] = 0;
$messages['new'] = 0;
if (sizeof($voicemails) > 0) {
foreach($voicemails as $field) {
$messages[$field['voicemail_uuid']]['ext'] = $field['voicemail_id'];
$messages[$field['voicemail_uuid']]['total'] = 0;
$messages[$field['voicemail_uuid']]['new'] = 0;
foreach($field['messages'] as &$row) {
if ($row['message_status'] == '') {
$messages[$field['voicemail_uuid']]['new']++;
$messages['new']++;
}
$messages[$field['voicemail_uuid']]['total']++;
$messages['total']++;
}
}
}
$hud[$n]['html'] .= "<span class='hud_voicemail_total' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php?id=".$voicemail_uuid."'\"><sup class='hud_voicemail_new'>&nbsp;</sup>".$messages['total']."<sup class='hud_voicemail_new'>".$messages['new']."</sup></span>\n";
$hud[$n]['html'] .= "<br><br>";
if (sizeof($voicemails) > 0) {
$hud[$n]['html'] .= "<table class='tr_hover' cellpadding='2' cellspacing='0' border='0' width='100%'>";
$hud[$n]['html'] .= "<tr>";
$hud[$n]['html'] .= " <th class='hud_heading' width='50%'>".$text['label-voicemail']."</th>";
$hud[$n]['html'] .= " <th class='hud_heading' style='text-align: center;' width='50%'>".$text['label-new']."</th>";
$hud[$n]['html'] .= " <th class='hud_heading' style='text-align: center;'>".$text['label-total']."</th>";
$hud[$n]['html'] .= "</tr>";
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
foreach ($messages as $voicemail_uuid => $row) {
if (is_uuid($voicemail_uuid)) {
$tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php?id=".$voicemail_uuid."'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>";
$hud[$n]['html'] .= " <td class='".$row_style[$c]." hud_text'><a href='javascript:void(0);'>".$row['ext']."</td>";
$hud[$n]['html'] .= " <td class='".$row_style[$c]." hud_text' style='text-align: center;'>".$row['new']."</td>";
$hud[$n]['html'] .= " <td class='".$row_style[$c]." hud_text' style='text-align: center;'>".$row['total']."</td>";
$hud[$n]['html'] .= "</tr>";
$c = ($c) ? 0 : 1;
}
}
$hud[$n]['html'] .= "</table>";
}
else {
$hud[$n]['html'] .= "<center><br><br>".$text['label-no_voicemail_assigned']."</center>";
}
$n++;
}
//missed calls
if (in_array('missed', $selected_blocks) && permission_exists('xml_cdr_view') && is_array($_SESSION['user']['extension']) && sizeof($_SESSION['user']['extension']) > 0) {
$hud[$n]['title'] = $text['label-missed_calls'];
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
}
//if also viewing system status, show more recent calls (more room avaialble)
$missed_limit = (in_array('system', $selected_blocks)) ? 8 : 5;
$sql = "
select
direction,
start_stamp,
start_epoch,
caller_id_name,
caller_id_number,
answer_stamp
from
v_xml_cdr
where
domain_uuid = '".$_SESSION['domain_uuid']."'
and (
direction = 'inbound'
or direction = 'local'
)
and bridge_uuid is null
and destination_number in ('".implode("','",$assigned_extensions)."')
order by
start_epoch desc
limit ".$missed_limit."
offset 0";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$hud[$n]['html'] .= "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0' style='margin-bottom: 8px;'>\n";
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<th class='hud_heading'>&nbsp;</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-cid_name']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-cid_number']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading'>".$text['label-missed']."</th>\n";
$hud[$n]['html'] .= "</tr>\n";
if ($result_count > 0) {
$theme_cdr_images_exist = (
file_exists($theme_image_path."icon_cdr_inbound_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_inbound_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_local_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_local_cancelled.png")
) ? true : false;
foreach($result as $index => $row) {
$tmp_year = date("Y", strtotime($row['start_stamp']));
$tmp_month = date("M", strtotime($row['start_stamp']));
$tmp_day = date("d", strtotime($row['start_stamp']));
$tmp_start_epoch = (defined('TIME_24HR') && TIME_24HR == 1) ? date("j/n H:i", $row['start_epoch']) : date("j/n h:ia", $row['start_epoch']);
$tr_link = "onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\"";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]."' style='cursor: help;'>\n";
if ($theme_cdr_images_exist) {
$call_result = ($row['answer_stamp'] != '') ? 'voicemail' : 'cancelled';
$hud[$n]['html'] .= "<img src='".PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
}
$hud[$n]['html'] .= "</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$row['caller_id_name']."&nbsp;</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' nowrap='nowrap'><a href='javascript:void(0)'>".((is_numeric($row['caller_id_number'])) ? format_phone($row['caller_id_number']) : $row['caller_id_number'])."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
unset($sql, $result, $row_count);
}
$hud[$n]['html'] .= "</table>\n";
$hud[$n]['html'] .= "<span style='display: block; margin-bottom: 8px;'><a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'>".$text['label-view_all']."</a></span>\n";
$n++;
}
//recent calls
if (in_array('recent', $selected_blocks) && permission_exists('xml_cdr_view') && is_array($_SESSION['user']['extension']) && sizeof($_SESSION['user']['extension']) > 0) {
$hud[$n]['title'] = $text['label-recent_calls'];
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
}
//if also viewing system status, show more recent calls (more room avaialble)
$recent_limit = (in_array('system', $selected_blocks)) ? 8 : 5;
$sql = "
select
direction,
start_stamp,
start_epoch,
caller_id_name,
caller_id_number,
destination_number,
answer_stamp,
bridge_uuid,
sip_hangup_disposition
from
v_xml_cdr
where
domain_uuid = '".$_SESSION['domain_uuid']."'
and (";
$x = 0;
foreach ($assigned_extensions as $assigned_extension) {
$sql .= "caller_id_number like '".$assigned_extension."' ";
$sql .= "or destination_number like '".$assigned_extension."' ";
$sql .= "or destination_number like '*99".$assigned_extension."' ";
if (++$x < sizeof($assigned_extensions)) { $sql .= "or "; }
}
$sql .= "
)
order by
start_epoch desc
limit ".$recent_limit."
offset 0";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$hud[$n]['html'] .= "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0' style='margin-bottom: 8px;'>\n";
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<th class='hud_heading'>&nbsp;</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-cid_name']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-cid_number']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading'>".$text['label-date_time']."</th>\n";
$hud[$n]['html'] .= "</tr>\n";
if ($result_count > 0) {
$theme_cdr_images_exist = (
file_exists($theme_image_path."icon_cdr_inbound_answered.png") &&
file_exists($theme_image_path."icon_cdr_inbound_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_inbound_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_inbound_failed.png") &&
file_exists($theme_image_path."icon_cdr_outbound_answered.png") &&
file_exists($theme_image_path."icon_cdr_outbound_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_outbound_failed.png") &&
file_exists($theme_image_path."icon_cdr_local_answered.png") &&
file_exists($theme_image_path."icon_cdr_local_voicemail.png") &&
file_exists($theme_image_path."icon_cdr_local_cancelled.png") &&
file_exists($theme_image_path."icon_cdr_local_failed.png")
) ? true : false;
foreach($result as $index => $row) {
$tmp_year = date("Y", strtotime($row['start_stamp']));
$tmp_month = date("M", strtotime($row['start_stamp']));
$tmp_day = date("d", strtotime($row['start_stamp']));
$tmp_start_epoch = (defined('TIME_24HR') && TIME_24HR == 1) ? date("j/n H:i", $row['start_epoch']) : date("j/n h:ia", $row['start_epoch']);
$tr_link = "onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\"";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
//determine call result and appropriate icon
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]."' style='cursor: help;'>\n";
if ($theme_cdr_images_exist) {
if ($row['direction'] == 'inbound' || $row['direction'] == 'local') {
if ($row['answer_stamp'] != '' && $row['bridge_uuid'] != '') { $call_result = 'answered'; }
else if ($row['answer_stamp'] != '' && $row['bridge_uuid'] == '') { $call_result = 'voicemail'; }
else if ($row['answer_stamp'] == '' && $row['bridge_uuid'] == '' && $row['sip_hangup_disposition'] != 'send_refuse') { $call_result = 'cancelled'; }
else { $call_result = 'failed'; }
}
else if ($row['direction'] == 'outbound') {
if ($row['answer_stamp'] != '' && $row['bridge_uuid'] != '') { $call_result = 'answered'; }
else if ($row['answer_stamp'] == '' && $row['bridge_uuid'] != '') { $call_result = 'cancelled'; }
else { $call_result = 'failed'; }
}
$hud[$n]['html'] .= "<img src='".PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
}
$hud[$n]['html'] .= "</td>\n";
//determine name
$cdr_name = ($row['direction'] == 'inbound' || ($row['direction'] == 'local' && in_array($row['destination_number'], $assigned_extensions))) ? $row['caller_id_name'] : "&nbsp;";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$cdr_name."</td>\n";
//determine number
if ($row['direction'] == 'inbound' || ($row['direction'] == 'local' && in_array($row['destination_number'], $assigned_extensions))) {
$cdr_number = (is_numeric($row['caller_id_number'])) ? format_phone($row['caller_id_number']) : $row['caller_id_number'];
}
else if ($row['direction'] == 'outbound' || ($row['direction'] == 'local' && in_array($row['caller_id_number'], $assigned_extensions))) {
$cdr_number = (is_numeric($row['destination_number'])) ? format_phone($row['destination_number']) : $row['destination_number'];
}
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' nowrap='nowrap'><a href='javascript:void(0)'>".$cdr_number."</a></td>\n";
//date/time
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
unset($cdr_name, $cdr_number);
$c = ($c) ? 0 : 1;
}
unset($sql, $result, $row_count);
}
$hud[$n]['html'] .= "</table>\n";
$hud[$n]['html'] .= "<span style='display: block; margin-bottom: 8px;'><a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php'>".$text['label-view_all']."</a></span>\n";
$n++;
}
//system counts
if (in_array('counts', $selected_blocks) && permission_exists('xml_cdr_view')) {
$hud[$n]['title'] = $text['label-system_counts'];
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$hud[$n]['html'] .= "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-item']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%' style='text-align: center;'>".$text['label-disabled']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' style='text-align: center;'>".$text['label-total']."</th>\n";
$hud[$n]['html'] .= "</tr>\n";
//domains
if (permission_exists('domain_view')) {
$tr_link = "href='".PROJECT_PATH."/core/domain_settings/domains.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-domains']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['domains']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['domains']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//devices
if (permission_exists('device_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/devices/")) {
$tr_link = "href='".PROJECT_PATH."/app/devices/devices.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-devices']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['devices']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['devices']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//extensions
if (permission_exists('extension_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/extensions/")) {
$tr_link = "href='".PROJECT_PATH."/app/extensions/extensions.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-extensions']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['extensions']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['extensions']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//gateways
if (permission_exists('gateway_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/gateways/")) {
$tr_link = "href='".PROJECT_PATH."/app/gateways/gateways.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-gateways']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['gateways']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['gateways']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//users
if ((permission_exists('user_view') || if_group("superadmin")) && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/core/users/")) {
$tr_link = "href='".PROJECT_PATH."/core/users/index.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-users']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['users']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['users']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//destinations
if (permission_exists('destination_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/destinations/")) {
$tr_link = "href='".PROJECT_PATH."/app/destinations/destinations.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-destinations']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['destinations']['disabled']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['system']['destinations']['total']."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
$hud[$n]['html'] .= "</table>\n";
$n++;
}
//domain limits
if (in_array('limits', $selected_blocks) && is_array($_SESSION['limit']) && sizeof($_SESSION['limit']) > 0) {
$hud[$n]['title'] = $text['label-domain_limits'];
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$hud[$n]['html'] .= "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%'>".$text['label-feature']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='50%' style='text-align: center;'>".$text['label-used']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' style='text-align: center;'>".$text['label-total']."</th>\n";
$hud[$n]['html'] .= "</tr>\n";
foreach ($_SESSION['limit'] as $category => $value) {
$category_raw = $category;
$category = str_replace('_', ' ', $category);
$category = ucwords($category);
$category = str_replace('Ivr', 'IVR', $category);
$limit = $value['numeric'];
switch ($category_raw) {
case 'users':
if (!permission_exists('user_view')) { continue 2; }
$url = '/core/users/index.php';
break;
case 'call_center_queues':
if (!permission_exists('call_center_active_view')) { continue 2; }
$url = '/app/call_centers/call_center_queues.php';
break;
case 'destinations':
if (!permission_exists('destination_view')) { continue 2; }
$url = '/app/destinations/destinations.php';
break;
case 'devices':
if (!permission_exists('device_view')) { continue 2; }
$url = '/app/devices/devices.php';
break;
case 'extensions':
if (!permission_exists('extension_view')) { continue 2; }
$url = '/app/extensions/extensions.php';
break;
case 'gateways':
if (!permission_exists('gateway_view')) { continue 2; }
$url = '/app/gateways/gateways.php';
break;
case 'ivr_menus':
if (!permission_exists('ivr_menu_view')) { continue 2; }
$url = '/app/ivr_menus/ivr_menus.php';
break;
case 'ring_groups':
if (!permission_exists('ring_group_view')) { continue 2; }
$url = '/app/ring_groups/ring_groups.php';
break;
}
$tr_link = "href='".PROJECT_PATH.$url."'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$category."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$stats['domain'][$category_raw]['total']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: center;'>".$limit."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
$hud[$n]['html'] .= "</table>\n";
$n++;
}
//system status
if (in_array('system', $selected_blocks)) {
$hud[$n]['title'] = $text['label-system_status'];
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$hud[$n]['html'] .= "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<th class='hud_heading' width='100%'>".$text['label-item']."</th>\n";
$hud[$n]['html'] .= "<th class='hud_heading' style='text-align: right;'>".$text['label-value']."</th>\n";
$hud[$n]['html'] .= "</tr>\n";
//pbx version
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>FusionPBX</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".software_version()."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
//switch version
$switch_version = event_socket_request($fp, 'api version');
preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $switch_version, $matches);
$switch_version = $matches[1];
$switch_bits = $matches[2];
if ($switch_version != '' && $switch_bits != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-switch']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$switch_version." (".$switch_bits.")</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//switch uptime
$tmp = event_socket_request($fp, 'api status');
$tmp = explode("\n", $tmp);
$tmp = $tmp[0];
$tmp = explode(' ', $tmp);
$uptime = (($tmp[1]) ? $tmp[1].'y ' : null);
$uptime .= (($tmp[3]) ? $tmp[3].'d ' : null);
$uptime .= (($tmp[5]) ? $tmp[3].'h ' : null);
$uptime .= (($tmp[7]) ? $tmp[3].'m ' : null);
$uptime .= (($tmp[9]) ? $tmp[3].'s' : null);
if ($uptime != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-switch_uptime']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$uptime."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
}
//os uptime
if (stristr(PHP_OS, 'Linux')) {
unset($tmp);
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$tmp['y'] = floor($uptime/60/60/24/365);
$tmp['d'] = $uptime/60/60/24%365;
$tmp['h'] = $uptime/60/60%24;
$tmp['m'] = $uptime/60%60;
$tmp['s'] = $uptime%60;
$uptime = (($tmp['y'] != 0 && $tmp['y'] != '') ? $tmp['y'].'y ' : null);
$uptime .= (($tmp['d'] != 0 && $tmp['d'] != '') ? $tmp['d'].'d ' : null);
$uptime .= (($tmp['h'] != 0 && $tmp['h'] != '') ? $tmp['h'].'h ' : null);
$uptime .= (($tmp['m'] != 0 && $tmp['m'] != '') ? $tmp['m'].'m ' : null);
$uptime .= (($tmp['s'] != 0 && $tmp['s'] != '') ? $tmp['s'].'s' : null);
if ($uptime != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-system_uptime']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$uptime."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
}
//memory usage (for available memory, use "free | awk 'FNR == 3 {print $4/($3+$4)*100}'" instead)
if (stristr(PHP_OS, 'Linux')) {
$percent = round(shell_exec("free | awk 'FNR == 3 {print $3/($3+$4)*100}'"), 1).'%';
if ($percent != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-memory_usage']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$percent."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
}
//disk usage
if (stristr(PHP_OS, 'Linux')) {
$tmp = shell_exec("df /home");
$tmp = explode("\n", $tmp);
$tmp = preg_replace('!\s+!', ' ', $tmp[1]); // multiple > single space
$tmp = explode(' ', $tmp);
foreach ($tmp as $stat) {
if (substr_count($stat, '%') > 0) { $percent = $stat; break; }
}
if ($percent != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-disk_usage']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$percent."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
}
//cpu usage
if (stristr(PHP_OS, 'Linux')) {
$tmp = shell_exec("ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'");
$tmp = explode("\n", $tmp);
$tmp = preg_replace('!\s+!', ' ', $tmp[1]); // multiple > single space
$tmp = explode(' ', trim($tmp));
$cpu = $tmp[0];
if ($cpu != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-processor_usage']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$cpu."%</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
}
//db connections
switch ($db_type) {
case 'pgsql':
$sql = "select count(*) as connections from pg_stat_activity";
break;
case 'mysql':
$sql = "show status where `variable_name` = 'Threads_connected'";
break;
default:
unset($sql);
if ($db_path != '' && $dbfilename != '') {
$tmp = shell_exec("lsof ".realpath($db_path).'/'.$dbfilename);
$tmp = explode("\n", $tmp);
$connections = sizeof($tmp) - 1;
}
}
if ($sql != '') {
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetch(PDO::FETCH_NAMED);
$connections = $result['connections'];
unset ($sql, $prep_statement, $result);
}
if ($connections != '') {
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-database_connections']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$connections."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//channel count
if ($fp) {
$tmp = event_socket_request($fp, 'api show channels');
$tmp = explode("\n", $tmp);
$tmp = preg_replace('!\s+!', ' ', trim($tmp[3]));
$tmp = explode(' ', $tmp);
$tmp = $tmp[0];
$channels = (is_numeric($tmp)) ? $tmp : 0;
$hud[$n]['html'] .= "<tr>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-channels']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right; white-space: nowrap;'>".$channels."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
//registration count
if ($fp && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/registrations/")) {
$tmp = event_socket_request($fp, 'api sofia xmlstatus profile internal reg');
$registrations = substr_count($tmp, '<registration>');
$registrations = (is_numeric($registrations)) ? $registrations : 0;
$tr_link = "href='".PROJECT_PATH."/app/registrations/status_registrations.php'";
$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='border-bottom: none;'><a href='javascript:void(0);'>".$text['label-registrations']."</a></td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='border-bottom: none; text-align: right; white-space: nowrap;'>".$registrations."</td>\n";
$hud[$n]['html'] .= "</tr>\n";
$c = ($c) ? 0 : 1;
}
$hud[$n]['html'] .= "</table>\n";
$n++;
}
//output hud blocks
if (is_array($hud) && sizeof($hud) > 0) {
//javascript function: send_cmd
if ((in_array('missed', $selected_blocks) || in_array('recent', $selected_blocks)) && permission_exists('xml_cdr_view')) {
echo "<script type=\"text/javascript\">\n";
echo " function send_cmd(url) {\n";
echo " alert('call made');\n";
echo " /*";
echo " if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari\n";
echo " xmlhttp=new XMLHttpRequest();\n";
echo " }\n";
echo " else {// code for IE6, IE5\n";
echo " xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " }\n";
echo " xmlhttp.open(\"GET\",url,true);\n";
echo " xmlhttp.send(null);\n";
echo " document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;\n";
echo " */";
echo " }\n";
echo "</script>\n";
}
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' style='margin-bottom: 30px;'>\n";
echo "<tr>\n";
foreach ($hud as $index => $block) {
echo "<td class='hud_box' style='padding: 10px 1px 1px 1px; width: ".(round((100 / sizeof($hud)), 2))."%;'><b class='hud_title'>".$block['title']."</b><br><br>".$block['html']."</td>\n";
if ($index+1 < sizeof($hud)) { echo "<td style='white-space: nowrap;'>&nbsp;&nbsp;&nbsp;&nbsp;</td>"; }
}
echo "</tr>";
echo "</table>";
unset($hud);
}
//call routing
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/calls/calls.php")) {
if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) {
@ -109,7 +942,7 @@
//ring group forward
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/ring_groups/ring_group_forward.php")) {
if (permission_exists('ring_group_forward')) { //ring_group_forward
if (permission_exists('ring_group_forward')) {
$is_included = "true";
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
echo " <tr>\n";

View File

@ -439,12 +439,65 @@ table tr:last-child td:last-child {
DIV.login_message {
border: 1px solid #bae0ba;
background-color: #eeffee;
-webkit-border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 20px;
margin-bottom: 15px;
}
/* dashboard hud styles begin */
td.hud_box {
height: auto;
vertical-align: top;
padding: 15px;
background-color: #f5f7fa;
border: 1px solid #c6d4e8;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
text-align: center;
}
b.hud_title {
color: #a4aebf;
}
span.hud_voicemail_total {
cursor: pointer;
color: #004083;
font-size: 60px;
line-hight: 20px;
font-weight: bold;
}
span.hud_voicemail_total:hover {
opacity: 0.7;
}
sup.hud_voicemail_new {
font-weight: normal;
color: #03920a;
font-size: 30px;
line-hight: 10px;
}
th.hud_heading {
font-size: 11px;
font-weight: bold;
color: black;
text-align: left;
}
td.hud_text {
font-size: 11px;
color: black;
text-align: left;
}
/* dashboard hud styles end */
</style>
<script language="javascript" type="text/javascript" src="<?php echo PROJECT_PATH?>/resources/jquery/jquery-1.8.3.js"></script>

View File

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

View File

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 304 B

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

View File

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

View File

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 212 B

View File

@ -1009,6 +1009,7 @@ legend {
-moz-border-radius: 3px;
border-radius: 3px;
padding: 20px;
margin-bottom: 15px;
}
/* operator panel styles begin */
@ -1201,11 +1202,63 @@ legend {
/* operator panel styles end */
SPAN.playback_progress_bar {
background-color: #c43e42;
height: 1px;
display: inline-block;
}
SPAN.playback_progress_bar {
background-color: #c43e42;
height: 1px;
display: inline-block;
}
/* dashboard hud styles begin */
td.hud_box {
height: auto;
vertical-align: top;
padding: 15px;
background-color: #f5f7fa;
border: 1px solid #c6d4e8;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
text-align: center;
}
b.hud_title {
color: #a4aebf;
}
span.hud_voicemail_total {
cursor: pointer;
color: #004083;
font-size: 60px;
line-hight: 20px;
font-weight: bold;
}
span.hud_voicemail_total:hover {
opacity: 0.7;
}
sup.hud_voicemail_new {
font-weight: normal;
color: #03920a;
font-size: 30px;
line-hight: 10px;
}
th.hud_heading {
font-size: 11px;
font-weight: bold;
color: black;
text-align: left;
}
td.hud_text {
font-size: 11px;
color: black;
text-align: left;
}
/* dashboard hud styles end */
</style>

View File

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

View File

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

View File

@ -1012,6 +1012,7 @@ legend {
-moz-border-radius: 3px;
border-radius: 3px;
padding: 20px;
margin-bottom: 15px;
}
/* operator panel styles begin */
@ -1204,11 +1205,69 @@ legend {
/* operator panel styles end */
SPAN.playback_progress_bar {
background-color: #c43e42;
height: 1px;
display: inline-block;
}
SPAN.playback_progress_bar {
background-color: #c43e42;
height: 1px;
display: inline-block;
}
/* dashboard hud styles begin */
td.hud_box {
height: auto;
vertical-align: top;
padding: 15px;
border: 1px solid #c6d4e8;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
text-align: center;
background-color: #f5f7fa;
background-image: -ms-linear-gradient(left, #edf1f7 0%, #f9fbfe 30%, #f9fbfe 70%, #edf1f7 100%);
background-image: -moz-linear-gradient(left, #edf1f7 0%, #f9fbfe 30%, #f9fbfe 70%, #edf1f7 100%);
background-image: -o-linear-gradient(left, #edf1f7 0%, #f9fbfe 30%, #f9fbfe 70%, #edf1f7 100%);
background-image: -webkit-gradient(linear, left, right, color-stop(0, #edf1f7), color-stop(0.30, #f9fbfe), color-stop(0.70, #f9fbfe), color-stop(1, #edf1f7));
background-image: -webkit-linear-gradient(left, #edf1f7 0%, #f9fbfe 30%, #f9fbfe 70%, #edf1f7 100%);
background-image: linear-gradient(to right, #edf1f7 0%, #f9fbfe 30%, #f9fbfe 70%, #edf1f7 100%);
}
b.hud_title {
color: #a4aebf;
}
span.hud_voicemail_total {
cursor: pointer;
color: #004083;
font-size: 60px;
line-hight: 20px;
font-weight: bold;
}
span.hud_voicemail_total:hover {
opacity: 0.7;
}
sup.hud_voicemail_new {
font-weight: normal;
color: #03920a;
font-size: 30px;
line-hight: 10px;
}
th.hud_heading {
font-size: 11px;
font-weight: bold;
color: black;
text-align: left;
}
td.hud_text {
font-size: 11px;
color: black;
text-align: left;
}
/* dashboard hud styles end */
</style>