Extension summary add voicemail column and use the CDR status

This commit is contained in:
FusionPBX
2024-02-22 21:04:14 -07:00
committed by GitHub
parent 7436d8e651
commit 4d9160b1cd
2 changed files with 18 additions and 19 deletions

View File

@@ -1588,20 +1588,7 @@ if (!class_exists('xml_cdr')) {
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and missed_call = false\n";
if (!permission_exists('xml_cdr_enterprise_leg')) {
$sql .= " and originating_leg_uuid is null \n";
}
elseif (!permission_exists('xml_cdr_lose_race')) {
$sql .= " and hangup_cause <> 'LOSE_RACE' \n";
}
$sql .= " and (cc_side IS NULL or cc_side !='agent')";
if ($this->include_internal) {
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
}
else {
$sql .= "and direction = 'inbound' \n";
}
$sql .= " and status = 'answered' \n";
$sql .= ") \n";
$sql .= "as answered, \n";
@@ -1609,16 +1596,24 @@ if (!class_exists('xml_cdr')) {
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and missed_call = true\n";
$sql .= " and status = 'missed' \n";
$sql .= " and (cc_side is null or cc_side != 'agent') \n";
$sql .= ") \n";
$sql .= "as missed, \n";
//cc missed
//voicemail
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and c.hangup_cause = 'NO_ANSWER' \n";
$sql .= " and status = 'voicemail'\n";
$sql .= ") \n";
$sql .= "as voicemail, \n";
//no answer
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and status = 'no_answer'\n";
$sql .= " and (cc_side IS NOT NULL or cc_side ='agent')";
if ($this->include_internal) {
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
@@ -1633,7 +1628,7 @@ if (!class_exists('xml_cdr')) {
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and c.hangup_cause = 'USER_BUSY' \n";
$sql .= " and status = 'busy'\n";
if ($this->include_internal) {
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
}
@@ -1725,7 +1720,8 @@ if (!class_exists('xml_cdr')) {
$sql .= " billsec, \n";
$sql .= " cc_side, \n";
$sql .= " sip_hangup_disposition, \n";
$sql .= " voicemail_message \n";
$sql .= " voicemail_message, \n";
$sql .= " status \n";
$sql .= " from v_xml_cdr \n";
if (!(!empty($_GET['show']) && $_GET['show'] === 'all' && permission_exists('xml_cdr_extension_summary_all'))) {
$sql .= " where domain_uuid = :domain_uuid \n";

View File

@@ -200,6 +200,7 @@
}
echo " <th class='center'>".$text['label-answered']."</th>\n";
echo " <th class='center'>".$text['label-missed']."</th>\n";
echo " <th class='center'>".$text['label-voicemail']."</th>\n";
echo " <th class='center'>".$text['label-no_answer']."</th>\n";
echo " <th class='center'>".$text['label-busy']."</th>\n";
echo " <th class='center' title='".$text['description-aloc']."'>".$text['label-aloc']."</th>\n";
@@ -222,6 +223,7 @@
}
echo " <td class='center'>".escape($row['answered'])."&nbsp;</td>\n";
echo " <td class='center'>".escape($row['missed'])."&nbsp;</td>\n";
echo " <td class='center'>".escape($row['voicemail'])."&nbsp;</td>\n";
echo " <td class='center'>".escape($row['no_answer'])."&nbsp;</td>\n";
echo " <td class='center'>".escape($row['busy'])."&nbsp;</td>\n";
echo " <td class='center'>".format_hours($row['aloc'])."&nbsp;</td>\n";
@@ -241,3 +243,4 @@
require_once "resources/footer.php";
?>