Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N
##### UPDATE the leads to be dialed for this campaign #####
if ( ($campaign_leads_to_call[$i] < 1) && ($rec_ct[$i] < 1) )
{
if ($DB) {print " NO DIALABLE LEADS FOR THIS CAMPAIGN\n";}
if ($VCSdialable_leads[$i] > 0)
{
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";}
#### Added by PoundTeam for Auto List Reset
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where S.campaign_id='$campaign_id[$i]' and upper(S.reset_time) like '%AUTO%';";
$affected_rows = $dbhA->do($stmtA);
$event_string = "|$campaign_id[$i]|Reset Lists: $stmtA|";
if ($DBX) {print "$event_string\n";}
&event_logger;
#### End Added by PoundTeam for Auto List Reset
#### End Added by PoundTeam for Auto List Reset
#### Added by DomeDan to send mail if list was reset
use Mail::Sendmail;
%mail = (
From => 'root@localhost',
To => 'domedan@localhost',
Cc => 'domedan@mailinator.com',
Subject => "Auto List Reset for campaign $campaign_id[$i]",
Message => "The list/lists for campaign $campaign_id[$i] was automatically reset due to no dialable leads.\n\nObi-Wan: I felt a great disturbance in the Force, as if $affected_rows of voices suddenly cried out in terror."
);
sendmail(%mail) or die $Mail::Sendmail::error;
if ($DB) {print "Mail sent. Log says:\n", $Mail::Sendmail::log;}
#### End Added by DomeDan to send mail if list was reset
From root@localhost.site Fri May 3 12:48:02 2013
X-Original-To: domedan@localhost
Delivered-To: domedan@localhost.site
Cc: domedan@mailinator.com
Subject: Auto List Reset for campaign 98
Date: Fri, 3 May 2013 12:48:01 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
To: domedan@localhost.site
Content-Transfer-Encoding: quoted-printable
From: root@localhost.site
The list/lists for campaign 98 was automatically reset due to no dialable leads.
Obi-Wan: I felt a great disturbance in the Force, as if 100 of voices suddenly cried out in terror.
##### UPDATE the leads to be dialed for this campaign #####
if ( ($campaign_leads_to_call[$i] < 1) && ($rec_ct[$i] < 1) )
{
if ($DB) {print " NO DIALABLE LEADS FOR THIS CAMPAIGN (Previous: $VCSdialable_leads[$i])\n";}
if ($VCSdialable_leads[$i] > 0)
{
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";}
#### Added by PoundTeam for Auto List Reset
if ($DBX) {print "---------------Campaign $campaign_id[$i] has just hit Zero: checking for Auto Reset ---------------------\n";}
### Check against calltime, extracted/modified from AST_VDsales_export.pl
$within_calltime = 1;
$CThourminute = "$hour$min";
$CTstart = $Gct_default_start;
$CTstop = $Gct_default_stop;
if ( ($wday == 0) && ( ($Gct_sunday_start > 0) && ($Gct_sunday_stop > 0) ) )
{$CTstart = $Gct_sunday_start; $CTstop = $Gct_sunday_stop;}
if ( ($wday == 1) && ( ($Gct_monday_start > 0) && ($Gct_monday_stop > 0) ) )
{$CTstart = $Gct_monday_start; $CTstop = $Gct_monday_stop;}
if ( ($wday == 2) && ( ($Gct_tuesday_start > 0) && ($Gct_tuesday_stop > 0) ) )
{$CTstart = $Gct_tuesday_start; $CTstop = $Gct_tuesday_stop;}
if ( ($wday == 3) && ( ($Gct_wednesday_start > 0) && ($Gct_wednesday_stop > 0) ) )
{$CTstart = $Gct_wednesday_start; $CTstop = $Gct_wednesday_stop;}
if ( ($wday == 4) && ( ($Gct_thursday_start > 0) && ($Gct_thursday_stop > 0) ) )
{$CTstart = $Gct_thursday_start; $CTstop = $Gct_thursday_stop;}
if ( ($wday == 5) && ( ($Gct_friday_start > 0) && ($Gct_friday_stop > 0) ) )
{$CTstart = $Gct_friday_start; $CTstop = $Gct_friday_stop;}
if ( ($wday == 6) && ( ($Gct_saturday_start > 0) && ($Gct_saturday_stop > 0) ) )
{$CTstart = $Gct_saturday_start; $CTstop = $Gct_saturday_stop;}
if ( ($CThourminute < $CTstart) || ($CThourminute > $CTstop) )
{
if ($DB > 0) {print "System Time is outside of Campaign call time: $CThourminute|$Cwday| |$CTstart|$CTstop| \n";}
$within_calltime=0;
}
else
{
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where S.campaign_id='$campaign_id[$i]' and upper(S.reset_time) like '%AUTO%';";
$affected_rows = $dbhA->do($stmtA);
$event_string = "|$campaign_id[$i]|$stmtA|Reset Lists: $affected_rows|";
if ($DBX) {print "$event_string\n";}
}
### End Calltime check
if ($DBX) {print "---------------Campaign $campaign_id[$i] Completed checking for Auto Reset ---------------------\n";}
&event_logger;
#### End Added by PoundTeam for Auto List Reset
williamconley wrote:Upgrade to auto list reset for those who use call times to limit available leads: This modification will NOT reset the list if the server time is outside the "call_times" for this campaign. The client had this created to avoid nightly resets when the list zero'd. The first 9 lines are there to show where in the hopper script this code should be inserted.
- Code: Select all
##### UPDATE the leads to be dialed for this campaign #####
if ( ($campaign_leads_to_call[$i] < 1) && ($rec_ct[$i] < 1) )
{
if ($DB) {print " NO DIALABLE LEADS FOR THIS CAMPAIGN (Previous: $VCSdialable_leads[$i])\n";}
if ($VCSdialable_leads[$i] > 0)
{
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";}
#### Added by PoundTeam for Auto List Reset
if ($DBX) {print "---------------Campaign $campaign_id[$i] has just hit Zero: checking for Auto Reset ---------------------\n";}
### Check against calltime, extracted/modified from AST_VDsales_export.pl
$within_calltime = 1;
$CThourminute = "$hour$min";
$CTstart = $Gct_default_start;
$CTstop = $Gct_default_stop;
if ( ($wday == 0) && ( ($Gct_sunday_start > 0) && ($Gct_sunday_stop > 0) ) )
{$CTstart = $Gct_sunday_start; $CTstop = $Gct_sunday_stop;}
if ( ($wday == 1) && ( ($Gct_monday_start > 0) && ($Gct_monday_stop > 0) ) )
{$CTstart = $Gct_monday_start; $CTstop = $Gct_monday_stop;}
if ( ($wday == 2) && ( ($Gct_tuesday_start > 0) && ($Gct_tuesday_stop > 0) ) )
{$CTstart = $Gct_tuesday_start; $CTstop = $Gct_tuesday_stop;}
if ( ($wday == 3) && ( ($Gct_wednesday_start > 0) && ($Gct_wednesday_stop > 0) ) )
{$CTstart = $Gct_wednesday_start; $CTstop = $Gct_wednesday_stop;}
if ( ($wday == 4) && ( ($Gct_thursday_start > 0) && ($Gct_thursday_stop > 0) ) )
{$CTstart = $Gct_thursday_start; $CTstop = $Gct_thursday_stop;}
if ( ($wday == 5) && ( ($Gct_friday_start > 0) && ($Gct_friday_stop > 0) ) )
{$CTstart = $Gct_friday_start; $CTstop = $Gct_friday_stop;}
if ( ($wday == 6) && ( ($Gct_saturday_start > 0) && ($Gct_saturday_stop > 0) ) )
{$CTstart = $Gct_saturday_start; $CTstop = $Gct_saturday_stop;}
if ( ($CThourminute < $CTstart) || ($CThourminute > $CTstop) )
{
if ($DB > 0) {print "System Time is outside of Campaign call time: $CThourminute|$Cwday| |$CTstart|$CTstop| \n";}
$within_calltime=0;
}
else
{
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where S.campaign_id='$campaign_id[$i]' and upper(S.reset_time) like '%AUTO%';";
$affected_rows = $dbhA->do($stmtA);
$event_string = "|$campaign_id[$i]|$stmtA|Reset Lists: $affected_rows|";
if ($DBX) {print "$event_string\n";}
}
### End Calltime check
if ($DBX) {print "---------------Campaign $campaign_id[$i] Completed checking for Auto Reset ---------------------\n";}
&event_logger;
#### End Added by PoundTeam for Auto List Reset
This leads to the ability to use more than one "code" to signify whether the call times should apply or not. for instance "auto" vs "autoCT" could be used for auto without call time check and auto WITH call time check, with slight modifications to the code.
williamconley wrote:Upgrade to auto list reset for those who use call times to limit available leads: This modification will NOT reset the list if the server time is outside the "call_times" for this campaign. The client had this created to avoid nightly resets when the list zero'd. The first 9 lines are there to show where in the hopper script this code should be inserted.
- Code: Select all
##### UPDATE the leads to be dialed for this campaign #####
if ( ($campaign_leads_to_call[$i] < 1) && ($rec_ct[$i] < 1) )
{
if ($DB) {print " NO DIALABLE LEADS FOR THIS CAMPAIGN (Previous: $VCSdialable_leads[$i])\n";}
if ($VCSdialable_leads[$i] > 0)
{
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";}
#### Added by PoundTeam for Auto List Reset
if ($DBX) {print "---------------Campaign $campaign_id[$i] has just hit Zero: checking for Auto Reset ---------------------\n";}
### Check against calltime, extracted/modified from AST_VDsales_export.pl
$within_calltime = 1;
$CThourminute = "$hour$min";
$CTstart = $Gct_default_start;
$CTstop = $Gct_default_stop;
if ( ($wday == 0) && ( ($Gct_sunday_start > 0) && ($Gct_sunday_stop > 0) ) )
{$CTstart = $Gct_sunday_start; $CTstop = $Gct_sunday_stop;}
if ( ($wday == 1) && ( ($Gct_monday_start > 0) && ($Gct_monday_stop > 0) ) )
{$CTstart = $Gct_monday_start; $CTstop = $Gct_monday_stop;}
if ( ($wday == 2) && ( ($Gct_tuesday_start > 0) && ($Gct_tuesday_stop > 0) ) )
{$CTstart = $Gct_tuesday_start; $CTstop = $Gct_tuesday_stop;}
if ( ($wday == 3) && ( ($Gct_wednesday_start > 0) && ($Gct_wednesday_stop > 0) ) )
{$CTstart = $Gct_wednesday_start; $CTstop = $Gct_wednesday_stop;}
if ( ($wday == 4) && ( ($Gct_thursday_start > 0) && ($Gct_thursday_stop > 0) ) )
{$CTstart = $Gct_thursday_start; $CTstop = $Gct_thursday_stop;}
if ( ($wday == 5) && ( ($Gct_friday_start > 0) && ($Gct_friday_stop > 0) ) )
{$CTstart = $Gct_friday_start; $CTstop = $Gct_friday_stop;}
if ( ($wday == 6) && ( ($Gct_saturday_start > 0) && ($Gct_saturday_stop > 0) ) )
{$CTstart = $Gct_saturday_start; $CTstop = $Gct_saturday_stop;}
if ( ($CThourminute < $CTstart) || ($CThourminute > $CTstop) )
{
if ($DB > 0) {print "System Time is outside of Campaign call time: $CThourminute|$Cwday| |$CTstart|$CTstop| \n";}
$within_calltime=0;
}
else
{
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where S.campaign_id='$campaign_id[$i]' and upper(S.reset_time) like '%AUTO%';";
$affected_rows = $dbhA->do($stmtA);
$event_string = "|$campaign_id[$i]|$stmtA|Reset Lists: $affected_rows|";
if ($DBX) {print "$event_string\n";}
}
### End Calltime check
if ($DBX) {print "---------------Campaign $campaign_id[$i] Completed checking for Auto Reset ---------------------\n";}
&event_logger;
#### End Added by PoundTeam for Auto List Reset
This leads to the ability to use more than one "code" to signify whether the call times should apply or not. for instance "auto" vs "autoCT" could be used for auto without call time check and auto WITH call time check, with slight modifications to the code.
williamconley wrote:We now have a mod that will reset lists when empty!
Requires only a change to the hopper script, no admin changes required. Add the word "auto" to the reset times and it just works. LOL
hopper script at line 1875 in svn Revision: 1912:
- Code: Select all
##### UPDATE the leads to be dialed for this campaign #####
if ( ($campaign_leads_to_call[$i] < 1) && ($rec_ct[$i] < 1) )
{
if ($DB) {print " NO DIALABLE LEADS FOR THIS CAMPAIGN\n";}
if ($VCSdialable_leads[$i] > 0)
{
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";}
#### Added by PoundTeam for Auto List Reset
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where S.campaign_id='$campaign_id[$i]' and upper(S.reset_time) like '%AUTO%';";
$affected_rows = $dbhA->do($stmtA);
$event_string = "|$campaign_id[$i]|Reset Lists: $stmtA|";
if ($DBX) {print "$event_string\n";}
&event_logger;
#### End Added by PoundTeam for Auto List Reset
Only add the "Added by PoundTeam" section, of course, the rest is there for "where do I put this".
locate hopper
williamconley wrote:
- Code: Select all
locate hopper
That ought to help you locate it.
Users browsing this forum: Fares MEHENI and 55 guests