Use include internal on answered, missed and voicemail

This hides local calls which could also be calls to feature codes. Only add these feature code calls to the count if directed to show internal calls.
This commit is contained in:
FusionPBX
2024-11-08 21:34:07 -07:00
committed by GitHub
parent 50d81556f5
commit 0aaa4829e7

View File

@@ -1673,6 +1673,9 @@ if (!class_exists('xml_cdr')) {
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and status = 'answered' \n";
if (!$this->include_internal) {
$sql .= "and (direction = 'inbound' or direction = 'outbound') \n";
}
$sql .= ") \n";
$sql .= "as answered, \n";
@@ -1682,6 +1685,9 @@ if (!class_exists('xml_cdr')) {
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and status = 'missed' \n";
$sql .= " and (cc_side is null or cc_side != 'agent') \n";
if (!$this->include_internal) {
$sql .= "and (direction = 'inbound' or direction = 'outbound') \n";
}
$sql .= ") \n";
$sql .= "as missed, \n";
@@ -1689,7 +1695,10 @@ if (!class_exists('xml_cdr')) {
$sql .= "count(*) \n";
$sql .= "filter ( \n";
$sql .= " where c.extension_uuid = e.extension_uuid \n";
$sql .= " and status = 'voicemail'\n";
$sql .= " and status = 'voicemail' \n";
if (!$this->include_internal) {
$sql .= "and (direction = 'inbound' or direction = 'outbound') \n";
}
$sql .= ") \n";
$sql .= "as voicemail, \n";