diff --git a/UPGRADE b/UPGRADE
index d5bd61ab..4bf598a9 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -727,6 +727,18 @@ OTHER CHANGES:
option added to allow for vicidial_list field logging of responses
inside of a call menu.
+166. Added new Call Count Limit option to the campaign screen. This allows you
+ to limit the number of attempts for any lead being dialed by a campaign.
+ Previously you had to use a filter to achieve this functionality.
+
+167. Added new Complete flag for statuses and campaign statuses. Used by the
+ new colums mentioned below as well as for future reports.
+
+168. Added Dialable and Penetration colums to the Statuses Within This List/
+ Campaign tables on the list and campaign screens, showing the DIALABLE
+ count for each status as well as the complete-flag and call-count-limit
+ percentage as PENETRATION.
+
diff --git a/bin/AST_VDhopper.pl b/bin/AST_VDhopper.pl
index f07b619d..33b21788 100644
--- a/bin/AST_VDhopper.pl
+++ b/bin/AST_VDhopper.pl
@@ -67,6 +67,7 @@
# 110103-1118 - Added lead_order_randomize option
# 110212-2255 - Added scheduled callback custom statuses capability
# 110214-2319 - Added lead_order_secondary option
+# 111006-1416 - Added call_count_limit option
#
# constants
@@ -801,11 +802,11 @@ if ($hopper_dnc_count > 0)
if ($CLIcampaign)
{
- $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary from vicidial_campaigns where campaign_id='$CLIcampaign';";
+ $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit from vicidial_campaigns where campaign_id='$CLIcampaign';";
}
else
{
- $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary from vicidial_campaigns where active='Y';";
+ $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit from vicidial_campaigns where active='Y';";
}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -840,6 +841,7 @@ while ($sthArows > $rec_count)
$auto_trim_hopper[$rec_count] = $aryA[20];
$lead_order_randomize[$rec_count] = $aryA[21];
$lead_order_secondary[$rec_count] = $aryA[22];
+ $call_count_limit[$rec_count] = $aryA[23];
### Auto Hopper Level
if ( $use_auto_hopper[$rec_count] =~ /Y/)
@@ -1727,11 +1729,19 @@ foreach(@campaign_id)
if ($DB) {print " drop lockout time $drop_lockout_time[$i]($DLseconds[$i]) defined for $campaign_id[$i]\n";}
if ($DBX) {print " |$DLTsql[$i]|\n";}
}
-
+
+ $CCLsql[$i]='';
+ if ($call_count_limit[$i] > 0)
+ {
+ $CCLsql[$i] = "and (called_count < $call_count_limit[$i])";
+ if ($DB) {print " call count limit $call_count_limit[$i] defined for $campaign_id[$i]\n";}
+ if ($DBX) {print " |$CCLsql[$i]|\n";}
+ }
+
##### 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 IN($camp_lists[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i];";
+ $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $CCLsql[$i];";
}
else
{
diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql
index cf16475e..33af187c 100644
--- a/extras/MySQL_AST_CREATE_tables.sql
+++ b/extras/MySQL_AST_CREATE_tables.sql
@@ -832,7 +832,9 @@ status_display_fields VARCHAR(30) default 'CALLID',
na_call_url TEXT,
survey_recording ENUM('Y','N','Y_WITH_AMD') default 'N',
pllb_grouping ENUM('DISABLED','ONE_SERVER_ONLY','CASCADING') default 'DISABLED',
-pllb_grouping_limit SMALLINT(5) default '50'
+pllb_grouping_limit SMALLINT(5) default '50',
+call_count_limit SMALLINT(5) UNSIGNED default '0',
+call_count_target SMALLINT(5) UNSIGNED default '3'
);
CREATE TABLE vicidial_lists (
@@ -869,7 +871,8 @@ dnc ENUM('Y','N') default 'N',
customer_contact ENUM('Y','N') default 'N',
not_interested ENUM('Y','N') default 'N',
unworkable ENUM('Y','N') default 'N',
-scheduled_callback ENUM('Y','N') default 'N'
+scheduled_callback ENUM('Y','N') default 'N',
+completed ENUM('Y','N') default 'N'
);
CREATE TABLE vicidial_campaign_statuses (
@@ -885,6 +888,7 @@ customer_contact ENUM('Y','N') default 'N',
not_interested ENUM('Y','N') default 'N',
unworkable ENUM('Y','N') default 'N',
scheduled_callback ENUM('Y','N') default 'N',
+completed ENUM('Y','N') default 'N',
index (campaign_id)
);
@@ -1446,7 +1450,8 @@ tables_use_alt_log_db VARCHAR(2000) default '',
did_agent_log ENUM('Y','N') default 'N',
campaign_cid_areacodes_enabled ENUM('0','1') default '1',
pllb_grouping_limit SMALLINT(5) default '100',
-did_ra_extensions_enabled ENUM('0','1') default '0'
+did_ra_extensions_enabled ENUM('0','1') default '0',
+expanded_list_stats ENUM('0','1') default '1'
);
CREATE TABLE vicidial_campaigns_list_mix (
@@ -1604,6 +1609,7 @@ shift_name VARCHAR(50),
shift_start_time VARCHAR(4) default '0900',
shift_length VARCHAR(5) default '16:00',
shift_weekdays VARCHAR(7) default '0123456',
+report_option ENUM('Y','N') default 'N',
index (shift_id)
);
@@ -2673,7 +2679,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer;
CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log;
CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route);
-UPDATE system_settings SET db_schema_version='1301',db_schema_update_date=NOW();
+UPDATE system_settings SET db_schema_version='1302',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
diff --git a/extras/upgrade_2.4.sql b/extras/upgrade_2.4.sql
index 98ba65e1..b9d6099d 100644
--- a/extras/upgrade_2.4.sql
+++ b/extras/upgrade_2.4.sql
@@ -1083,3 +1083,15 @@ UPDATE system_settings SET db_schema_version='1300',db_schema_update_date=NOW()
ALTER TABLE vicidial_call_menu ADD dtmf_field VARCHAR(50) default 'NONE';
UPDATE system_settings SET db_schema_version='1301',db_schema_update_date=NOW() where db_schema_version < 1301;
+
+ALTER TABLE vicidial_campaigns ADD call_count_limit SMALLINT(5) UNSIGNED default '0';
+ALTER TABLE vicidial_campaigns ADD call_count_target SMALLINT(5) UNSIGNED default '3';
+
+ALTER TABLE vicidial_statuses ADD completed ENUM('Y','N') default 'N';
+ALTER TABLE vicidial_campaign_statuses ADD completed ENUM('Y','N') default 'N';
+
+ALTER TABLE system_settings ADD expanded_list_stats ENUM('0','1') default '1';
+
+ALTER TABLE vicidial_shifts ADD report_option ENUM('Y','N') default 'N';
+
+UPDATE system_settings SET db_schema_version='1302',db_schema_update_date=NOW() where db_schema_version < 1302;
diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
index 99bfdd82..efa33b6d 100644
--- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
+++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
@@ -752,6 +752,16 @@ If set to Y_WITH_AMD even answering machine detected message calls will be recor
Log Field||
If the Log Key Press option is enabled, this optional setting can allow the response to also be stored in this list field||
Default is NONE for disabled||
+Call Count Limit||
+This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit||
+Call Count Target||
+This option is only used for reporting purposes and has no effect on leads dialed. Default is 3||
+Enable Expanded List Stats||
+This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled||
+Report Option||
+This option allows this specific shift to show up in selected reports that support this option||
+There are||
+completed leads in those lists||
lead_report_export.php
diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php
index 8133a215..ae17119d 100644
--- a/www/agc/vdc_db_query.php
+++ b/www/agc/vdc_db_query.php
@@ -290,10 +290,11 @@
# 110723-2256 - Added disable_alter_custphone HIDE option for call logs display
# 110731-2318 - Added dispo/start call url logging to DB table
# 110901-1117 - Added areacode custom cid function
+# 111006-1425 - Added call_count_limit campaign option
#
-$version = '2.4-193';
-$build = '110901-1117';
+$version = '2.4-194';
+$build = '111006-1425';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=425;
$one_mysql_log=0;
@@ -1524,7 +1525,7 @@ if ($ACTION == 'manDiaLnextCaLL')
else
{
##### gather no hopper dialing settings from campaign
- $stmt="SELECT no_hopper_dialing,agent_dial_owner_only,local_call_time,dial_statuses,drop_lockout_time,lead_filter_id,lead_order,lead_order_randomize,lead_order_secondary FROM vicidial_campaigns where campaign_id='$campaign';";
+ $stmt="SELECT no_hopper_dialing,agent_dial_owner_only,local_call_time,dial_statuses,drop_lockout_time,lead_filter_id,lead_order,lead_order_randomize,lead_order_secondary,call_count_limit FROM vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00236',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1541,6 +1542,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$lead_order = $row[6];
$lead_order_randomize = $row[7];
$lead_order_secondary = $row[8];
+ $call_count_limit = $row[9];
}
if (eregi("N",$no_hopper_dialing))
{
@@ -1877,6 +1879,12 @@ if ($ACTION == 'manDiaLnextCaLL')
$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')) )";
}
+ $CCLsql='';
+ if ($call_count_limit > 0)
+ {
+ $CCLsql = "and (called_count < $call_count_limit)";
+ }
+
$stmt="SELECT lead_filter_sql FROM vicidial_lead_filters where lead_filter_id='$lead_filter_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00239',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2000,7 +2008,7 @@ if ($ACTION == 'manDiaLnextCaLL')
if (eregi("UP TIMEZONE",$lead_order)){$order_stmt = "order by gmt_offset_now desc, $last_order";}
if (eregi("DOWN TIMEZONE",$lead_order)){$order_stmt = "order by gmt_offset_now, $last_order";}
- $stmt="UPDATE vicidial_list SET user='QUEUE$user' where called_since_last_reset='N' and user NOT LIKE \"QUEUE%\" and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL $adooSQL $order_stmt LIMIT 1;";
+ $stmt="UPDATE vicidial_list SET user='QUEUE$user' where called_since_last_reset='N' and user NOT LIKE \"QUEUE%\" and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL $adooSQL $order_stmt LIMIT 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00242',$user,$server_ip,$session_name,$one_mysql_log);}
diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php
index d126f68b..fcf78b7a 100644
--- a/www/vicidial/admin.php
+++ b/www/vicidial/admin.php
@@ -1655,6 +1655,16 @@ if (isset($_GET["after_hours_callmenu"])) {$after_hours_callmenu=$_GET["after_
elseif (isset($_POST["after_hours_callmenu"])) {$after_hours_callmenu=$_POST["after_hours_callmenu"];}
if (isset($_GET["dtmf_field"])) {$dtmf_field=$_GET["dtmf_field"];}
elseif (isset($_POST["dtmf_field"])) {$dtmf_field=$_POST["dtmf_field"];}
+if (isset($_GET["call_count_limit"])) {$call_count_limit=$_GET["call_count_limit"];}
+ elseif (isset($_POST["call_count_limit"])) {$call_count_limit=$_POST["call_count_limit"];}
+if (isset($_GET["call_count_target"])) {$call_count_target=$_GET["call_count_target"];}
+ elseif (isset($_POST["call_count_target"])) {$call_count_target=$_POST["call_count_target"];}
+if (isset($_GET["completed"])) {$completed=$_GET["completed"];}
+ elseif (isset($_POST["completed"])) {$completed=$_POST["completed"];}
+if (isset($_GET["expanded_list_stats"])) {$expanded_list_stats=$_GET["expanded_list_stats"];}
+ elseif (isset($_POST["expanded_list_stats"])) {$expanded_list_stats=$_POST["expanded_list_stats"];}
+if (isset($_GET["report_option"])) {$report_option=$_GET["report_option"];}
+ elseif (isset($_POST["report_option"])) {$report_option=$_POST["report_option"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -1668,7 +1678,7 @@ if (strlen($dial_status) > 0)
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
-$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled FROM system_settings;";
+$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -1699,6 +1709,7 @@ if ($qm_conf_ct > 0)
$SScampaign_cid_areacodes_enabled = $row[21];
$SSpllb_grouping_limit = $row[22];
$SSdid_ra_extensions_enabled = $row[23];
+ $SSexpanded_list_stats = $row[24];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -1919,6 +1930,9 @@ if ($non_latin < 1)
$modify_audiostore = ereg_replace("[^0-9]","",$modify_audiostore);
$modify_moh = ereg_replace("[^0-9]","",$modify_moh);
$modify_tts = ereg_replace("[^0-9]","",$modify_tts);
+ $call_count_limit = ereg_replace("[^0-9]","",$call_count_limit);
+ $call_count_target = ereg_replace("[^0-9]","",$call_count_target);
+ $expanded_list_stats = ereg_replace("[^0-9]","",$expanded_list_stats);
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
@@ -2014,6 +2028,8 @@ if ($non_latin < 1)
$webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer);
$noanswer_log = ereg_replace("[^NY]","",$noanswer_log);
$did_agent_log = ereg_replace("[^NY]","",$did_agent_log);
+ $completed = ereg_replace("[^NY]","",$completed);
+ $report_option = ereg_replace("[^NY]","",$report_option);
$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled);
$active = ereg_replace("[^0-9NY]","",$active);
@@ -2909,12 +2925,13 @@ else
# 110923-0834 - Added option for in-group action transfer cid, and CALLMENU as drop and after-hours action options
# 110923-2043 - Added custom DID fields
# 111004-1539 - Added dtmf_field call menu option
+# 111006-1403 - Added several new campaign and other options, call_count_limit, status flag, shift report flag, etc...
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
-$admin_version = '2.4-339a';
-$build = '111004-1539';
+$admin_version = '2.4-340a';
+$build = '111006-1403';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -4520,6 +4537,16 @@ if ($ADD==99999)
Lead Filter - This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE.
+
+
+
+ Call Count Limit - This enforces a limit on the number of call attempts for the leads dialed in this campaign. A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. Default is 0 for no limit.
+
+
+
+
+ Call Count Target - This option is only used for reporting purposes and has no effect on leads dialed. Default is 3.
+
@@ -6618,6 +6645,9 @@ if ($ADD==99999)
Shift Weekdays - In this section you should choose the days of the week that this shift is active.
+
+
+ Report Option - This option allows this specific shift to show up in selected reports that support this option.
@@ -7752,6 +7782,11 @@ if ($ADD==99999)
Enable Campaign Test Calls - This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled.
+
+
+
+ Enable Expanded List Stats - This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled.
+
@@ -8052,12 +8087,13 @@ if ($ADD==73)
echo "\n";
echo "";
- $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';";
+ $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time,call_count_limit from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$dial_statuses = $row[0];
$local_call_time = $row[1];
$drop_lockout_time = $row[3];
+ $call_count_limit = $row[4];
if ($lead_filter_id=='')
{
$lead_filter_id = $row[2];
@@ -8095,10 +8131,12 @@ if ($ADD==73)
echo "LISTS: $camp_lists
\n";
echo "STATUSES: $dial_statuses
\n";
echo "FILTER: $lead_filter_id
\n";
+ echo "CALL LIMIT: $call_count_limit\n";
echo "CALL TIME: $local_call_time
\n";
### call function to calculate and print dialable leads
- dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
+ $single_status=0;
+ dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL);
echo "
\n";
echo "