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 18:09:32 -07:00 committed by GitHub
parent 318953bddf
commit fca029b7df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -1676,6 +1676,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";
@ -1685,6 +1688,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";
@ -1692,7 +1698,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";