Added the system setting USA-Canada Phone Number Dialcode Fix which will trigger a process that will run at the Timeclock End of Day that will check all phone numbers to populate the dial code, or phone code, field
with a 1 if it is missing as well as remove a leading 1 from the phone number field if it is present. Added --lstn-buffer option to keepalive script to run special enhanced buffer version of the Listen process. Requires newer Net::Telnet perl module version. git-svn-id: svn://192.168.202.10@2405 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -175,6 +175,16 @@ OTHER CHANGES:
|
||||
allows you to prevent the use of a status by an agent if they have
|
||||
talked to a customer less than X seconds or more than Y seconds.
|
||||
|
||||
43. Added the system setting USA-Canada Phone Number Dialcode Fix which will
|
||||
trigger a process that will run at the Timeclock End of Day that will
|
||||
check all phone numbers to populate the dial code, or phone code, field
|
||||
with a 1 if it is missing as well as remove a leading 1 from the phone
|
||||
number field if it is present.
|
||||
|
||||
44. Added --lstn-buffer option to keepalive script to run special enhanced
|
||||
buffer version of the Listen process. Requires newer Net::Telnet perl
|
||||
module version.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -101,9 +101,10 @@
|
||||
# 150307-1738 - Added custom meetme enter sounds(only works with Asterisk 1.8)
|
||||
# 150724-0835 - Added purge of vicidial_ajax_log records older than 7 days to end of day process
|
||||
# 150804-0919 - Added whisper extensions
|
||||
# 151031-0931 - Added usacan_phone_dialcode_fix feature at timeclock-end-of-day, added -lstn-buffer option
|
||||
#
|
||||
|
||||
$build = '150804-0919';
|
||||
$build = '151031-0931';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
|
||||
@@ -190,6 +191,7 @@ if (length($ARGV[0])>1)
|
||||
print " [-adfill-delay=X] = setting delay milliseconds on auto-dial FILL process\n";
|
||||
print " [-fill-staggered] = enable experimental staggered auto-dial FILL process\n";
|
||||
print " [-cu3way] = keepalive for the optional 3way conference checker\n";
|
||||
print " [-lstn-buffer] = use special enhanced telnet buffer listen process\n";
|
||||
print " [-cu3way-delay=X] = setting delay seconds on 3way conference checker\n";
|
||||
print " [-debug] = verbose debug messages\n";
|
||||
print " [-debugX] = Extra-verbose debug messages\n";
|
||||
@@ -258,6 +260,11 @@ if (length($ARGV[0])>1)
|
||||
$cu3way=1;
|
||||
if ($DB > 0) {print "\n----- cu3way ENABLED -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-lstn-buffer/i)
|
||||
{
|
||||
$lstn_buffer=1;
|
||||
if ($DB > 0) {print "\n----- lstn_buffer ENABLED -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-cu3way-delay=/i) # CLI defined delay
|
||||
{
|
||||
@CLIvarARY = split(/-cu3way-delay=/,$args);
|
||||
@@ -667,7 +674,10 @@ else
|
||||
{
|
||||
if ($DB) {print "starting AST_manager_listen...\n";}
|
||||
# add a '-L' to the command below to activate logging
|
||||
`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listen.pl`;
|
||||
if ($lstn_buffer > 0)
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listenBUFFER.pl`;}
|
||||
else
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listen.pl`;}
|
||||
}
|
||||
if ( ($AST_VDauto_dial > 0) && ($runningAST_VDauto_dial < 1) )
|
||||
{
|
||||
@@ -800,7 +810,7 @@ $sthA->finish();
|
||||
|
||||
if ($timeclock_end_of_day_NOW > 0)
|
||||
{
|
||||
$stmtA = "SELECT agents_calls_reset from system_settings;";
|
||||
$stmtA = "SELECT agents_calls_reset,usacan_phone_dialcode_fix 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;
|
||||
@@ -808,7 +818,8 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
if ($SSsel_ct > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$agents_calls_reset = $aryA[0];
|
||||
$agents_calls_reset = $aryA[0];
|
||||
$usacan_phone_dialcode_fix = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
@@ -1270,7 +1281,6 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
##### END ra stats end of day process #####
|
||||
|
||||
|
||||
|
||||
##### BEGIN vicidial_ajax_log end of day process removing records older than 7 days #####
|
||||
$stmtA = "DELETE from vicidial_ajax_log where db_time < \"$SDSQLdate\";";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
@@ -1288,6 +1298,29 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
##### END vicidial_ajax_log end of day process removing records older than 7 days #####
|
||||
|
||||
|
||||
##### BEGIN usacan_phone_dialcode_fix funciton #####
|
||||
if ($usacan_phone_dialcode_fix > 0)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_list SET phone_code='1' where phone_code!='1';";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$PCaffected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$PCaffected_rows vicidial_list.phone_code entries set to 1|\n";}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list SET phone_number = TRIM(LEADING '1' from phone_number) where char_length(phone_number) > 10 and phone_number LIKE \"1%\";";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$PNaffected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$PNaffected_rows vicidial_list phone_number leading 1 entries trimmed|\n";}
|
||||
|
||||
if ( ($PCaffected_rows > 0) or ($PNaffected_rows > 0) )
|
||||
{
|
||||
if ($DB) {print "restarting Asterisk process...\n";}
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='SERVERS', event_type='MODIFY', record_id='leads', event_code='USACAN PHONE DIALCODE FIX', event_sql='', event_notes='$PCaffected_rows vicidial_list.phone_code entries set to 1|$PNaffected_rows vicidial_list phone_number leading 1 entries trimmed|';";
|
||||
$Laffected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "Admin log of USACAN phone code fix: |$Laffected_rows|$stmtA|\n";}
|
||||
}
|
||||
}
|
||||
##### END usacan_phone_dialcode_fix funciton #####
|
||||
|
||||
|
||||
$dbhC = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_custom_user", "$VARDB_custom_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
# 141219-1137 - Change to keepalive processes to not run at busy times and not drop buffer
|
||||
# 150610-1200 - Added support for AMI version 1.3
|
||||
# 150709-1506 - Added DTMF logging for Asterisk 1.8 and higher
|
||||
# 151031-0918 - Added better capture of errors in telnet connection, other small fixes
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -253,6 +254,14 @@ while($one_day_interval > 0)
|
||||
$read_input_buf = $tn->get(Errmode => Return, Timeout => 1,);
|
||||
$input_buf_length = length($read_input_buf);
|
||||
$msg = $tn->errmsg;
|
||||
if (($msg =~ /read timed-out/i) || ( $msg eq '' ))
|
||||
{
|
||||
# This is normal
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ERRMSG: |$msg|\n";
|
||||
}
|
||||
if ($msg =~ /filehandle isn\'t open/i)
|
||||
{
|
||||
$endless_loop=0;
|
||||
@@ -833,7 +842,10 @@ while($one_day_interval > 0)
|
||||
{
|
||||
$keepalive_skips=0;
|
||||
@keepalive_output = $tn->cmd(String => "Action: Command\nCommand: show uptime\n\n", Prompt => '/--END COMMAND--.*/', Errmode => Return, Timeout => 1);
|
||||
if($DB){print "keepalive length: $#keepalive_output|$now_date\n";}
|
||||
$msg = $tn->errmsg;
|
||||
$buf_ref = $tn->buffer;
|
||||
$buf_len = length( $$buf_ref );
|
||||
if($DB){print "keepalive length: $#keepalive_output|$now_date|$msg|$buf_len|\n";}
|
||||
|
||||
if($DB){print "+++++++++++++++++++++++++++++++sending keepalive transmit line: $keepalive_sec seconds $endless_loop|$now_date|$last_update|\n";}
|
||||
|
||||
@@ -845,16 +857,19 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$manager_string="PROCESS: keepalive length: $#keepalive_output|$k|$now_date";
|
||||
&manager_output_logger;
|
||||
$last_keepalive_epoch = time();
|
||||
}
|
||||
else
|
||||
{
|
||||
$keepalive_skips++;
|
||||
if($DB){print "-------------------------------no keepalive transmit necessary: $keepalive_sec seconds($keepalive_skips in a row) $endless_loop|$now_date|$last_update|\n";}
|
||||
$buf_ref = $tn->buffer;
|
||||
$buf_len = length( $$buf_ref );
|
||||
if($DB){print "-------------------------------no keepalive transmit necessary: $keepalive_sec seconds($keepalive_skips in a row) $endless_loop|$now_date|$last_update|$buf_len|\n";}
|
||||
|
||||
$manager_string="PROCESS: keepalive skip: $keepalive_sec seconds($keepalive_skips in a row)|$now_date";
|
||||
&manager_output_logger;
|
||||
}
|
||||
$last_keepalive_epoch = time();
|
||||
#$last_keepalive_epoch = time();
|
||||
$keepalive_count_loop=0;
|
||||
}
|
||||
}
|
||||
@@ -873,6 +888,14 @@ while($one_day_interval > 0)
|
||||
$read_input_buf = $tn->get(Errmode => Return, Timeout => 1,);
|
||||
$input_buf_length = length($read_input_buf);
|
||||
$msg = $tn->errmsg;
|
||||
if (($msg =~ /read timed-out/i) || ( $msg eq '' ))
|
||||
{
|
||||
# This is normal
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ERRMSG: |$msg|\n";
|
||||
}
|
||||
if ($msg =~ /filehandle isn\'t open/i)
|
||||
{
|
||||
$endless_loop=0;
|
||||
@@ -1361,7 +1384,10 @@ while($one_day_interval > 0)
|
||||
{
|
||||
$keepalive_skips=0;
|
||||
@keepalive_output = $tn->cmd(String => "Action: Command\nCommand: core show uptime\n\n", Prompt => '/--END COMMAND--.*/', Errmode => Return, Timeout => 1);
|
||||
if($DB){print "keepalive length: $#keepalive_output|$now_date\n";}
|
||||
$msg = $tn->errmsg;
|
||||
$buf_ref = $tn->buffer;
|
||||
$buf_len = length( $$buf_ref );
|
||||
if($DB){print "keepalive length: $#keepalive_output|$now_date|$msg|$buf_len|\n";}
|
||||
|
||||
if($DB){print "+++++++++++++++++++++++++++++++sending keepalive transmit line: $keepalive_sec seconds $endless_loop|$now_date|$last_update|\n";}
|
||||
|
||||
@@ -1373,16 +1399,19 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$manager_string="PROCESS: keepalive length: $#keepalive_output|$k|$now_date";
|
||||
&manager_output_logger;
|
||||
$last_keepalive_epoch = time();
|
||||
}
|
||||
else
|
||||
{
|
||||
$keepalive_skips++;
|
||||
if($DB){print "-------------------------------no keepalive transmit necessary: $keepalive_sec seconds($keepalive_skips in a row) $endless_loop|$now_date|$last_update|\n";}
|
||||
$buf_ref = $tn->buffer;
|
||||
$buf_len = length( $$buf_ref );
|
||||
if($DB){print "-------------------------------no keepalive transmit necessary: $keepalive_sec seconds($keepalive_skips in a row) $endless_loop|$now_date|$last_update|$buf_len|\n";}
|
||||
|
||||
$manager_string="PROCESS: keepalive skip: $keepalive_sec seconds($keepalive_skips in a row)|$now_date";
|
||||
&manager_output_logger;
|
||||
}
|
||||
$last_keepalive_epoch = time();
|
||||
#$last_keepalive_epoch = time();
|
||||
|
||||
$keepalive_count_loop=0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1620,7 +1620,8 @@ agent_debug_logging VARCHAR(20) default '0',
|
||||
default_language VARCHAR(100) default 'default English',
|
||||
agent_whisper_enabled ENUM('0','1') default '0',
|
||||
user_hide_realtime_enabled ENUM('0','1') default '0',
|
||||
custom_reports_use_slave_db VARCHAR(2000) default ''
|
||||
custom_reports_use_slave_db VARCHAR(2000) default '',
|
||||
usacan_phone_dialcode_fix ENUM('0','1') default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -3603,4 +3604,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1433',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1434',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -340,3 +340,7 @@ UNIQUE KEY custom_report_name_key (report_name)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1433',db_schema_update_date=NOW() where db_schema_version < 1433;
|
||||
|
||||
ALTER TABLE system_settings ADD usacan_phone_dialcode_fix ENUM('0','1') default '0';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1434',db_schema_update_date=NOW() where db_schema_version < 1434;
|
||||
|
||||
+11
-4
File diff suppressed because one or more lines are too long
@@ -64,6 +64,7 @@
|
||||
# 150926-1058 - Added did_carrier_description
|
||||
# 151006-0935 - Updated campaign_cid_areacodes entry
|
||||
# 151020-0704 - Added Status Groups and Custom Reports entries
|
||||
# 151030-0639 - Added usacan_phone_dialcode_fix entry
|
||||
#
|
||||
|
||||
|
||||
@@ -4813,6 +4814,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Generate Cross-Server Phone Extensions"); ?> -</B><?php echo _QXZ("This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-usacan_phone_dialcode_fix">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("USA-Canada Phone Number Dialcode Fix"); ?> -</B><?php echo _QXZ("This option if set to 1 will trigger a process that will run at the Timeclock End of Day and will check all phone numbers to populate the dial code, or phone code, field with a 1 if it is missing as well as remove a leading 1 from the phone number field if it is present. Default is 0 for inactive."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-user_territories_active">
|
||||
<BR>
|
||||
|
||||
Reference in New Issue
Block a user