automatic list reset option to List Modification screen

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

automatic list reset option to List Modification screen

Postby omarrodriguezt » Fri Mar 05, 2010 2:35 pm

Hello,
I want to be able to automatic reset a list every time that the dial able leads raise to 0.

I have the new version 2.20 and I read that there is an automatic list reset option to List Modification screen.

Can you please enlighten me?
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Postby williamconley » Fri Mar 05, 2010 10:58 pm

Reset Times - This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty.

otherwise, of course, you can run a script every 1,5 or 10 minutes and check and if any campaigns have "0" dialable leads, reset the lists for that campaign.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Thank you

Postby omarrodriguezt » Sat Mar 06, 2010 9:48 am

Thank you for post.

I already read this in the help link, but that means that every time that the lead gets to 0 in this interval the time the list will be reset automatically?
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Postby williamconley » Sat Mar 06, 2010 11:45 am

no omar. it means what it says. the auto-reset function is TIMED. not based on the count. sorry to disappoint. :(

you want it based on the count ... all you have to do is write a script to CHECK the count and reset when 0.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Ok.

Postby omarrodriguezt » Mon Mar 08, 2010 7:59 am

Ok. Thank you william.
I just add a new message in the Vicidial Issue Tracker in order to suggest a new feature that can reset the active lists when dial able leads gets 0.

I was thinking in modify AST_timeonVDADall.php or write a trigger in mysql, any suggestion?
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Postby mflorell » Mon Mar 08, 2010 9:12 am

As long as you can guarantee that only one person is using the Real-Time screen that might work, I wouldn't do it though.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Mon Mar 08, 2010 9:18 am

i would not put it in one of the agi's or a trigger (it would get used too often)

i WOULD put in a timed perl or bash script (check every 5 minutes).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Ok.

Postby omarrodriguezt » Mon Mar 08, 2010 10:38 am

5 minutes its a lot of time for us.
Just think about this scenario: 40 agents, waiting 5 minutes for a call?

But may be the same script running every minute??
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Postby williamconley » Mon Mar 08, 2010 10:51 am

you could try every minute AND you could set it to "reset" when you have less leads in your "list" than you do in your "hopper" (instead of "0).

But watch your load!

If your hopper is set at 500, set it to "reset" your list at 499. Of course, if you're ambitious you could play with setting it to reset when there are still 1000 or more (depending on the size of your lists) especially if you have a method of seeing to it that your lists are called in a way that the lead who has not been called in the longest time is the first one called. If you don't have such a method ... those last leads will never get called, of course, unless you increase your hopper.

remember that the hopper includes all lists in a campaign.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Ok.

Postby omarrodriguezt » Tue Mar 09, 2010 6:37 am

I will try and let you know.
Thank you!
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Patch Status Done

Postby omarrodriguezt » Mon Apr 12, 2010 9:50 am

Patch Status: Done

I just added a piece of code in order to have this feature ready.
Matt, would be great if this feature can be added to the next release.

You can see all the files and the details here:
http://www.vicidial.org/VICIDIALmantis/view.php?id=318

Any question feel free to ask.
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Re: automatic list reset option to List Modification screen

Postby williamconley » Sun Apr 28, 2013 4:16 pm

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".
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: automatic list reset option to List Modification screen

Postby omarrodriguezt » Thu May 02, 2013 2:39 pm

Thank you!
The idea we proposed before was added to the Vicidial. Thats community support.
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Re: automatic list reset option to List Modification screen

Postby DomeDan » Fri May 03, 2013 5:51 am

I do not really like the idea of a automatically list reset function, but I see that its quite handy if you dont want to get disturbed every time the list runs empty.
I tried it out, but I want a mail to be sent out to team-leaders and managers where Obi-Wan tells them about a disturbance in the force.

When I was testing this out I found that I have to disable lead recycle for the campaign! because of this is a previous if-statement: && ($rec_ct[$i] < 1)

Here is the code, added right under williams code as you can see from the first line here:
Code: Select all
        #### 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.
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: automatic list reset option to List Modification screen

Postby omarrodriguezt » Fri May 03, 2013 2:12 pm

Hello DomeDan,
Did you try the patch I submitted?
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Re: automatic list reset option to List Modification screen

Postby DomeDan » Sat May 04, 2013 2:00 am

Hi, I didn't read through the post so I missed your patch,
took a fast look now and its seams better because the code is added before && ($rec_ct[$i] < 1)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: automatic list reset option to List Modification screen

Postby omarrodriguezt » Sat May 04, 2013 8:31 am

Sounds good!
Thank you.
Vicidial Team, it is possible to include a this code in the next version?
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Re: automatic list reset option to List Modification screen

Postby mflorell » Sun May 05, 2013 9:39 am

Would need to have an updated patch file on the issue tracker before we would review it.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: automatic list reset option to List Modification screen

Postby omarrodriguezt » Mon May 06, 2013 7:05 am

Sounds good!
http://www.ITContinental.com
Dedicated USA Servers - Vicibox - Vicidial - Limesurvey - Vtiger CRM - More than 15 years experience - Hablamos Español
omarrodriguezt
 
Posts: 667
Joined: Fri Jun 05, 2009 12:22 pm
Location: Dominican Republic

Re: automatic list reset option to List Modification screen

Postby williamconley » Tue Jun 04, 2013 9:31 am

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.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: automatic list reset option to List Modification screen

Postby greenhunter » Sun Jun 28, 2015 6:59 pm

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.

where i can put this
greenhunter
 
Posts: 1
Joined: Sat Jun 27, 2015 3:58 pm

Re: automatic list reset option to List Modification screen

Postby williamconley » Mon Jun 29, 2015 10:01 pm

You only copied some of the post. The parts you didn't copy included the notation that this goes in the keepalive script (which is in /usr/share/astguiclient). Of course, that was written a while ago, so the location to land the code may have changed. You may want to pull the old file and find where it went then and use that to properly locate where that section is in Today's Code unless you happen to have an old server.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: automatic list reset option to List Modification screen

Postby Noah » Tue Jul 05, 2016 3:39 pm

UPDATED 9-29-2016

Tweaked the idea from 0 dialable in the hopper for a campaign to 0 dialable in the array of lists for that campaign.
This is NOT a copy and paste piece of code, but a guide to add code to the hopper script if you wanted to engage this Auto reset function in list by list.

The feature uses the same setting field, reset time, if that has AUTO in the field it will engage a reset of called_since_last_reset = N if the dialable leads in that list go to 0.

Something that can be very useful, should be used with caution, depending on the size of your list and the frequency in which the list could be reset.

Each section can be copied and pasted where the below starts with # BEGIN Added by MyCallCloud... and ends with # END Added by MyCallCloud

This is line 2440 today - this section ##### Get count of leads that are dialable ##### currently exists in the hopper script.
##### Get count of leads that are dialable #####
if ($list_order_mix[$i] =~ /DISABLED/)
{
$stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and ($list_id_sql[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $CCLsql[$i];";
# BEGIN Added by MyCallCloud to reset lists where reset time is like AUTO
$stmtB = "SELECT count(called_since_last_reset),list_id FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and ($list_id_sql[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $CCLsql[$i];";
# END Added by MyCallCloud to reset lists where reset time is like AUTO
}
else
{
if (length($list_mix_dialableSQL)<3) {$list_mix_dialableSQL="called_count < 0";}
$stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and ($list_mix_dialableSQL) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i];";
# BEGIN Added by MyCallCloud to reset lists where reset time is like AUTO
$stmtB = "SELECT count(called_since_last_reset),list_id FROM vicidial_list where called_since_last_reset='N' and ($list_mix_dialableSQL) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] group by list_id ;";
# END Added by MyCallCloud to reset lists where reset time is like AUTO
}
if ($DBX) {print " |$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;

if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$campaign_leads_to_call[$i] = $aryA[0];
if ($DB) {print " leads to call count: $campaign_leads_to_call[$i]\n";}
if ($DBX) {print " |$stmtA|\n";}
}
$sthA->finish();
# BEGIN Added by MyCallCloud to reset lists where reset time is like AUTO
if ($DBX) {print " |$stmtB|\n";}
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($DBX) {print " Noah |$stmtB|\n";}

# Update the lists that need to be reset
while ( @row = $sthA->fetchrow_array) {
$called_since_last_reset_N = $row[0];
$lists_with_no_dialable_leads = $row[1];

if ($called_since_last_reset_N >= 0) {
# Update the list table and set all records back to N for lists with 0 leads at N called_since_last_reset for the active list_ids in the array for the campaign
# Statement code below from Poundteam to inner join vicidial_list and vicidial_lists with update called_since_last_reset = N
$stmtA = "UPDATE vicidial_list L inner join vicidial_lists S on S.list_id=L.list_id SET called_since_last_reset='N' where L.list_id=$lists_with_no_dialable_leads and upper(S.reset_time) like '%AUTO%' and $called_since_last_reset_N < S.xferconf_e_number;";
$affected_rows = $dbhA->do($stmtA);

if ($DBX) {print " MyCallCloud Auto Reset List Feature Query |$stmtA|\n";}
if ($DB) {print " List Ids with the dialable leads : $lists_with_no_dialable_leads";}
if ($DB) {print " Count called_since_last_reset: $called_since_last_reset_N\n";}
}
}
$sthA->finish();

# END Added by MyCallCloud to reset lists where reset time is like AUTO
Last edited by Noah on Thu Sep 29, 2016 5:03 pm, edited 1 time in total.
MyCallCloud.com - Cool Vici Customizations - Hosted - Configured - Supported
Web: https://mycallcloud.com
P: 888-663-0760
E: sales@mycallcloud.com
Noah
 
Posts: 90
Joined: Tue Feb 08, 2011 7:14 pm

Re: automatic list reset option to List Modification screen

Postby mflorell » Tue Jul 05, 2016 4:04 pm

Could you post this to the issue tracker please?
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: automatic list reset option to List Modification screen

Postby cvillarreal77 » Sat Jan 26, 2019 8:54 pm

hi this patch can apply to vicibox 8.1.2 ? :D
cvillarreal77
 
Posts: 92
Joined: Wed Dec 16, 2015 3:38 pm

Re: automatic list reset option to List Modification screen

Postby ghernandez » Thu Jan 16, 2020 11:17 am

Williamconley - was this added to a newer version of vicidial? or do I need to add this manually?





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.
ghernandez
 
Posts: 46
Joined: Thu Jul 04, 2019 7:01 am

Re: automatic list reset option to List Modification screen

Postby ghernandez » Tue Jan 21, 2020 9:49 am

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".




williamconley - Where is the location of the hopper script?
ghernandez
 
Posts: 46
Joined: Thu Jul 04, 2019 7:01 am

Re: automatic list reset option to List Modification screen

Postby williamconley » Tue Jan 21, 2020 4:46 pm

Code: Select all
locate hopper

That ought to help you locate it. 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: automatic list reset option to List Modification screen

Postby ghernandez » Tue Jan 21, 2020 4:48 pm

williamconley wrote:
Code: Select all
locate hopper

That ought to help you locate it. 8-)




you are the best man... :mrgreen:
ghernandez
 
Posts: 46
Joined: Thu Jul 04, 2019 7:01 am

Re: automatic list reset option to List Modification screen

Postby covarrubiasgg » Tue Feb 21, 2023 2:37 pm

Any chance to have William's Code on future versions of vici?

It is super userful but I am super lazy to patch the hopper on every setup
covarrubiasgg
 
Posts: 420
Joined: Thu Jun 10, 2010 10:20 am
Location: Tijuana, Mexico


Return to Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 60 guests