Extension summary add voicemail column and use the CDR status
This commit is contained in:
@@ -1588,20 +1588,7 @@ if (!class_exists('xml_cdr')) {
|
|||||||
$sql .= "count(*) \n";
|
$sql .= "count(*) \n";
|
||||||
$sql .= "filter ( \n";
|
$sql .= "filter ( \n";
|
||||||
$sql .= " where c.extension_uuid = e.extension_uuid \n";
|
$sql .= " where c.extension_uuid = e.extension_uuid \n";
|
||||||
$sql .= " and missed_call = false\n";
|
$sql .= " and status = 'answered' \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 .= ") \n";
|
$sql .= ") \n";
|
||||||
$sql .= "as answered, \n";
|
$sql .= "as answered, \n";
|
||||||
|
|
||||||
@@ -1609,16 +1596,24 @@ if (!class_exists('xml_cdr')) {
|
|||||||
$sql .= "count(*) \n";
|
$sql .= "count(*) \n";
|
||||||
$sql .= "filter ( \n";
|
$sql .= "filter ( \n";
|
||||||
$sql .= " where c.extension_uuid = e.extension_uuid \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 .= " and (cc_side is null or cc_side != 'agent') \n";
|
||||||
$sql .= ") \n";
|
$sql .= ") \n";
|
||||||
$sql .= "as missed, \n";
|
$sql .= "as missed, \n";
|
||||||
|
|
||||||
//cc missed
|
//voicemail
|
||||||
$sql .= "count(*) \n";
|
$sql .= "count(*) \n";
|
||||||
$sql .= "filter ( \n";
|
$sql .= "filter ( \n";
|
||||||
$sql .= " where c.extension_uuid = e.extension_uuid \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')";
|
$sql .= " and (cc_side IS NOT NULL or cc_side ='agent')";
|
||||||
if ($this->include_internal) {
|
if ($this->include_internal) {
|
||||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||||
@@ -1633,7 +1628,7 @@ if (!class_exists('xml_cdr')) {
|
|||||||
$sql .= "count(*) \n";
|
$sql .= "count(*) \n";
|
||||||
$sql .= "filter ( \n";
|
$sql .= "filter ( \n";
|
||||||
$sql .= " where c.extension_uuid = e.extension_uuid \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) {
|
if ($this->include_internal) {
|
||||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||||
}
|
}
|
||||||
@@ -1725,7 +1720,8 @@ if (!class_exists('xml_cdr')) {
|
|||||||
$sql .= " billsec, \n";
|
$sql .= " billsec, \n";
|
||||||
$sql .= " cc_side, \n";
|
$sql .= " cc_side, \n";
|
||||||
$sql .= " sip_hangup_disposition, \n";
|
$sql .= " sip_hangup_disposition, \n";
|
||||||
$sql .= " voicemail_message \n";
|
$sql .= " voicemail_message, \n";
|
||||||
|
$sql .= " status \n";
|
||||||
$sql .= " from v_xml_cdr \n";
|
$sql .= " from v_xml_cdr \n";
|
||||||
if (!(!empty($_GET['show']) && $_GET['show'] === 'all' && permission_exists('xml_cdr_extension_summary_all'))) {
|
if (!(!empty($_GET['show']) && $_GET['show'] === 'all' && permission_exists('xml_cdr_extension_summary_all'))) {
|
||||||
$sql .= " where domain_uuid = :domain_uuid \n";
|
$sql .= " where domain_uuid = :domain_uuid \n";
|
||||||
|
|||||||
@@ -200,6 +200,7 @@
|
|||||||
}
|
}
|
||||||
echo " <th class='center'>".$text['label-answered']."</th>\n";
|
echo " <th class='center'>".$text['label-answered']."</th>\n";
|
||||||
echo " <th class='center'>".$text['label-missed']."</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-no_answer']."</th>\n";
|
||||||
echo " <th class='center'>".$text['label-busy']."</th>\n";
|
echo " <th class='center'>".$text['label-busy']."</th>\n";
|
||||||
echo " <th class='center' title='".$text['description-aloc']."'>".$text['label-aloc']."</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'])." </td>\n";
|
echo " <td class='center'>".escape($row['answered'])." </td>\n";
|
||||||
echo " <td class='center'>".escape($row['missed'])." </td>\n";
|
echo " <td class='center'>".escape($row['missed'])." </td>\n";
|
||||||
|
echo " <td class='center'>".escape($row['voicemail'])." </td>\n";
|
||||||
echo " <td class='center'>".escape($row['no_answer'])." </td>\n";
|
echo " <td class='center'>".escape($row['no_answer'])." </td>\n";
|
||||||
echo " <td class='center'>".escape($row['busy'])." </td>\n";
|
echo " <td class='center'>".escape($row['busy'])." </td>\n";
|
||||||
echo " <td class='center'>".format_hours($row['aloc'])." </td>\n";
|
echo " <td class='center'>".format_hours($row['aloc'])." </td>\n";
|
||||||
@@ -241,3 +243,4 @@
|
|||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user