From 88ff1da5a072192c4601932c9295a27cd466e3ef Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 24 Feb 2025 22:01:19 +0000 Subject: [PATCH] Fix for drop_lockout_time issue with NULL last_local_call_time DROP leads git-svn-id: svn://192.168.202.10@3911 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_VDhopper.pl | 7 ++++--- www/agc/vdc_db_query.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/AST_VDhopper.pl b/bin/AST_VDhopper.pl index 48450d2b..1fc63546 100644 --- a/bin/AST_VDhopper.pl +++ b/bin/AST_VDhopper.pl @@ -22,7 +22,7 @@ # - S = Standard hopper load # - D = Campaign Drop-Run # -# Copyright (C) 2024 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 50810-1613 - Added database server variable definitions lookup @@ -111,10 +111,11 @@ # 231126-1748 - Added RQUEUE hopper status # 231129-1051 - Added daily_phone_number_call_limit campaign setting # 240225-0954 - Added AUTONEXT hopper_hold_inserts campaign option +# 250224-1641 - Fix for drop_lockout_time issue with NULL last_local_call_time DROP leads # # constants -$build = '240225-0954'; +$build = '250224-1641'; $script='AST_VDhopper'; $DB=0; # Debug flag, set to 0 for no debug messages. Can be overriden with CLI --debug flag $US='__'; @@ -2839,7 +2840,7 @@ foreach(@campaign_id) if ($drop_lockout_time[$i] > 0) { $DLseconds[$i] = ($drop_lockout_time[$i] * 3600); - $DLTsql[$i] = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds[$i] SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + $DLTsql[$i] = "and ( ( (status IN('DROP','XDROP')) and ( (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds[$i] SECOND),' ',CURTIME()) ) or (last_local_call_time IS NULL) ) ) or (status NOT IN('DROP','XDROP')) )"; if ($DB) {print " drop lockout time $drop_lockout_time[$i]($DLseconds[$i]) defined for $campaign_id[$i]\n";} if ($DBX) {print " |$DLTsql[$i]|\n";} $hopper_begin_output .= " drop lockout time $drop_lockout_time[$i]($DLseconds[$i]) defined for $campaign_id[$i] \n"; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index d1e1d8d0..0835766f 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -555,10 +555,11 @@ # 240830-1618 - Added manual_minimum_ring_seconds SIP action lookup code # 240906-1646 - Added testing for stereo_recording campaign option for manual dial calls *NOT PRODUCTION READY* # 250129-0900 - Fix for PHP8 TypeError +# 250224-1642 - Fix for drop_lockout_time issue with NULL last_local_call_time DROP leads # -$version = '2.14-448'; -$build = '250129-0900'; +$version = '2.14-449'; +$build = '250224-1642'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=913; @@ -3457,7 +3458,7 @@ if ($ACTION == 'manDiaLnextCaLL') $DLseconds = ($drop_lockout_time * 3600); $DLseconds = floor($DLseconds); $DLseconds = intval("$DLseconds"); - $DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )"; + $DLTsql = "and ( ( (status IN('DROP','XDROP')) and ( (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) or (last_local_call_time IS NULL) ) ) or (status NOT IN('DROP','XDROP')) )"; } $CCLsql='';