From 4faef8d6f556564276afff92d7a5967e29634027 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 17 Aug 2025 17:34:20 +0000 Subject: [PATCH] Added lists config option to settings container for AST_DNCcom_filter.pl script git-svn-id: svn://192.168.202.10@3937 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_DNCcom_filter.pl | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/bin/AST_DNCcom_filter.pl b/bin/AST_DNCcom_filter.pl index 8d49b036..38a3a92d 100644 --- a/bin/AST_DNCcom_filter.pl +++ b/bin/AST_DNCcom_filter.pl @@ -6,7 +6,7 @@ # # !!! REQUIRES A SETTINGS CONTAINER CALLED "DNCDOTCOM" TO BE SET UP TO USE !!! # -# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # 151004-1606 - Initial Build # 151005-1256 - Added logging @@ -14,10 +14,12 @@ # 151022-1900 - Code clean up # 151202-1435 - Added URL option for settings container # 190405-0617 - Small fix based on DNC.com response values +# 250817-1329 - Added lists config option to settings container # # constants $DB=0; # Debug flag, set to 0 for no debug messages per minute +$CLIlists = ''; ### begin parsing run-time options ### if (length($ARGV[0])>1) @@ -54,11 +56,11 @@ if (length($ARGV[0])>1) $CLIlists =~ s/-/,/gi; } } - if (length($CLIlists)<2) - { - print "no lists defined, exiting.\n"; - exit; - } + # if (length($CLIlists)<2) + # { + # print "no lists defined, exiting.\n"; + # exit; + # } if ($DB) {print "|$CLIlists|\n";} } } @@ -128,6 +130,31 @@ $sthArows=$sthA->rows; $rec_count=0; if ($sthArows > 0) { + @aryA = $sthA->fetchrow_array; + $container_entry = $aryA[0]; + %dnccom_settings = get_container_settings($container_entry); + + $CONlists = $dnccom_settings{'VICI_LISTS'}; + $CONlists =~ s/ .*$//gi; + if ($CONlists =~ /-/) + { + $CONlists =~ s/-/,/gi; + } + + if (( length($CONlists)>=2 ) && ( length($CLIlists)>=2 )) + { + $CLIlists = $CLIlists . "," . $CONlists; + } + elsif ((length($CONlists)>=2) && (length($CLIlists)<2)) + { + $CLIlists = $CONlists; + } + + if (length($CLIlists)<2) + { + print "no lists defined, exiting.\n"; + exit; + } # log to the vicidial_admin_log the scrub foreach $list_id (split /,/ ,$CLIlists) @@ -139,10 +166,6 @@ if ($sthArows > 0) } - @aryA = $sthA->fetchrow_array; - $container_entry = $aryA[0]; - %dnccom_settings = get_container_settings($container_entry); - if ( exists($dnccom_settings{'LOGIN_ID'}) && exists($dnccom_settings{'CAMPAIGN_ID'}) &&