Added twoday_ log tables and AST_twoday_tables_control.pl script
Fixed Re-Queue bug and INBOUND_MAN blended checkbox display git-svn-id: svn://192.168.202.10@1196 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -173,6 +173,13 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
43. Added ViciDial Balance Rank for servers to allow prioritizing the servers
|
||||
that will dial the FILL calls in a multi-server cluster
|
||||
|
||||
44. Added optional twoday_ log tables which give you a safer place to be pulling
|
||||
slightly less than real-time information from log tables without locking
|
||||
the live log tables. there are 6 twoday_ log tables: recording_log,
|
||||
call_log, vicidial_log, vicidial_closer_log, vicidial_xfer_log and
|
||||
vicidial_agent_log
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_twoday_tables_control.pl version 2.2.0
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# populates the twoday_ log tables during the day, and purges them at night
|
||||
#
|
||||
# crontab entry example:
|
||||
# two-day processes
|
||||
#0,5,10,15,20,25,30,35,40,45,50,55 0,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * * /usr/share/astguiclient/AST_twoday_tables_control.pl --insert
|
||||
#31 2 * * * /usr/share/astguiclient/AST_twoday_tables_control.pl --purge
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 90729-0951 - First build
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
$i=0;
|
||||
while ($#ARGV >= $i)
|
||||
{
|
||||
$args = "$args $ARGV[$i]";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options:\n";
|
||||
print " [--help] = this screen\n";
|
||||
print " [-t] = test\n";
|
||||
print " [-debug] = verbose debug messages\n";
|
||||
print " [-q] = quiet\n";
|
||||
print " [-insert] = run inserts, grab records in the past hour\n";
|
||||
print " [-purge] = purge records more than 24 hours old\n";
|
||||
print "\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($args =~ /-q/i)
|
||||
{
|
||||
$Q=1;
|
||||
}
|
||||
if ($args =~ /-insert/i)
|
||||
{
|
||||
$insert=1;
|
||||
}
|
||||
if ($args =~ /-purge/i)
|
||||
{
|
||||
$purge=1;
|
||||
}
|
||||
if ($args =~ /-debug/i)
|
||||
{
|
||||
$DB=1; # Debug flag, set to 0 for no debug messages, On an active system this will generate hundreds of lines of output per minute
|
||||
}
|
||||
if ($args =~ /-t/i)
|
||||
{
|
||||
$TEST=1;
|
||||
$T=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($Q < 1) {print "no command line options set\n";}
|
||||
}
|
||||
### end parsing run-time options ###
|
||||
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||
@conf = <conf>;
|
||||
close(conf);
|
||||
$i=0;
|
||||
foreach(@conf)
|
||||
{
|
||||
$line = $conf[$i];
|
||||
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||
if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) )
|
||||
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) )
|
||||
{$PATHagi = $line; $PATHagi =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) )
|
||||
{$PATHweb = $line; $PATHweb =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
|
||||
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) )
|
||||
{$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) )
|
||||
{$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) )
|
||||
{$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) )
|
||||
{$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) )
|
||||
{$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) )
|
||||
{$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
|
||||
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
|
||||
$i++;
|
||||
}
|
||||
|
||||
# Customized Variables
|
||||
$server_ip = $VARserver_ip; # Asterisk server IP
|
||||
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
$secX = time();
|
||||
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
$year = ($year + 1900);
|
||||
$mon++;
|
||||
if ($mon < 10) {$mon = "0$mon";}
|
||||
if ($mday < 10) {$mday = "0$mday";}
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
$filedate = "$year$mon$mday-$hour$min$sec";
|
||||
$ABIfiledate = "$mon-$mday-$year$us$hour$min$sec";
|
||||
$shipdate = "$year-$mon-$mday";
|
||||
$datestamp = "$year/$mon/$mday $hour:$min";
|
||||
|
||||
use Time::Local;
|
||||
|
||||
$secX = time();
|
||||
|
||||
$HHtarget = ($secX - 7200); # 2 hours
|
||||
($Hsec,$Hmin,$Hhour,$Hmday,$Hmon,$Hyear,$Hwday,$Hyday,$Hisdst) = localtime($HHtarget);
|
||||
$Hyear = ($Hyear + 1900);
|
||||
$Hmon++;
|
||||
if ($Hmon < 10) {$Hmon = "0$Hmon";}
|
||||
if ($Hmday < 10) {$Hmday = "0$Hmday";}
|
||||
if ($Hhour < 10) {$Hhour = "0$Hhour";}
|
||||
if ($Hmin < 10) {$Hmin = "0$Hmin";}
|
||||
if ($Hsec < 10) {$Hsec = "0$Hsec";}
|
||||
$HHSQLdate = "$Hyear-$Hmon-$Hmday $Hhour:$Hmin:$Hsec";
|
||||
|
||||
$YDtarget = ($secX - 86400); # 24 hours
|
||||
($Ysec,$Ymin,$Yhour,$Ymday,$Ymon,$Yyear,$Ywday,$Yyday,$Yisdst) = localtime($YDtarget);
|
||||
$Yyear = ($Yyear + 1900);
|
||||
$Ymon++;
|
||||
if ($Ymon < 10) {$Ymon = "0$Ymon";}
|
||||
if ($Ymday < 10) {$Ymday = "0$Ymday";}
|
||||
if ($Yhour < 10) {$Yhour = "0$Yhour";}
|
||||
if ($Ymin < 10) {$Ymin = "0$Ymin";}
|
||||
if ($Ysec < 10) {$Ysec = "0$Ysec";}
|
||||
$YDSQLdate = "$Yyear-$Ymon-$Ymday $Yhour:$Ymin:$Ysec";
|
||||
|
||||
|
||||
################################ INSERT PROCESS
|
||||
if ($insert > 0)
|
||||
{
|
||||
$stmtA = "INSERT IGNORE INTO twoday_call_log SELECT * from call_log where start_time > '$HHSQLdate' ON DUPLICATE KEY UPDATE end_time=VALUES(end_time),end_epoch=VALUES(end_epoch),length_in_sec=VALUES(length_in_sec),length_in_min=VALUES(length_in_min);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO twoday_vicidial_log SELECT * from vicidial_log where call_date > '$HHSQLdate' ON DUPLICATE KEY UPDATE end_epoch=VALUES(end_epoch),length_in_sec=VALUES(length_in_sec),status=VALUES(status),user=VALUES(user),comments=VALUES(comments),user_group=VALUES(user_group),term_reason=VALUES(term_reason),alt_dial=VALUES(alt_dial);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO twoday_vicidial_closer_log SELECT * from vicidial_closer_log where call_date > '$HHSQLdate' ON DUPLICATE KEY UPDATE list_id=VALUES(list_id),campaign_id=VALUES(campaign_id),end_epoch=VALUES(end_epoch),length_in_sec=VALUES(length_in_sec),status=VALUES(status),user=VALUES(user),comments=VALUES(comments),queue_seconds=VALUES(queue_seconds),user_group=VALUES(user_group),xfercallid=VALUES(xfercallid),term_reason=VALUES(term_reason),uniqueid=VALUES(uniqueid),agent_only=VALUES(agent_only);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO twoday_recording_log SELECT * from recording_log where start_time > '$HHSQLdate' ON DUPLICATE KEY UPDATE end_time=VALUES(end_time),end_epoch=VALUES(end_epoch),length_in_sec=VALUES(length_in_sec),length_in_min=VALUES(length_in_min),filename=VALUES(filename),location=VALUES(location),lead_id=VALUES(lead_id),user=VALUES(user),vicidial_id=VALUES(vicidial_id);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO twoday_vicidial_xfer_log SELECT * from vicidial_xfer_log where call_date > '$HHSQLdate' ON DUPLICATE KEY UPDATE list_id=VALUES(list_id),campaign_id=VALUES(campaign_id),call_date=VALUES(call_date),user=VALUES(user),closer=VALUES(closer);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO twoday_vicidial_agent_log SELECT * from vicidial_agent_log where event_time > '$HHSQLdate' ON DUPLICATE KEY UPDATE lead_id=VALUES(lead_id),campaign_id=VALUES(campaign_id),pause_epoch=VALUES(pause_epoch),pause_sec=VALUES(pause_sec),wait_epoch=VALUES(wait_epoch),wait_sec=VALUES(wait_sec),talk_epoch=VALUES(talk_epoch),talk_sec=VALUES(talk_sec),dispo_epoch=VALUES(dispo_epoch),dispo_sec=VALUES(dispo_sec),status=VALUES(status),user_group=VALUES(user_group),comments=VALUES(comments),sub_status=VALUES(sub_status);";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
################################ PURGE PROCESS
|
||||
if ($purge > 0)
|
||||
{
|
||||
##### PURGE RECORDS OLDER THAN 24 HOURS
|
||||
$stmtA = "DELETE FROM twoday_call_log where start_time < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM twoday_vicidial_log where call_date < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM twoday_vicidial_closer_log where call_date < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM twoday_recording_log where start_time < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM twoday_vicidial_xfer_log where call_date < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM twoday_vicidial_agent_log where event_time < '$YDSQLdate';";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
|
||||
##### OPTIMIZE TABLES
|
||||
$stmtA = "OPTIMIZE TABLE twoday_call_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "OPTIMIZE TABLE twoday_vicidial_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "OPTIMIZE TABLE twoday_vicidial_closer_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "OPTIMIZE TABLE twoday_recording_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "OPTIMIZE TABLE twoday_vicidial_xfer_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "OPTIMIZE TABLE twoday_vicidial_agent_log;";
|
||||
if (!$T)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print "\n|$affected_rows records changed|$stmtA|\n";}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
if ($DB > 0)
|
||||
{
|
||||
$secY=time();
|
||||
$seconds = ($secY - $secX);
|
||||
print "Finished, $seconds seconds\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
@@ -1639,6 +1639,136 @@ index (parameter)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE twoday_call_log (
|
||||
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
channel VARCHAR(100),
|
||||
channel_group VARCHAR(30),
|
||||
type VARCHAR(10),
|
||||
server_ip VARCHAR(15),
|
||||
extension VARCHAR(100),
|
||||
number_dialed VARCHAR(15),
|
||||
caller_code VARCHAR(20),
|
||||
start_time DATETIME,
|
||||
start_epoch INT(10),
|
||||
end_time DATETIME,
|
||||
end_epoch INT(10),
|
||||
length_in_sec INT(10),
|
||||
length_in_min DOUBLE(8,2),
|
||||
index (caller_code),
|
||||
index (server_ip),
|
||||
index (channel)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_log (
|
||||
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(8),
|
||||
call_date DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec INT(10),
|
||||
status VARCHAR(6),
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
comments VARCHAR(255),
|
||||
processed ENUM('Y','N'),
|
||||
user_group VARCHAR(20),
|
||||
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE',
|
||||
alt_dial VARCHAR(6) default 'NONE',
|
||||
index (lead_id),
|
||||
index (call_date)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_closer_log (
|
||||
closecallid INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(20),
|
||||
call_date DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec INT(10),
|
||||
status VARCHAR(6),
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
comments VARCHAR(255),
|
||||
processed ENUM('Y','N'),
|
||||
queue_seconds DECIMAL(7,2) default '0',
|
||||
user_group VARCHAR(20),
|
||||
xfercallid INT(9) UNSIGNED,
|
||||
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRECALLXFER','HOLDTIME','NOAGENT','NONE') default 'NONE',
|
||||
uniqueid VARCHAR(20) NOT NULL default '',
|
||||
agent_only VARCHAR(20) default '',
|
||||
index (lead_id),
|
||||
index (call_date),
|
||||
index (campaign_id),
|
||||
index (uniqueid)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_xfer_log (
|
||||
xfercallid INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(20),
|
||||
call_date DATETIME,
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
closer VARCHAR(20),
|
||||
index (lead_id),
|
||||
index (call_date)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_recording_log (
|
||||
recording_id INT(10) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
channel VARCHAR(100),
|
||||
server_ip VARCHAR(15),
|
||||
extension VARCHAR(100),
|
||||
start_time DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_time DATETIME,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec MEDIUMINT(8) UNSIGNED,
|
||||
length_in_min DOUBLE(8,2),
|
||||
filename VARCHAR(50),
|
||||
location VARCHAR(255),
|
||||
lead_id INT(9) UNSIGNED,
|
||||
user VARCHAR(20),
|
||||
vicidial_id VARCHAR(20),
|
||||
index(filename),
|
||||
index(lead_id),
|
||||
index(user),
|
||||
index(vicidial_id)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_agent_log (
|
||||
agent_log_id INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
user VARCHAR(20),
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
event_time DATETIME,
|
||||
lead_id INT(9) UNSIGNED,
|
||||
campaign_id VARCHAR(8),
|
||||
pause_epoch INT(10) UNSIGNED,
|
||||
pause_sec SMALLINT(5) UNSIGNED default '0',
|
||||
wait_epoch INT(10) UNSIGNED,
|
||||
wait_sec SMALLINT(5) UNSIGNED default '0',
|
||||
talk_epoch INT(10) UNSIGNED,
|
||||
talk_sec SMALLINT(5) UNSIGNED default '0',
|
||||
dispo_epoch INT(10) UNSIGNED,
|
||||
dispo_sec SMALLINT(5) UNSIGNED default '0',
|
||||
status VARCHAR(6),
|
||||
user_group VARCHAR(20),
|
||||
comments VARCHAR(20),
|
||||
sub_status VARCHAR(6),
|
||||
index (lead_id),
|
||||
index (user),
|
||||
index (event_time)
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||
|
||||
ALTER TABLE live_channels ENGINE=HEAP;
|
||||
@@ -1759,7 +1889,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number);
|
||||
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
|
||||
CREATE INDEX comment_a on live_inbound_log (comment_a);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1165';
|
||||
UPDATE system_settings SET db_schema_version='1166';
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -346,3 +346,134 @@ index (parameter)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1165';
|
||||
|
||||
CREATE TABLE twoday_call_log (
|
||||
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
channel VARCHAR(100),
|
||||
channel_group VARCHAR(30),
|
||||
type VARCHAR(10),
|
||||
server_ip VARCHAR(15),
|
||||
extension VARCHAR(100),
|
||||
number_dialed VARCHAR(15),
|
||||
caller_code VARCHAR(20),
|
||||
start_time DATETIME,
|
||||
start_epoch INT(10),
|
||||
end_time DATETIME,
|
||||
end_epoch INT(10),
|
||||
length_in_sec INT(10),
|
||||
length_in_min DOUBLE(8,2),
|
||||
index (caller_code),
|
||||
index (server_ip),
|
||||
index (channel)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_log (
|
||||
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(8),
|
||||
call_date DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec INT(10),
|
||||
status VARCHAR(6),
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
comments VARCHAR(255),
|
||||
processed ENUM('Y','N'),
|
||||
user_group VARCHAR(20),
|
||||
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE',
|
||||
alt_dial VARCHAR(6) default 'NONE',
|
||||
index (lead_id),
|
||||
index (call_date)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_closer_log (
|
||||
closecallid INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(20),
|
||||
call_date DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec INT(10),
|
||||
status VARCHAR(6),
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
comments VARCHAR(255),
|
||||
processed ENUM('Y','N'),
|
||||
queue_seconds DECIMAL(7,2) default '0',
|
||||
user_group VARCHAR(20),
|
||||
xfercallid INT(9) UNSIGNED,
|
||||
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRECALLXFER','HOLDTIME','NOAGENT','NONE') default 'NONE',
|
||||
uniqueid VARCHAR(20) NOT NULL default '',
|
||||
agent_only VARCHAR(20) default '',
|
||||
index (lead_id),
|
||||
index (call_date),
|
||||
index (campaign_id),
|
||||
index (uniqueid)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_xfer_log (
|
||||
xfercallid INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
lead_id INT(9) UNSIGNED NOT NULL,
|
||||
list_id BIGINT(14) UNSIGNED,
|
||||
campaign_id VARCHAR(20),
|
||||
call_date DATETIME,
|
||||
phone_code VARCHAR(10),
|
||||
phone_number VARCHAR(18),
|
||||
user VARCHAR(20),
|
||||
closer VARCHAR(20),
|
||||
index (lead_id),
|
||||
index (call_date)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_recording_log (
|
||||
recording_id INT(10) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
channel VARCHAR(100),
|
||||
server_ip VARCHAR(15),
|
||||
extension VARCHAR(100),
|
||||
start_time DATETIME,
|
||||
start_epoch INT(10) UNSIGNED,
|
||||
end_time DATETIME,
|
||||
end_epoch INT(10) UNSIGNED,
|
||||
length_in_sec MEDIUMINT(8) UNSIGNED,
|
||||
length_in_min DOUBLE(8,2),
|
||||
filename VARCHAR(50),
|
||||
location VARCHAR(255),
|
||||
lead_id INT(9) UNSIGNED,
|
||||
user VARCHAR(20),
|
||||
vicidial_id VARCHAR(20),
|
||||
index(filename),
|
||||
index(lead_id),
|
||||
index(user),
|
||||
index(vicidial_id)
|
||||
);
|
||||
|
||||
CREATE TABLE twoday_vicidial_agent_log (
|
||||
agent_log_id INT(9) UNSIGNED PRIMARY KEY NOT NULL,
|
||||
user VARCHAR(20),
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
event_time DATETIME,
|
||||
lead_id INT(9) UNSIGNED,
|
||||
campaign_id VARCHAR(8),
|
||||
pause_epoch INT(10) UNSIGNED,
|
||||
pause_sec SMALLINT(5) UNSIGNED default '0',
|
||||
wait_epoch INT(10) UNSIGNED,
|
||||
wait_sec SMALLINT(5) UNSIGNED default '0',
|
||||
talk_epoch INT(10) UNSIGNED,
|
||||
talk_sec SMALLINT(5) UNSIGNED default '0',
|
||||
dispo_epoch INT(10) UNSIGNED,
|
||||
dispo_sec SMALLINT(5) UNSIGNED default '0',
|
||||
status VARCHAR(6),
|
||||
user_group VARCHAR(20),
|
||||
comments VARCHAR(20),
|
||||
sub_status VARCHAR(6),
|
||||
index (lead_id),
|
||||
index (user),
|
||||
index (event_time)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1166';
|
||||
|
||||
@@ -242,10 +242,11 @@
|
||||
# 90721-1114 - Added rank and owner as vicidial_list fields
|
||||
# 90726-2012 - Added allow_alerts option
|
||||
# 90729-0647 - Added agent_display_dialable_leads option
|
||||
# 90730-0145 - Fixed bugs in re-queue and INBOUND_MAN with blended selected
|
||||
#
|
||||
|
||||
$version = '2.2.0-220';
|
||||
$build = '90729-0647';
|
||||
$version = '2.2.0-221';
|
||||
$build = '90730-0145';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=61;
|
||||
$one_mysql_log=0;
|
||||
@@ -780,7 +781,7 @@ $VDloginDISPLAY=0;
|
||||
$login=strtoupper($VD_login);
|
||||
$password=strtoupper($VD_pass);
|
||||
##### grab the full name of the agent
|
||||
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -801,6 +802,7 @@ $VDloginDISPLAY=0;
|
||||
$VU_agent_shift_enforcement_override = $row[14];
|
||||
$VU_shift_override_flag = $row[15];
|
||||
$VU_allow_alerts = $row[16];
|
||||
$VU_closer_campaigns = $row[17];
|
||||
|
||||
if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';}
|
||||
else {$VU_alert_enabled = 'OFF';}
|
||||
@@ -2195,6 +2197,7 @@ $CCAL_OUT .= "</table>";
|
||||
var VU_hotkeys_active = '<?php echo $VU_hotkeys_active ?>';
|
||||
var VU_agent_choose_ingroups = '<?php echo $VU_agent_choose_ingroups ?>';
|
||||
var VU_agent_choose_ingroups_DV = '';
|
||||
var VU_closer_campaigns = '<?php echo $VU_closer_campaigns ?>';
|
||||
var CallBackDatETimE = '';
|
||||
var CallBackrecipient = '';
|
||||
var CallBackCommenTs = '';
|
||||
@@ -4351,7 +4354,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
var CloserSelectChoices = document.vicidial_form.CloserSelectList.value;
|
||||
var regCRB = new RegExp("AGENTDIRECT","ig");
|
||||
if (CloserSelectChoices.match(regCRB))
|
||||
if ( (CloserSelectChoices.match(regCRB)) || (VU_closer_campaigns.match(regCRB)) )
|
||||
{
|
||||
document.getElementById("ReQueueCall").innerHTML = "<a href=\"#\" onclick=\"call_requeue_launch();return false;\"><IMG SRC=\"./images/vdc_LB_requeue_call.gif\" border=0 alt=\"Re-Queue Call\"></a>";
|
||||
}
|
||||
@@ -5486,7 +5489,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
var CloserSelectChoices = document.vicidial_form.CloserSelectList.value;
|
||||
var regCRB = new RegExp("AGENTDIRECT","ig");
|
||||
if (CloserSelectChoices.match(regCRB))
|
||||
if ( (CloserSelectChoices.match(regCRB)) || (VU_closer_campaigns.match(regCRB)) )
|
||||
{
|
||||
document.getElementById("ReQueueCall").innerHTML = "<a href=\"#\" onclick=\"call_requeue_launch();return false;\"><IMG SRC=\"./images/vdc_LB_requeue_call.gif\" border=0 alt=\"Re-Queue Call\"></a>";
|
||||
}
|
||||
@@ -9025,7 +9028,7 @@ if ($agent_display_dialable_leads > 0)
|
||||
<span id="CloserSelectContent"> Closer Inbound Group Selection </span>
|
||||
<input type=hidden name=CloserSelectList><BR>
|
||||
<?php
|
||||
if ( ($outbound_autodial_active > 0) and ($disable_blended_checkbox < 1) )
|
||||
if ( ($outbound_autodial_active > 0) and ($disable_blended_checkbox < 1) and ($dial_method != 'INBOUND_MAN') )
|
||||
{
|
||||
?>
|
||||
<input type=checkbox name=CloserSelectBlended size=1 value="0"> BLENDED CALLING(outbound activated) <BR>
|
||||
@@ -9045,7 +9048,7 @@ if ($agent_display_dialable_leads > 0)
|
||||
<?php
|
||||
if (!$agentonly_callbacks)
|
||||
{echo "<input type=checkbox name=CallBackOnlyMe size=1 value=\"0\"> MY CALLBACK ONLY <BR>";}
|
||||
if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) )
|
||||
if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) or ($dial_method == 'INBOUND_MAN') )
|
||||
{echo "<input type=checkbox name=CloserSelectBlended size=1 value=\"0\"> BLENDED CALLING<BR>";}
|
||||
?>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user