Added Outbound Campaign Test Call feature to allow you to place a call from the Campaign Detail screen that will go out as if it were an auto-dial call. Must be enabled in System Settings.

Added ability to check for USA and Canada valid prefix and areacodes when loading leads into the web/cli/api lead loaders

git-svn-id: svn://192.168.202.10@1687 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-07-06 12:26:41 +00:00
parent 9405fd06f1
commit be1c7a2050
13 changed files with 439 additions and 81 deletions
+7
View File
@@ -628,6 +628,13 @@ OTHER CHANGES:
140. Added HIDDEN and READONLY field types for custom list fields.
141. Added Outbound Campaign Test Call feature to allow you to place a call from
the Campaign Detail screen that will go out as if it were an auto-dial
call. Must be enabled in System Settings.
142. Added ability to check for USA and Canada valid prefix and areacodes when
loading leads into the web/cli/api lead loaders
+31 -15
View File
@@ -61,6 +61,7 @@
# 101214-1507 - Changed list auto-reset to work with inactive lists
# 110512-2112 - Added vicidial_campaign_stats_debug to table cleaning
# 110525-2334 - Added cm.agi optional logging to call menus
# 110705-2023 - Added agents_calls_reset option
#
$DB=0; # Debug flag
@@ -631,6 +632,18 @@ $timeclock_end_of_day_NOW=0;
if ($timeclock_end_of_day_NOW > 0)
{
$stmtA = "SELECT agents_calls_reset from system_settings;";
if ($DB) {print "|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$SSsel_ct=$sthA->rows;
if ($SSsel_ct > 0)
{
@aryA = $sthA->fetchrow_array;
$agents_calls_reset = $aryA[0];
}
$sthA->finish();
if ($DB) {print "Starting clear out non-used vicidial_conferences sessions process...\n";}
$stmtA = "SELECT conf_exten,extension from vicidial_conferences where server_ip='$server_ip' and leave_3way='0';";
@@ -785,16 +798,29 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_live_inbound_agents where last_call_finish < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_inbound_agents old records deleted|\n";}
$stmtA = "update vicidial_live_inbound_agents SET calls_today=0;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_inbound_agents call counts reset|\n";}
if ($agents_calls_reset > 0)
{
$stmtA = "delete from vicidial_live_inbound_agents where last_call_finish < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_inbound_agents old records deleted|\n";}
$stmtA = "delete from vicidial_live_agents where last_state_change < \"$TDSQLdate\" and extension NOT LIKE \"R/%\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_agents old records deleted|\n";}
$stmtA = "delete from vicidial_auto_calls where last_update_time < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_auto_calls old records deleted|\n";}
}
$stmtA = "optimize table vicidial_live_inbound_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -804,11 +830,6 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_live_agents where last_state_change < \"$TDSQLdate\" and extension NOT LIKE \"R/%\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_agents old records deleted|\n";}
$stmtA = "optimize table vicidial_live_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -818,11 +839,6 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_auto_calls where last_update_time < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_auto_calls old records deleted|\n";}
$stmtA = "optimize table vicidial_auto_calls;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
+1 -1
View File
@@ -1170,7 +1170,7 @@ while($one_day_interval > 0)
if (length($ext_context) < 1) {$ext_context='default';}
### use manager middleware-app to connect the next call to the meetme room
# VmmddhhmmssLLLLLLLLL
# VmddhhmmssLLLLLLLLLL
$VqueryCID = "V$CIDdate$PADlead_id";
if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";}
else {$CIDstring = "$VqueryCID";}
@@ -51,9 +51,10 @@
# 100928-1121 - Added file-prefix-filter option
# 110420-0944 - Fixed file prefix issue with multiple processes running
# 110424-0948 - Added time-zone-code-gmt option to use time zone code from the owner field
# 110705-1913 - Added options for USACAN prefix(no 0 or 1) and valid areacode filtering
#
$version = '110424-0948';
$version = '110705-1913';
$secX = time();
$MT[0]='';
@@ -161,6 +162,8 @@ if (length($ARGV[0])>1)
print " [--new-listid-prefix=X] = prefix for listID when creating new lists, must be only numbers, and 4 or less digits\n";
print " [--new-listname-prefix=X] = prefix for list name when creating new lists, will be followed by filename\n";
print " [--new-list-campaign=X] = campaign that the new list will be assigned to\n";
print " [--USACAN-prefix-check] = check for the 4th digit 2-9, USA and Canada validation\n";
print " [--USACAN-areacode-check] = check for the valid phone code 1 areacodes, USA and Canada validation\n";
print " [--duplicate-check] = checks for the same phone number in the same list id before inserting lead\n";
print " [--duplicate-campaign-check] = checks for the same phone number in the same campaign before inserting lead\n";
print " [--duplicate-system-check] = checks for the same phone number in the entire system before inserting lead\n";
@@ -282,6 +285,16 @@ if (length($ARGV[0])>1)
else
{$file_prefix_filter = '';}
if ($args =~ /--USACAN-prefix-check/i)
{
$usacan_prefix_check=1;
if ($q < 1) {print "\n----- USACAN PREFIX CHECK -----\n\n";}
}
if ($args =~ /--USACAN-areacode-check/i)
{
$usacan_areacode_check=1;
if ($q < 1) {print "\n----- USACAN AREACODE CHECK -----\n\n";}
}
if ($args =~ /-duplicate-check/i)
{
$dupcheck=1;
@@ -622,6 +635,7 @@ foreach(@FILES)
$e=0; ### status of 'ERROR' counter ###
$f=0; ### number of 'DUPLICATE' counter ###
$g=0; ### number of leads with multi-alt-entries
$h=0; ### number of 'INVALID' counter ###
$multi_insert_counter=0;
$multistmt='';
@@ -1572,6 +1586,40 @@ foreach(@FILES)
if ($DBX) {print "$a|$phone_number\n";}
$valid_lead=1;
##### Check for valid USA and Canada prefix #####
if ($usacan_prefix_check > 0)
{
$USprefix = substr($phone_number, 3, 1);
if ($USprefix < 2)
{
$valid_lead = '0';
if ($DBX) {print " Invalid USACAN prefix 4th digit: |$USprefix|$phone_number|\n";}
}
}
##### Check for valid USA and Canada areacodes #####
if ( ($usacan_areacode_check > 0) && ($valid_lead > 0) )
{
$USarea = substr($phone_number, 0, 3);
$stmtA = "select count(*) from vicidial_phone_codes where areacode='$USarea' and country_code='1';";
if($DBX){print STDERR "\n|$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;
$valid_lead = $aryA[0];
if ($valid_lead < 1)
{
if ($DBX) {print " Invalid USACAN areacode: |$USprefix|$phone_number|\n";}
}
}
$sthA->finish();
}
##### Check for duplicate phone numbers in vicidial_list table entire database #####
if ($dupchecksys > 0)
{
@@ -1718,7 +1766,7 @@ foreach(@FILES)
}
}
if ( (length($phone_number)>6) && ($dup_lead < 1) )
if ( (length($phone_number)>6) && ($dup_lead < 1) && ($valid_lead > 0) )
{
if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) )
{$phone_list .= "$alt_phone$title$US$list_id|";}
@@ -2019,10 +2067,15 @@ foreach(@FILES)
}
else
{
if ($dup_lead > 0)
{if ($q < 1) {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a|$title $alt_phone\n";} $f++;}
if ($valid_lead < 1)
{if ($q < 1) {print "INVALID: $phone_number|$list_id|$dup_lead_list|$a|$title $alt_phone\n";} $h++;}
else
{if ($q < 1) {print "BAD Home_Phone: $phone_number|$vendor_id|$a\n";} $e++;}
{
if ($dup_lead > 0)
{if ($q < 1) {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a|$title $alt_phone\n";} $f++;}
else
{if ($q < 1) {print "BAD Home_Phone: $phone_number|$vendor_id|$a\n";} $e++;}
}
}
$a++;
@@ -2038,7 +2091,7 @@ foreach(@FILES)
if ($a =~ /700$/i) {print STDERR "| $a\r";}
if ($a =~ /800$/i) {print STDERR "+ $a\r";}
if ($a =~ /900$/i) {print STDERR "0 $a\r";}
if ($a =~ /000$/i) {print "$a|$b|$c|$d|$e|$f|$g|$phone_number|\n";}
if ($a =~ /000$/i) {print "$a|$b|$c|$d|$e|$f|$g|$h|$phone_number|\n";}
}
}
@@ -2073,6 +2126,8 @@ foreach(@FILES)
$Falert .= "MULTI-ALT-PHONE: $g\n";
if ($f > 0)
{$Falert .= "DUPLICATES: $f\n";}
if ($h > 0)
{$Falert .= "INVALID PHONES: $h\n";}
if ($q < 1) {print "$Falert";}
print Sout "$Falert";
+1 -1
View File
@@ -1,4 +1,4 @@
AGENT API DOCUMENT Started: 2008-07-03
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2011-04-30
This document describes the functions of an API(Application Programming Interface)
for the VICIDIAL Agent screen. This functionality will be rather limited at first
+7 -3
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2011-05-29
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2011-07-05
This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -59,7 +59,7 @@ Changes:
110424-0854 - Added option for time zone code lookups using owner field in add_lead function
110529-1220 - Added time zone information output to version function
110614-0726 - Added reset_lead option to update_lead function(issue #502)
110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead
@@ -300,6 +300,8 @@ duplicate_check - Check for duplicate records in the system, can select more tha
DUPNAMEPHONELIST - check for duplicate first_name, last_name and phone_number in same list
DUPNAMEPHONECAMP - check for duplicate first_name, last_name and phone_number in all lists for this list's campaign
DUPNAMEPHONESYS - check for duplicate first_name, last_name and phone_number in entire system
usacan_prefix_check - Y or N, default is N. Check for a valid 4th digit for USA and Canada phone numbers (cannot be 0 or 1)
usacan_areacode_check - Y or N, default is N. Check for a valid areacode for USA and Canada phone numbers
custom_fields - Y or N, default is N. Defines whether the API will accept custom field data when inserting leads into the vicidial_list table
For custom fields to be inserted, just add the field label as a variable to the URL string
For example, if the field_label is "favorite_color" you would add "&favorite_color=blue"
@@ -369,7 +371,9 @@ NOTICE: add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED - 7275551111|1234|10
NOTICE: add_lead MULTI-ALT-PHONE NUMBERS LOADED - 3|6666|193716
NOTICE: add_lead NOT ADDED TO HOPPER, OUTSIDE OF LOCAL TIME - 7275551111|6666|193716|-4|0
ERROR: add_lead INVALID PHONE NUMBER - 72755|6666
ERROR: add_lead INVALID PHONE NUMBER LENGTH - 72755|6666
ERROR: add_lead INVALID PHONE NUMBER PREFIX - 72755|6666
ERROR: add_lead INVALID PHONE NUMBER AREACODE - 72755|6666
ERROR: add_lead USER DOES NOT HAVE PERMISSION TO ADD LEADS TO THE SYSTEM - 6666|0
@@ -387,13 +387,13 @@ external_dtmf VARCHAR(100) default '',
external_transferconf VARCHAR(100) default '',
external_park VARCHAR(40) default '',
external_timer_action_destination VARCHAR(100) default '',
on_hook_agent ENUM('Y','N') default 'N',
on_hook_ring_time SMALLINT(5) default '15',
ring_callerid VARCHAR(20) default ''
index (random_id),
index (last_call_time),
index (last_update_time),
index (last_call_finish),
on_hook_agent ENUM('Y','N') default 'N',
on_hook_ring_time SMALLINT(5) default '15',
ring_callerid VARCHAR(20) default ''
);
CREATE TABLE vicidial_auto_calls (
@@ -1408,7 +1408,9 @@ generate_cross_server_exten ENUM('0','1') default '0',
queuemetrics_addmember_enabled ENUM('0','1') default '0',
queuemetrics_dispo_pause VARCHAR(6) default '',
label_hide_field_logs VARCHAR(6) default 'Y',
queuemetrics_pe_phone_append ENUM('0','1') default '0'
queuemetrics_pe_phone_append ENUM('0','1') default '0',
test_campaign_calls ENUM('0','1') default '0',
agents_calls_reset ENUM('0','1') default '1'
);
CREATE TABLE vicidial_campaigns_list_mix (
@@ -2531,7 +2533,7 @@ ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT N
CREATE TABLE vicidial_outbound_ivr_log_archive LIKE vicidial_outbound_ivr_log;
UPDATE system_settings SET db_schema_version='1284',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1285',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+5
View File
@@ -863,3 +863,8 @@ UPDATE system_settings SET db_schema_version='1283',db_schema_update_date=NOW()
ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY') default 'TEXT';
UPDATE system_settings SET db_schema_version='1284',db_schema_update_date=NOW() where db_schema_version < 1284;
ALTER TABLE system_settings ADD test_campaign_calls ENUM('0','1') default '0';
ALTER TABLE system_settings ADD agents_calls_reset ENUM('0','1') default '1';
UPDATE system_settings SET db_schema_version='1285',db_schema_update_date=NOW() where db_schema_version < 1285;
@@ -639,6 +639,13 @@ CAMPAIGNS USING THIS SCREEN LABEL||
QueueMetrics Phone Environment Phone Append||
This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled||
HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data||
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||
Test calling disabled||
PLACE TEST CALL||
Test Outbound Call||
Agents Calls Reset||
This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled||
lead_report_export.php
+3 -3
View File
@@ -2188,7 +2188,7 @@ if ($ACTION == 'manDiaLnextCaLL')
# generate callerID for unique identifier in xfer_log file
$PADlead_id = sprintf("%010s", $lead_id);
while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);}
# Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL
# Create unique calleridname to track the call: MmddhhmmssLLLLLLLLLL
$MqueryCID = "M$CIDdate$PADlead_id";
# DATETIME|campaign|lead_id|phone_number|user|type
@@ -2360,7 +2360,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$use_eac = $row[0];
}
# Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL
# Create unique calleridname to track the call: MmddhhmmssLLLLLLLLLL
$MqueryCID = "M$CIDdate$PADlead_id";
$EAC='';
if ($use_eac > 0)
@@ -2910,7 +2910,7 @@ if ($ACTION == 'manDiaLonly')
$PADlead_id = sprintf("%010s", $lead_id);
while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);}
# Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL
# Create unique calleridname to track the call: MmddhhmmssLLLLLLLLLL
$MqueryCID = "M$CIDdate$PADlead_id";
$EAC='';
if ($use_eac > 0)
+168 -32
View File
@@ -1579,6 +1579,10 @@ if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["stat
elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];}
if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];}
elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];}
if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];}
elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];}
if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];}
elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -1592,7 +1596,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 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 FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -1615,6 +1619,8 @@ if ($qm_conf_ct > 0)
$SSdefault_phone_registration_password =$row[13];
$SSdefault_phone_login_password = $row[14];
$SSdefault_server_password = $row[15];
$SStest_campaign_calls = $row[16];
$SSactive_voicemail_server = $row[17];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -1821,6 +1827,8 @@ if ($non_latin < 1)
$dtmf_log = ereg_replace("[^0-9]","",$dtmf_log);
$callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit);
$queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append);
$test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls);
$agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset);
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
@@ -2770,16 +2778,20 @@ else
# 110624-0842 - Added Export Leads Report links and permissions
# 110624-2246 - Added Screen Labels subsection for Admin and status_display_fields feature
# 110625-2338 - Added queuemetrics_pe_phone_append option
# 110703-1400 - Added test_campaign_calls and agents_calls_reset features
#
# 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-321a';
$build = '110625-2338';
$admin_version = '2.4-322a';
$build = '110703-1400';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
$REPORTdate = date("Y-m-d");
$CIDdate = date("mdHis");
while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);}
$MT[0]='';
$US='_';
$active_lists=0;
@@ -2787,6 +2799,7 @@ $inactive_lists=0;
$modify_refresh_set=0;
$modify_footer_refresh=0;
$check_time = ($STARTtime - 86400);
$SSanswer_transfer_agent = '8368';
$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$past_month_date = date("Y-m-d H:i:s",$month_old);
@@ -7345,6 +7358,11 @@ if ($ADD==99999)
<BR>
<B>Timeclock End Of Day -</B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000.
<BR>
<A NAME="settings-agents_calls_reset">
<BR>
<B>Agents Calls Reset -</B> This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled.
<BR>
<A NAME="settings-timeclock_last_reset_date">
<BR>
@@ -7473,6 +7491,11 @@ if ($ADD==99999)
<BR>
<B>Enable Custom List Fields -</B> This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled.
<BR>
<A NAME="settings-test_campaign_calls">
<BR>
<B>Enable Campaign Test Calls -</B> 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.
<BR>
<A NAME="settings-first_login_trigger">
<BR>
@@ -13470,31 +13493,116 @@ if ($ADD==41)
$lead_order_randomize = 'N';
$lead_order_secondary = 'LEAD_ASCEND';
}
if (ereg('list_activation',$stage))
if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) )
{
$p=0;
echo "<BR>ACTIVE LISTS CHANGED";
$list_active_change_ct = count($list_active_change);
while ($p < $list_active_change_ct)
if (ereg('test_call',$stage))
{
$LIST_ACTIVATE .= "'$list_active_change[$p]',";
$p++;
$p=0;
echo "<BR>TEST CALL:";
if (strlen($phone_number)<6)
{
echo " NOT PLACED, number too small - $phone_number";
}
else
{
### insert a new lead in the system with this phone number
$stmtA = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$manual_dial_list_id',status='CTCALL',user='VDAD',called_since_last_reset='Y',entry_date='$SQLdate',last_local_call_time='$SQLdate',called_count='1',first_name='Test',last_name='Call',address1='Test Call',city='Springfield',state='IL',vendor_lead_code='999999',comments='$campaign_id test call placed $SQLdate',rank='99',owner='Test Outbound Call';";
if ($DB) {echo "$stmtA\n";}
$rslt=mysql_query($stmtA, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id($link);
### LOG INSERTION Admin Log Table, for lead ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';";
$rslt=mysql_query($stmt, $link);
### gather list_id overrides
$stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$CIDor_ct = mysql_num_rows($rslt);
$campaign_cid_override='';
if ($CIDor_ct > 0)
{
$row=mysql_fetch_row($rslt);
$campaign_cid_override = $row[0];
}
$CCID_on=0; $CCID='';
$local_DEF = 'Local/';
$local_AMP = '@';
$Local_out_prefix = '9';
$Local_dial_timeout = '60';
if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;}
$Local_dial_timeout = ($Local_dial_timeout * 1000);
if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";}
if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";}
else {$VDAD_dial_exten = "$SSanswer_transfer_agent";}
if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;}
if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;}
if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';}
if (strlen($ext_context) < 1) {$ext_context='default';}
if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";}
else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
# generate callerID for unique identifier in xfer_log file
$PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);}
# Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL
$VqueryCID = "V$CIDdate$PADlead_id";
if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";}
else {$CIDstring = "$VqueryCID";}
### insert a NEW record to the vicidial_manager table to be processed
$stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')";
$rslt=mysql_query($stmtB, $link);
### insert a SENT record to the vicidial_auto_calls table
$stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')";
$rslt=mysql_query($stmtC, $link);
### LOG INSERTION Admin Log Table, for campaign ###
$SQL_log = "$stmtA|$stmtB|$stmtC|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";}
echo " PLACED TO $phone_code $phone_number\n<BR>";
}
}
$stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rslt=mysql_query($stmtB, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if (ereg('list_activation',$stage))
{
$p=0;
echo "<BR>ACTIVE LISTS CHANGED";
$list_active_change_ct = count($list_active_change);
while ($p < $list_active_change_ct)
{
$LIST_ACTIVATE .= "'$list_active_change[$p]',";
$p++;
}
$stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rslt=mysql_query($stmtB, $link);
if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";}
}
}
else
{
@@ -15910,7 +16018,7 @@ if ($ADD==411111111111111)
}
$reports_use_slave_db = preg_replace("/,$/","",$new_field_value);
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append';";
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset';";
$rslt=mysql_query($stmt, $link);
if ($reload_dialplan_on_servers > 0)
@@ -17058,7 +17166,7 @@ if ($ADD==62)
}
}
$stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VLA_user[$k]','LOGOUT','$VLA_campaign_id[$k]','$NOW_TIME','$now_date_epoch','$VAL_user_group');";
$stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VLA_user[$k]','LOGOUT','$VLA_campaign_id[$k]','$SQLdate','$now_date_epoch','$VAL_user_group');";
if ($DB) {echo "<BR>$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -18850,6 +18958,7 @@ if ($ADD==31)
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$campaign_name = $row[1];
$campaign_active = $row[2];
$dial_status_a = $row[3];
$dial_status_b = $row[4];
$dial_status_c = $row[5];
@@ -19297,7 +19406,7 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Change Date: </td><td align=left>$campaign_changedate &nbsp; $NWB#vicidial_campaigns-campaign_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Login Date: </td><td align=left>$campaign_logindate &nbsp; $NWB#vicidial_campaigns-campaign_logindate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Call Date: </td><td align=left>$campaign_calldate &nbsp; $NWB#vicidial_campaigns-campaign_calldate$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$row[2]</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$campaign_active</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Music-on-Hold: </td><td align=left><input type=text name=park_file_name id=park_file_name size=20 maxlength=100 value=\"$row[10]\"> <a href=\"javascript:launch_moh_chooser('park_file_name','moh',200);\">moh chooser</a> $NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055 value=\"$web_form_address\">$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
if ($SSenable_second_webform > 0)
@@ -20252,11 +20361,6 @@ if ($ADD==31)
echo "<center><b>\n";
if ($display_dialable_count == 'Y')
@@ -20282,6 +20386,33 @@ if ($ADD==31)
echo "<a href=\"./AST_VDADstats.php?group=$campaign_id\">Click here to see a VDAD report for this campaign</a><BR><BR>\n";
}
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($SSoutbound_autodial_active > 0)
{
if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') )
{
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41>\n";
echo "<input type=hidden name=DB value=$DB>\n";
echo "<input type=hidden name=stage value=test_call>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=manual_dial_list_id value=\"$manual_dial_list_id\">\n";
echo "<input type=hidden name=dial_timeout value=\"$dial_timeout\">\n";
echo "<input type=hidden name=dial_prefix value=\"$dial_prefix\">\n";
echo "<input type=hidden name=campaign_cid value=\"$campaign_cid\">\n";
echo "<input type=hidden name=campaign_vdad_exten value=\"$campaign_vdad_exten\">\n";
echo "<input type=hidden name=omit_phone_code value=\"$omit_phone_code\">\n";
echo "Test Outbound Call: ";
echo "code: <input type=text name=phone_code id=phone_code size=4 maxlength=10 value=\"\"> &nbsp; ";
echo "number: <input type=text name=phone_number id=phone_number size=14 maxlength=20 value=\"\"> &nbsp; ";
echo "<input type=submit value=\"PLACE TEST CALL\"> &nbsp; $NWB#settings-test_campaign_calls$NWE</form><br><br>\n";
}
else
{
echo "Test calling disabled<br><br>\n";
}
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin changes to this campaign</a></FONT>\n";
@@ -26836,7 +26967,7 @@ if ($ADD==311111111111111)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append from system_settings;";
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$version = $row[0];
@@ -26928,6 +27059,8 @@ if ($ADD==311111111111111)
$queuemetrics_dispo_pause = $row[86];
$label_hide_field_logs = $row[87];
$queuemetrics_pe_phone_append = $row[88];
$test_campaign_calls = $row[89];
$agents_calls_reset = $row[90];
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111111111111>\n";
@@ -26954,6 +27087,7 @@ if ($ADD==311111111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Transfer Logfile: </td><td align=left><select size=1 name=enable_agc_xfer_log><option>1</option><option>0</option><option selected>$enable_agc_xfer_log</option></select>$NWB#settings-enable_agc_xfer_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Disposition Logfile: </td><td align=left><select size=1 name=enable_agc_dispo_log><option>1</option><option>0</option><option selected>$enable_agc_dispo_log</option></select>$NWB#settings-enable_agc_dispo_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock End Of Day: </td><td align=left><input type=text name=timeclock_end_of_day size=5 maxlength=4 value=\"$timeclock_end_of_day\">$NWB#settings-timeclock_end_of_day$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agents Calls Reset: </td><td align=left><select size=1 name=agents_calls_reset><option>1</option><option>0</option><option selected>$agents_calls_reset</option></select>$NWB#settings-agents_calls_reset$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock Last Auto Logout: </td><td align=left> $timeclock_last_reset_date</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Header Date Format: </td><td align=left><select size=1 name=vdc_header_date_format>\n";
echo "<option>MS_DASH_24HR 2008-06-24 23:59:59</option>\n";
@@ -27070,6 +27204,8 @@ if ($ADD==311111111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Custom List Fields: </td><td align=left><select size=1 name=custom_fields_enabled><option>1</option><option>0</option><option selected>$custom_fields_enabled</option></select>$NWB#settings-custom_fields_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Campaign Test Calls: </td><td align=left><select size=1 name=test_campaign_calls><option>1</option><option>0</option><option selected>$test_campaign_calls</option></select>$NWB#settings-test_campaign_calls$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>First Login Trigger: </td><td align=left><input type=hidden name=first_login_trigger value=\"$first_login_trigger\"> $first_login_trigger &nbsp; $NWB#settings-first_login_trigger$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Phone Registration Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passX name=default_phone_registration_password size=20 maxlength=20 value=\"$default_phone_registration_password\" onkeyup=\"return pwdChanged('reg_passX','reg_pass_imgX');\">$NWB#settings-default_phone_registration_password$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgX src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passX','reg_pass_imgX');\"></td></tr>\n";
@@ -41,10 +41,11 @@
# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any
# 100728-0900 - Filtered uploaded filenames for unsupported characters
# 110424-0926 - Added option for time zone code in the owner field
# 110705-1947 - Added USACAN check for prefix and areacode
#
$version = '2.4-40';
$build = '110424-0926';
$version = '2.4-41';
$build = '110705-1947';
require("dbconnect.php");
@@ -135,6 +136,9 @@ if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_co
$phone_code_override = (preg_replace("/\D/","",$phone_code_override));
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];}
elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];}
# if the didnt select an over ride wipe out in_file
if ( $list_id_override == "in_file" ) { $list_id_override = ""; }
@@ -334,10 +338,10 @@ function openNewWindow(url)
{
window.open (url,"",'width=700,height=300,scrollbars=yes,menubar=yes,address=yes');
}
function ShowProgress(good, bad, total, dup, post)
function ShowProgress(good, bad, total, dup, inv, post)
{
parent.lead_count.document.open();
parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Current file status:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B> &nbsp; </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B> &nbsp; </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>');
parent.lead_count.document.write('<html><body><table border=0 width=200 cellpadding=10 cellspacing=0 align=center valign=top><tr bgcolor="#000000"><th colspan=2><font face="arial, helvetica" size=3 color=white>Current file status:</font></th></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Good:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+good+'</B></font></td></tr><tr bgcolor="#990000"><td align=right><font face="arial, helvetica" size=2 color=white><B>Bad:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+bad+'</B></font></td></tr><tr bgcolor="#000099"><td align=right><font face="arial, helvetica" size=2 color=white><B>Total:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+total+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B> &nbsp; </B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B> &nbsp; </B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Duplicate:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+dup+'</B></font></td></tr></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Invalid:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+inv+'</B></font></td></tr><tr bgcolor="#009900"><td align=right><font face="arial, helvetica" size=2 color=white><B>Postal Match:</B></font></td><td align=left><font face="arial, helvetica" size=2 color=white><B>'+post+'</B></font></td></tr></table><body></html>');
parent.lead_count.document.close();
}
function ParseFileName()
@@ -427,7 +431,7 @@ if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) )
<td align=right><B><font face="arial, helvetica" size=2>File layout to use:</font></B></td>
<td align=left><font face="arial, helvetica" size=2><input type=radio name="file_layout" value="standard" checked>Standard Format&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name="file_layout" value="custom">Custom layout</td>
</tr>
<tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Duplicate Check: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=dupcheck>
<option selected value="NONE">NO DUPLICATE CHECK</option>
@@ -438,6 +442,15 @@ if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard") ) )
<option value="DUPTITLEALTPHONESYS">CHECK FOR DUPLICATES BY TITLE/ALT-PHONE IN ENTIRE SYSTEM</option>
</select></td>
</tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2>USA-Canada Check: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=usacan_check>
<option selected value="NONE">NO USACAN VALID CHECK</option>
<option value="PREFIX">CHECK FOR VALID PREFIX</option>
<option value="AREACODE">CHECK FOR VALID AREACODE</option>
<option value="PREFIX_AREACODE">CHECK FOR VALID PREFIX and AREACODE</option>
</select></td>
</tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Time Zone Lookup: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=postalgmt><option selected value="AREA">COUNTRY CODE AND AREA CODE ONLY</option><option value="POSTAL">POSTAL CODE FIRST</option><option value="TZCODE">OWNER TIME ZONE CODE FIRST</option></select></td>
@@ -468,6 +481,10 @@ else
<td align=left width="75%"><font face="arial, helvetica" size=2><?php echo $phone_code_override ?></font></td>
</tr>
<tr>
<td align=right width="35%"><B><font face="arial, helvetica" size=2>USA-Canada Check:</font></B></td>
<td align=left width="75%"><font face="arial, helvetica" size=2><?php echo $usacan_check ?></font></td>
</tr>
<tr>
<td align=right width="35%"><B><font face="arial, helvetica" size=2>Lead Duplicate Check:</font></B></td>
<td align=left width="75%"><font face="arial, helvetica" size=2><?php echo $dupcheck ?></font></td>
</tr>
@@ -815,8 +832,37 @@ if ($OK_to_process)
}
}
$valid_number=1;
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
{
$valid_number=0;
$invalid_reason = "INVALID PHONE NUMBER LENGTH";
}
if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";}
if ($USprefix < 2)
{
$valid_number=0;
$invalid_reason = "INVALID PHONE NUMBER PREFIX";
}
}
if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) )
{
$phone_areacode = substr($phone_number, 0, 3);
$stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';";
if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$valid_number=$row[0];
if ($valid_number < 1)
{
$invalid_reason = "INVALID PHONE NUMBER AREACODE";
}
}
if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 ))
if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 ))
{
if (strlen($phone_code)<1) {$phone_code = '1';}
@@ -873,7 +919,14 @@ if ($OK_to_process)
}
else
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";
if ($valid_number < 1)
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number</font><b>\n";
}
else
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";
}
}
}
$bad++;
@@ -881,7 +934,7 @@ if ($OK_to_process)
$total++;
if ($total%100==0)
{
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup, $post)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup, $inv, $post)</script>";
usleep(1000);
flush();
}
@@ -1196,7 +1249,37 @@ if (($leadfile) && ($LF_path))
}
}
if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 ))
$valid_number=1;
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
{
$valid_number=0;
$invalid_reason = "INVALID PHONE NUMBER LENGTH";
}
if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
if ($DB>0) {echo "DEBUG: usacan prefix check - $USprefix|$phone_number\n";}
if ($USprefix < 2)
{
$valid_number=0;
$invalid_reason = "INVALID PHONE NUMBER PREFIX";
}
}
if ( (preg_match("/AREACODE/",$usacan_check)) and ($valid_number > 0) )
{
$phone_areacode = substr($phone_number, 0, 3);
$stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';";
if ($DB>0) {echo "DEBUG: usacan areacode query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$valid_number=$row[0];
if ($valid_number < 1)
{
$invalid_reason = "INVALID PHONE NUMBER AREACODE";
}
}
if ( ($valid_number>0) and ($dup_lead<1) and ($list_id >= 100 ))
{
if (strlen($phone_code)<1) {$phone_code = '1';}
@@ -1234,7 +1317,14 @@ if (($leadfile) && ($LF_path))
}
else
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";
if ($valid_number < 1)
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| INV: $phone_number</font><b>\n";
}
else
{
print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";
}
}
}
$bad++;
@@ -1242,7 +1332,7 @@ if (($leadfile) && ($LF_path))
$total++;
if ($total%100==0)
{
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup, $post)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup, $inv, $post)</script>";
usleep(1000);
flush();
}
@@ -1422,6 +1512,7 @@ if (($leadfile) && ($LF_path))
}
print " <tr bgcolor='#330099'>\r\n";
print " <input type=hidden name=dupcheck value=\"$dupcheck\">\r\n";
print " <input type=hidden name=usacan_check value=\"$usacan_check\">\r\n";
print " <input type=hidden name=postalgmt value=\"$postalgmt\">\r\n";
print " <input type=hidden name=lead_file value=\"$lead_file\">\r\n";
print " <input type=hidden name=list_id_override value=\"$list_id_override\">\r\n";
+39 -4
View File
@@ -49,10 +49,11 @@
# 110424-0854 - Added option for time zone code lookups using owner field
# 110529-1220 - Added time zone information output to version function
# 110614-0726 - Added reset_lead option to update_lead function(issue #502)
# 110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead
#
$version = '2.4-35';
$build = '110614-0726';
$version = '2.4-36';
$build = '110705-1928';
$startMS = microtime();
@@ -245,8 +246,12 @@ if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];}
elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];}
if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];}
if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];}
elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];}
if (isset($_GET["usacan_areacode_check"])) {$usacan_areacode_check=$_GET["usacan_areacode_check"];}
elseif (isset($_POST["usacan_areacode_check"])) {$usacan_areacode_check=$_POST["usacan_areacode_check"];}
if (isset($_GET["usacan_prefix_check"])) {$usacan_prefix_check=$_GET["usacan_prefix_check"];}
elseif (isset($_POST["usacan_prefix_check"])) {$usacan_prefix_check=$_POST["usacan_prefix_check"];}
header ("Content-type: text/html; charset=utf-8");
@@ -374,6 +379,8 @@ if ($non_latin < 1)
$uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid);
$tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method);
$reset_lead = ereg_replace("[^A-Z]","",$reset_lead);
$usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check);
$usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check);
}
else
{
@@ -2517,10 +2524,38 @@ if ($function == 'add_lead')
if (strlen($list_id)<3) {$list_id='999';}
if (strlen($phone_code)<1) {$phone_code='1';}
$valid_number=1;
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
{
$valid_number=0;
$result_reason = "add_lead INVALID PHONE NUMBER LENGTH";
}
if ( ($usacan_prefix_check=='Y') and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
if ($DB>0) {echo "DEBUG: add_lead prefix check - $USprefix|$phone_number\n";}
if ($USprefix < 2)
{
$valid_number=0;
$result_reason = "add_lead INVALID PHONE NUMBER PREFIX";
}
}
if ( ($usacan_areacode_check=='Y') and ($valid_number > 0) )
{
$phone_areacode = substr($phone_number, 0, 3);
$stmt = "select count(*) from vicidial_phone_codes where areacode='$phone_areacode' and country_code='1';";
if ($DB>0) {echo "DEBUG: add_lead areacode check query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$valid_number=$row[0];
if ($valid_number < 1)
{
$result_reason = "add_lead INVALID PHONE NUMBER AREACODE";
}
}
if ($valid_number < 1)
{
$result = 'ERROR';
$result_reason = "add_lead INVALID PHONE NUMBER";
echo "$result: $result_reason - $phone_number|$user\n";
$data = "$phone_number";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);