From 9595309132371e5abe5728b4e3740a7aef3e60a3 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Mon, 8 Jul 2024 18:28:16 +0200 Subject: [PATCH] Added internal ignore list to voicallhistory::addContractIds() --- .../VoiceCallHistoryController.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/application/VoiceCallHistory/VoiceCallHistoryController.php b/application/VoiceCallHistory/VoiceCallHistoryController.php index ac4991789..ba926db00 100644 --- a/application/VoiceCallHistory/VoiceCallHistoryController.php +++ b/application/VoiceCallHistory/VoiceCallHistoryController.php @@ -109,10 +109,14 @@ class VoiceCallHistoryController extends mfBaseController { public function addContractIds() { $ignore_numbers = [ - "4331641220846", - "43623237705", - "4367761737195" + "^4331641220846$", + "^43623237705$", + "^4367761737195$", + "^43664", + "^43677", + ]; + $unknown_numbers = []; $missing_contracts = []; $update_job_error = false; @@ -124,6 +128,7 @@ class VoiceCallHistoryController extends mfBaseController { return false; } + // get calls without contract id foreach(VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => null, "billable" => "1", "duration" => ["from" => 1]]) as $call) { //var_dump($call);exit; @@ -132,6 +137,11 @@ class VoiceCallHistoryController extends mfBaseController { $number = $call->voice_account; if(!$number) continue; + $pattern = implode("|", $ignore_numbers); + if(preg_match("/($pattern)/", $number)) { + continue; + } + // server side failed/disconnected calls if($call->duration == 1 && $call->state == 38) continue;