Added Auto-Rotating CID Group numbers, allowing for timed automatic cycling of CID numbers, one-at-a-time, within a CID Group.

Added more features to CallerID_log_report.php

git-svn-id: svn://192.168.202.10@3188 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2020-01-23 17:37:16 +00:00
parent 98d3471039
commit 44a735f953
11 changed files with 412 additions and 62 deletions
+3
View File
@@ -467,6 +467,9 @@ OTHER CHANGES:
130. Added CID Group Type of NONE to allow for a group of outbound CIDs to be
used for all outbound phone calls no matter where they are.
131. Added Auto-Rotating CID Group numbers, allowing for timed automatic cycling
of CID numbers, one-at-a-time, within a CID Group.
+209 -3
View File
@@ -15,7 +15,7 @@
# - Auto reset lists at defined times
# - Auto restarts Asterisk process if enabled in servers settings
#
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 61011-1348 - First build
@@ -138,9 +138,10 @@
# 190530-1411 - Added SIP logger code
# 190713-0900 - Added vicidial_lead_call_quota_counts log archiving
# 191017-2039 - Added reset of calls_today_filtered fields
# 200122-0847 - Added CID Groups auto-rotate feature
#
$build = '191017-2039';
$build = '200122-0847';
$DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file
@@ -165,6 +166,7 @@ if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$now_date = "$year-$mon-$mday $hour:$min:$sec";
$dateint = "$year$mon$mday$hour$min$sec";
$today_start = "$year-$mon-$mday 00:00:00";
$today_date = "$year-$mon-$mday";
$reset_test = "$hour$min";
@@ -226,6 +228,7 @@ if ($SXsec < 10) {$SXsec = "0$SXsec";}
$SXSQLdate = "$SXyear-$SXmon-$SXmday $SXhour:$SXmin:$SXsec";
$SXdate = "$SXyear-$SXmon-$SXmday";
$FMtarget = ($secX - 300); # 5 minutes ago
### begin parsing run-time options ###
if (length($ARGV[0])>1)
@@ -1184,6 +1187,15 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "optimize table vicidial_cid_groups;";
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;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "update vicidial_did_ra_extensions SET call_count_today=0;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
@@ -4298,7 +4310,7 @@ if ($active_asterisk_server =~ /Y/)
################################################################################
##### START scheduled callbacks move old USERONLY triggered to ANYONE
################################################################################
# only run this on active voicemail servver
# only run this on active voicemail server
if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) )
{
##### BEGIN gather campaign settings #####
@@ -4360,6 +4372,200 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
################################################################################
##### START CID Group auto-rotate feature, for CID Type NONE only
################################################################################
# only run this on active voicemail server
if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) )
{
##### BEGIN gather CID Group settings #####
@cid_group_id=@MT;
$stmtA = "SELECT cid_group_id,cid_auto_rotate_minutes,cid_auto_rotate_minimum,cid_auto_rotate_calls,cid_last_auto_rotate,cid_auto_rotate_cid,UNIX_TIMESTAMP(cid_last_auto_rotate) FROM vicidial_cid_groups where cid_group_type='NONE' and cid_auto_rotate_minutes > 0 order by cid_group_id;";
if ($DBX) {print "$stmtA\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$i=0;
while ($sthArows > $i)
{
@aryA = $sthA->fetchrow_array;
$cid_group_id[$i] = $aryA[0];
$cid_auto_rotate_minutes[$i] = $aryA[1];
$cid_auto_rotate_minimum[$i] = $aryA[2];
$cid_auto_rotate_calls[$i] = $aryA[3];
$cid_last_auto_rotate[$i] = $aryA[4];
$cid_auto_rotate_cid[$i] = $aryA[5];
$cid_last_auto_rotate_epoch[$i] = $aryA[6];
$i++;
}
$sthA->finish();
if ($DB) {print " CID Groups with Auto-Rotate enabled: $i\n";}
$i=0;
while ($sthArows > $i)
{
$stmtA = "SELECT campaign_calldate,campaign_id,UNIX_TIMESTAMP(campaign_calldate) from vicidial_campaigns where cid_group_id='$cid_group_id[$i]' order by campaign_calldate desc limit 1;";
if ($DBX) {print "$stmtA\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsX=$sthA->rows;
if ($sthArowsX > 0)
{
@aryA = $sthA->fetchrow_array;
$Rcampaign_calldate = $aryA[0];
$Rcampaign_id = $aryA[1];
$Rcampaign_calldate_epoch = $aryA[2];
}
$sthA->finish();
if ( ($Rcampaign_calldate_epoch < $FMtarget) && (length($cid_auto_rotate_cid[$i]) >= 6 ) )
{
if ($DB) {print " skip CID Group rotate, no recent campaign calls: $cid_group_id[$i]|$Rcampaign_id|$Rcampaign_calldate| ($Rcampaign_calldate_epoch <> $FMtarget)\n";}
}
else
{
if ($DBX) {print " DEBUG: CID Group rotate, recent campaign calls: $cid_group_id[$i]|$Rcampaign_id|$Rcampaign_calldate| ($Rcampaign_calldate_epoch <> $FMtarget)\n";}
$rotate_run_minutes = (($secX - $cid_last_auto_rotate_epoch[$i]) / 60);
if ($rotate_run_minutes < $cid_auto_rotate_minutes[$i])
{
if ($DB) {print " skip CID Group rotate, too soon: $cid_group_id[$i] ($rotate_run_minutes <> $cid_auto_rotate_minutes[$i])\n";}
}
else
{
if ( ($cid_auto_rotate_calls[$i] < $cid_auto_rotate_minimum[$i]) && (length($cid_auto_rotate_cid[$i]) >= 6 ) )
{
if ($DB) {print " skip CID Group rotate, too few calls: $cid_group_id[$i] ($cid_auto_rotate_calls[$i] <> $cid_auto_rotate_minimum[$i])\n";}
}
else
{
$CIDrotate_CIDs_count=0;
$stmtA = "SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id[$i]' and cid_description NOT IN('NOROTATE','NO-ROTATE','NO_ROTATE','INACTIVE','DONOTUSE') and cid_description NOT LIKE \"%NOROTATE%\";";
if ($DBX) {print "$stmtA\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsX=$sthA->rows;
if ($sthArowsX > 0)
{
@aryA = $sthA->fetchrow_array;
$CIDrotate_CIDs_count = $aryA[0];
}
$sthA->finish();
if ($CIDrotate_CIDs_count < 2)
{
if ($DB) {print " skip CID Group rotate, too few CIDs available, must be at least 2: $cid_group_id[$i] ($CIDrotate_CIDs_count)\n";}
}
else
{
### BEGIN if last-CID-used for this CID Group is blank or invalid, order the CIDs and set them all to inactive ###
if (length($cid_auto_rotate_cid[$i]) < 6 )
{
@outbound_cid=@MT;
$stmtA = "SELECT outbound_cid from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id[$i]' and cid_description NOT IN('NOROTATE','NO-ROTATE','NO_ROTATE','INACTIVE','DONOTUSE') and cid_description NOT LIKE \"%NOROTATE%\" order by call_count_today limit 100000;";
if ($DBX) {print "$stmtA\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$j=0;
while ($sthArows > $j)
{
@aryA = $sthA->fetchrow_array;
$outbound_cid[$j] = $aryA[0];
$j++;
}
$sthA->finish();
$j=0;
while ($sthArows > $j)
{
$stmtA = "UPDATE vicidial_campaign_cid_areacodes SET cid_description='$j',active='N' where campaign_id='$cid_group_id[$i]' and outbound_cid='$outbound_cid[$j]';";
if ($j < 1)
{
$stmtA = "UPDATE vicidial_campaign_cid_areacodes SET cid_description='$dateint',active='Y' where campaign_id='$cid_group_id[$i]' and outbound_cid='$outbound_cid[$j]';";
}
$affected_rows = $dbhA->do($stmtA) or die "Couldn't execute query: |$stmtA|\n";
if ($DBX) {print " CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid[$j]|$stmtA|\n";}
if ($j < 1)
{
$stmtB = "UPDATE vicidial_cid_groups SET cid_auto_rotate_calls='0',cid_last_auto_rotate=NOW(),cid_auto_rotate_cid='$outbound_cid[$j]' where cid_group_id='$cid_group_id[$i]';";
$affected_rowsB = $dbhA->do($stmtB) or die "Couldn't execute query: |$stmtB|\n";
if ($DBX) {print " CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid[$j]|$stmtB|\n";}
if ($teodDB)
{
$event_string = " CID Group entry updated: $affected_rowsB|$j|$cid_group_id[$i]|$outbound_cid[$j]|$stmtB|";
&teod_logger;
}
}
if ($teodDB)
{
$event_string = "CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid[$j]|$stmtA|";
&teod_logger;
}
$j++;
}
}
### END if last-CID-used for this CID Group is blank or invalid, order the CIDs and set them all to inactive ###
else
{
### BEGIN set the next CID to active and the current one to inactive ###
$outbound_cid_next='';
$stmtA = "SELECT outbound_cid from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id[$i]' and cid_description NOT IN('NOROTATE','NO-ROTATE','NO_ROTATE','INACTIVE','DONOTUSE') and cid_description NOT LIKE \"%NOROTATE%\" order by CAST(cid_description as SIGNED INTEGER) limit 1;";
if ($DBX) {print "$stmtA\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$outbound_cid_next = $aryA[0];
}
$sthA->finish();
if (length($outbound_cid_next) < 6)
{
if ($DB) {print " skip CID Group rotate, next CID could not be found: $cid_group_id[$i] ($stmtA)\n";}
}
else
{
$stmtA = "UPDATE vicidial_campaign_cid_areacodes SET cid_description='$dateint',active='Y' where campaign_id='$cid_group_id[$i]' and outbound_cid='$outbound_cid_next';";
$affected_rows = $dbhA->do($stmtA) or die "Couldn't execute query: |$stmtA|\n";
if ($DBX) {print " CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid_next|$stmtA|\n";}
$stmtB = "UPDATE vicidial_cid_groups SET cid_auto_rotate_calls='0',cid_last_auto_rotate=NOW(),cid_auto_rotate_cid='$outbound_cid_next' where cid_group_id='$cid_group_id[$i]';";
$affected_rowsB = $dbhA->do($stmtB) or die "Couldn't execute query: |$stmtB|\n";
if ($DBX) {print " CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid_next|$stmtB|\n";}
$stmtC = "UPDATE vicidial_campaign_cid_areacodes SET active='N' where campaign_id='$cid_group_id[$i]' and outbound_cid='$cid_auto_rotate_cid[$i]';";
$affected_rowsC = $dbhA->do($stmtC) or die "Couldn't execute query: |$stmtC|\n";
if ($DBX) {print " CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$cid_auto_rotate_cid[$i]|$stmtC|\n";}
if ($teodDB)
{
$event_string = "CID Group entry updated: $affected_rows|$j|$cid_group_id[$i]|$outbound_cid_next|$stmtA|\n";
$event_string .= " CID Group entry updated: $affected_rowsB|$j|$cid_group_id[$i]|$outbound_cid_next|$stmtB|\n";
$event_string .= " CID Group entry updated: $affected_rowsC|$j|$cid_group_id[$i]|$cid_auto_rotate_cid[$i]|$stmtC|";
&teod_logger;
}
}
### END set the next CID to active and the current one to inactive ###
}
}
}
}
}
$i++;
}
}
################################################################################
##### END CID Group auto-rotate feature, for CID Type NONE only
################################################################################
################################################################################
##### BEGIN Audio Store sync
################################################################################
+7
View File
@@ -132,6 +132,7 @@
# 190709-2239 - Added Call Quota logging
# 191108-0922 - Added Dial Timeout Lead override function
# 200108-1315 - Added CID Group type of NONE
# 200122-1851 - Added code for CID Group auto-rotate feature
#
### begin parsing run-time options ###
@@ -1586,6 +1587,12 @@ while($one_day_interval > 0)
$sthA->finish();
$stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
$affected_rows = $dbhA->do($stmtA);
if ($cid_group_type =~ /NONE/)
{
$stmtA="UPDATE vicidial_cid_groups set cid_auto_rotate_calls=(cid_auto_rotate_calls + 1) where cid_group_id='$DBIPcid_group_id[$user_CIPct]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{$sthA->finish();}
@@ -45,6 +45,7 @@
# 180910-1759 - Small fix for data validation
# 191108-1023 - Added Dial Timeout Lead override function
# 200108-1314 - Added CID Group type of NONE
# 200122-1850 - Added code for CID Group auto-rotate feature
#
### begin parsing run-time options ###
@@ -1000,6 +1001,12 @@ while($one_day_interval > 0)
$sthA->finish();
$stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$camp_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
$affected_rows = $dbhA->do($stmtA);
if ($cid_group_type =~ /NONE/)
{
$stmtA="UPDATE vicidial_cid_groups set cid_auto_rotate_calls=(cid_auto_rotate_calls + 1) where cid_group_id='$DBIPcid_group_id[$camp_CIPct]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{$sthA->finish();}
@@ -3991,7 +3991,12 @@ CREATE TABLE vicidial_cid_groups (
cid_group_id VARCHAR(20) PRIMARY KEY NOT NULL,
cid_group_notes VARCHAR(255) default '',
cid_group_type ENUM('AREACODE','STATE','NONE') default 'AREACODE',
user_group VARCHAR(20) default '---ALL---'
user_group VARCHAR(20) default '---ALL---',
cid_auto_rotate_minutes MEDIUMINT(7) UNSIGNED default '0',
cid_auto_rotate_minimum MEDIUMINT(7) UNSIGNED default '0',
cid_auto_rotate_calls MEDIUMINT(7) UNSIGNED default '0',
cid_last_auto_rotate DATETIME,
cid_auto_rotate_cid VARCHAR(20) default ''
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE vicidial_agent_function_log (
@@ -4583,4 +4588,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1584',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1585',db_schema_update_date=NOW(),reload_timestamp=NOW();
+10
View File
@@ -1152,3 +1152,13 @@ UPDATE system_settings SET db_schema_version='1583',db_schema_update_date=NOW()
ALTER TABLE vicidial_cid_groups MODIFY cid_group_type ENUM('AREACODE','STATE','NONE') default 'AREACODE';
UPDATE system_settings SET db_schema_version='1584',db_schema_update_date=NOW() where db_schema_version < 1584;
ALTER TABLE vicidial_cid_groups ADD cid_auto_rotate_minutes MEDIUMINT(7) UNSIGNED default '0';
ALTER TABLE vicidial_cid_groups ADD cid_auto_rotate_minimum MEDIUMINT(7) UNSIGNED default '0';
ALTER TABLE vicidial_cid_groups ADD cid_auto_rotate_calls MEDIUMINT(7) UNSIGNED default '0';
ALTER TABLE vicidial_cid_groups ADD cid_last_auto_rotate DATETIME;
ALTER TABLE vicidial_cid_groups ADD cid_auto_rotate_cid VARCHAR(20) default '';
UPDATE vicidial_cid_groups SET cid_last_auto_rotate=NOW() where cid_last_auto_rotate IS NULL;
UPDATE system_settings SET db_schema_version='1585',db_schema_update_date=NOW() where db_schema_version < 1585;
+20 -3
View File
@@ -486,10 +486,11 @@
# 191107-1010 - Fix for issue #1180, hide phone number in callback info
# 191108-0920 - Added Dial Timeout Lead override function
# 200108-0947 - Added cid_group_id of NONE
# 200122-1847 - Added code for CID Group auto-rotate feature
#
$version = '2.14-379';
$build = '200108-0947';
$version = '2.14-380';
$build = '200122-1847';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=824;
@@ -4412,10 +4413,18 @@ if ($ACTION == 'manDiaLnextCaLL')
}
if ($act > 0)
{
$stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$cid_group_id' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
$stmt="UPDATE vicidial_campaign_cid_areacodes SET call_count_today=(call_count_today + 1) where campaign_id='$cid_group_id' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00716',$user,$server_ip,$session_name,$one_mysql_log);}
if ($cid_group_type == 'NONE')
{
$stmt="UPDATE vicidial_cid_groups SET cid_auto_rotate_calls=(cid_auto_rotate_calls + 1) where cid_group_id='$cid_group_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
}
}
$temp_CID = preg_replace("/\D/",'',$temp_vcca);
@@ -6000,6 +6009,14 @@ if ($ACTION == 'manDiaLonly')
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00719',$user,$server_ip,$session_name,$one_mysql_log);}
if ($cid_group_type == 'NONE')
{
$stmt="UPDATE vicidial_cid_groups SET cid_auto_rotate_calls=(cid_auto_rotate_calls + 1) where cid_group_id='$cid_group_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
}
}
$temp_CID = preg_replace("/\D/",'',$temp_vcca);
+42 -13
View File
@@ -2479,6 +2479,10 @@ if (isset($_GET["enable_first_webform"])) {$enable_first_webform=$_GET["enable
elseif (isset($_POST["enable_first_webform"])) {$enable_first_webform=$_POST["enable_first_webform"];}
if (isset($_GET["vmm_daily_limit"])) {$vmm_daily_limit=$_GET["vmm_daily_limit"];}
elseif (isset($_POST["vmm_daily_limit"])) {$vmm_daily_limit=$_POST["vmm_daily_limit"];}
if (isset($_GET["cid_auto_rotate_minutes"])) {$cid_auto_rotate_minutes=$_GET["cid_auto_rotate_minutes"];}
elseif (isset($_POST["cid_auto_rotate_minutes"])) {$cid_auto_rotate_minutes=$_POST["cid_auto_rotate_minutes"];}
if (isset($_GET["cid_auto_rotate_minimum"])) {$cid_auto_rotate_minimum=$_GET["cid_auto_rotate_minimum"];}
elseif (isset($_POST["cid_auto_rotate_minimum"])) {$cid_auto_rotate_minimum=$_POST["cid_auto_rotate_minimum"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -2922,6 +2926,8 @@ if ($non_latin < 1)
$time_end = preg_replace('/[^0-9]/','',$time_end);
$enable_first_webform = preg_replace('/[^0-9]/','',$enable_first_webform);
$vmm_daily_limit = preg_replace('/[^0-9]/','',$vmm_daily_limit);
$cid_auto_rotate_minutes = preg_replace('/[^0-9]/','',$cid_auto_rotate_minutes);
$cid_auto_rotate_minimum = preg_replace('/[^0-9]/','',$cid_auto_rotate_minimum);
$user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit);
$drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds);
@@ -4602,12 +4608,13 @@ else
# 191230-1001 - Added Voicemail Message Daily Limit
# 200108-0937 - Added CID Group Type of NONE, update date for 2020
# 200115-1702 - Added Caller ID Log Report to Admin Utilities
# 200122-0921 - Added CID Group auto-rotate feature settings
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
$admin_version = '2.14-733a';
$build = '200115-1702';
$admin_version = '2.14-734a';
$build = '200122-0921';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -13436,7 +13443,7 @@ if ($ADD==296111111111)
{
echo "<br>"._QXZ("CID GROUP ADDED")."\n";
$stmt="INSERT INTO vicidial_cid_groups SET cid_group_id='$cid_group_id',cid_group_notes='$cid_group_notes',cid_group_type='$cid_group_type',user_group='$user_group';";
$stmt="INSERT INTO vicidial_cid_groups SET cid_group_id='$cid_group_id',cid_group_notes='$cid_group_notes',cid_group_type='$cid_group_type',user_group='$user_group',cid_auto_rotate_minutes='0',cid_auto_rotate_minimum='0',cid_auto_rotate_calls='0',cid_last_auto_rotate='2020-01-01 00:00:01';";
$rslt=mysql_to_mysqli($stmt, $link);
### LOG INSERTION Admin Log Table ###
@@ -18026,7 +18033,7 @@ if ($ADD==496111111111)
{echo "<br>"._QXZ("CID GROUP NOT MODIFIED - Please go back and look at the data you entered")."\n";}
else
{
$stmt="UPDATE vicidial_cid_groups set cid_group_notes='$cid_group_notes',user_group='$user_group' where cid_group_id='$cid_group_id';";
$stmt="UPDATE vicidial_cid_groups set cid_group_notes='$cid_group_notes',user_group='$user_group',cid_auto_rotate_minutes='$cid_auto_rotate_minutes',cid_auto_rotate_minimum='$cid_auto_rotate_minimum' where cid_group_id='$cid_group_id';";
$rslt=mysql_to_mysqli($stmt, $link);
echo "<br>"._QXZ("CID GROUP MODIFIED").": $cid_group_id\n";
@@ -37453,12 +37460,17 @@ if ($ADD==396111111111)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT cid_group_notes,cid_group_type,user_group from vicidial_cid_groups where cid_group_id='$cid_group_id' $LOGadmin_viewable_groupsSQL;";
$stmt="SELECT cid_group_notes,cid_group_type,user_group,cid_auto_rotate_minutes,cid_auto_rotate_minimum,cid_auto_rotate_calls,cid_last_auto_rotate,cid_auto_rotate_cid from vicidial_cid_groups where cid_group_id='$cid_group_id' $LOGadmin_viewable_groupsSQL;";
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$cid_group_notes = $row[0];
$cid_group_type = $row[1];
$user_group = $row[2];
$cid_group_notes = $row[0];
$cid_group_type = $row[1];
$user_group = $row[2];
$cid_auto_rotate_minutes = $row[3];
$cid_auto_rotate_minimum = $row[4];
$cid_auto_rotate_calls = $row[5];
$cid_last_auto_rotate = $row[6];
$cid_auto_rotate_cid = $row[7];
echo "<br>"._QXZ("MODIFY CID GROUP").": $cid_group_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=496111111111>\n";
@@ -37476,6 +37488,18 @@ if ($ADD==396111111111)
echo "<option SELECTED value=\"$user_group\">".(preg_match('/\-\-ALL\-\-/', $user_group) ? _QXZ("$user_group") : $user_group)."</option>\n";
echo "</select>$NWB#cid_groups$NWE</td></tr>\n";
if ($cid_group_type == 'NONE')
{
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("CID Auto Rotate Minutes").": </td><td align=left><input type=text name=cid_auto_rotate_minutes size=8 maxlength=7 value=\"$cid_auto_rotate_minutes\">$NWB#cid_groups-cid_auto_rotate_minutes$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("CID Auto Rotate Minimum").": </td><td align=left><input type=text name=cid_auto_rotate_minimum size=8 maxlength=7 value=\"$cid_auto_rotate_minimum\">$NWB#cid_groups-cid_auto_rotate_minimum$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("CID Auto Rotate Calls, CID and Time").": </td><td align=left><B>$cid_auto_rotate_calls - $cid_auto_rotate_cid - $cid_last_auto_rotate</B>$NWB#cid_groups-cid_auto_rotate_calls$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#$SSstd_row4_background><td align=right><input type=hidden name=cid_auto_rotate_minutes value=\"$cid_auto_rotate_minutes\">\n";
echo "<input type=hidden name=cid_auto_rotate_minimum value=\"$cid_auto_rotate_minimum\"></td></tr>\n";
}
echo "<tr bgcolor=#$SSstd_row4_background><td align=center colspan=2><input type=submit name=submit value='"._QXZ("SUBMIT")."'</td></tr>\n";
echo "</TABLE></center></form>\n";
@@ -41353,7 +41377,7 @@ if ($ADD==196000000000)
echo "<TABLE><TR><TD>\n";
echo "<img src=\"images/icon_cidgroups.png\" width=42 height=42 align=left> <FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT cid_group_id,cid_group_notes,cid_group_type,user_group from vicidial_cid_groups $whereLOGadmin_viewable_groupsSQL order by cid_group_id;";
$stmt="SELECT cid_group_id,cid_group_notes,cid_group_type,user_group,cid_auto_rotate_minutes from vicidial_cid_groups $whereLOGadmin_viewable_groupsSQL order by cid_group_id;";
$rslt=mysql_to_mysqli($stmt, $link);
$cid_groups_to_print = mysqli_num_rows($rslt);
@@ -41363,6 +41387,7 @@ if ($ADD==196000000000)
echo "<TD><font size=1 color=white>"._QXZ("CID GROUP ID")."</TD>";
echo "<TD><font size=1 color=white>"._QXZ("NOTES")."</TD>";
echo "<TD><font size=1 color=white>"._QXZ("TYPE")."</TD>";
echo "<TD align=left><font size=1 color=white> &nbsp; </TD>";
echo "<TD><font size=1 color=white>"._QXZ("GROUP")."</TD>";
echo "<TD><font size=1 color=white>"._QXZ("CIDS")."</TD>";
echo "<TD><font size=1 color=white>"._QXZ("MODIFY")."</TD>\n";
@@ -41373,14 +41398,17 @@ if ($ADD==196000000000)
$cid_group_notes = $MT;
$cid_group_type = $MT;
$admin_group = $MT;
$cid_auto_rotate_minutes = $MT;
while ($cid_groups_to_print > $o)
{
$row=mysqli_fetch_row($rslt);
$cid_group_id[$o] = $row[0];
$cid_group_notes[$o] = $row[1];
$cid_group_type[$o] = _QXZ("$row[2]");
$cid_group_id[$o] = $row[0];
$cid_group_notes[$o] = $row[1];
$cid_group_type[$o] = _QXZ("$row[2]");
$admin_group[$o] = (preg_match('/\-\-ALL\-\-/', $row[3]) ? _QXZ("$row[3]") : $row[3]);
$cid_auto_rotate_minutes[$o] = '';
if ($row[4] > 0) {$cid_auto_rotate_minutes[$o] = ' &nbsp; AR &nbsp; ';}
$o++;
}
@@ -41397,8 +41425,9 @@ if ($ADD==196000000000)
echo "<tr $bgcolor"; if ($SSadmin_row_click > 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=396111111111&cid_group_id=$cid_group_id[$o]'\"";} echo "><td><a href=\"$PHP_SELF?ADD=396111111111&cid_group_id=$cid_group_id[$o]\"><font size=1 color=black>$cid_group_id[$o]</a></td>";
echo "<td><font size=1> $cid_group_notes[$o]</td>";
echo "<td><font size=1> $cid_group_type[$o]</td>";
echo "<td align=left><font size=1> <b>$cid_auto_rotate_minutes[$o]</b></td>";
echo "<td><font size=1> $admin_group[$o]</td>";
echo "<td><font size=1> $row[0]</td>";
echo "<td><font size=1>$row[0]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=396111111111&cid_group_id=$cid_group_id[$o]\">"._QXZ("MODIFY")."</a></td></tr>\n";
$o++;
}
@@ -707,7 +707,7 @@ if ($run_export > 0)
if ($export_fields == 'EXTENDED_3')
{$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";}
if ($export_fields == 'ALTERNATE_2')
{$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t!STATUS_DESCRIPTION!\t$row[0]";}
{$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t$row[17]\t!STATUS_DESCRIPTION!\t$row[0]";}
else
{
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA";
@@ -849,7 +849,7 @@ if ($run_export > 0)
if ($export_fields == 'EXTENDED_3')
{$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t$row[45]\t";}
if ($export_fields == 'ALTERNATE_2')
{$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t!STATUS_DESCRIPTION!\t$row[0]";}
{$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t$row[17]\t!STATUS_DESCRIPTION!\t$row[0]";}
else
{
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t$export_fieldsDATA";
@@ -10,6 +10,7 @@
# CHANGES
#
# 200115-1512 - First build
# 200120-1430 - Added total calls, percentage of calls matched, default CID notation
#
$startMS = microtime();
@@ -24,12 +25,18 @@ if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
if (isset($_GET["query_time"])) {$query_time=$_GET["query_time"];}
elseif (isset($_POST["query_time"])) {$query_time=$_POST["query_time"];}
if (isset($_GET["end_time"])) {$end_time=$_GET["end_time"];}
elseif (isset($_POST["end_time"])) {$end_time=$_POST["end_time"];}
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
if (isset($_GET["status"])) {$status=$_GET["status"];}
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
if (isset($_GET["interval"])) {$interval=$_GET["interval"];}
elseif (isset($_POST["interval"])) {$interval=$_POST["interval"];}
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
@@ -47,6 +54,28 @@ $NWE = "')\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP>";
if (!isset($interval)) {$interval = '0';}
$interval=preg_replace('/[^0-9]/', '', $interval);
### ARCHIVED DATA CHECK CONFIGURATION
$archives_available="N";
$log_tables_array=array("vicidial_dial_log", "vicidial_log");
for ($t=0; $t<count($log_tables_array); $t++)
{
$table_name=$log_tables_array[$t];
$archive_table_name=use_archive_table($table_name);
if ($archive_table_name!=$table_name) {$archives_available="Y";}
}
if ($search_archived_data)
{
$vicidial_dial_log_table=use_archive_table("vicidial_dial_log");
$vicidial_log_table=use_archive_table("vicidial_log");
}
else
{
$vicidial_dial_log_table="vicidial_dial_log";
$vicidial_log_table="vicidial_log";
}
#############
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -279,6 +308,8 @@ if ($SUBMIT)
if (!isset($status)) {$status = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
$log_calls=0;
$total_calls=0;
$campaign_ct = count($campaign);
$status_ct = count($status);
@@ -314,36 +345,17 @@ if ($SUBMIT)
else if (preg_match('/\-\-\-ALL\-\-\-/',$campaign_string) )
{
$campaign_SQL = "";
$campaign_SQL_where = "";
$RUNcampaign=1;
}
else
{
$campaign_SQL = preg_replace('/,$/i', '',$campaign_SQL);
$campaign_SQL = "and vl.campaign_id IN($campaign_SQL)";
$campaign_SQL = "and campaign_id IN($campaign_SQL)";
$campaign_SQL_where = "where campaign_id IN($campaign_SQL)";
$RUNcampaign++;
}
$i=0;
while($i < $group_ct)
{
$group_string .= "$group[$i]|";
$group_SQL .= "'$group[$i]',";
$groupQS .= "&group[]=$group[$i]";
$i++;
}
if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{
$group_SQL = "''";
$group_SQL = "campaign_id IN('')";
$RUNgroup=0;
}
else
{
$group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and vl.campaign_id IN($group_SQL)";
$RUNgroup++;
}
$i=0;
while($i < $status_ct)
{
@@ -362,28 +374,41 @@ if ($SUBMIT)
$status_SQL = "and vl.status IN($status_SQL)";
}
$stmt="select lead_id, call_date from vicidial_log vl where call_date>='$query_date 00:00:00' and call_date<='$end_date 23:59:59' $status_SQL $campaign_SQL";
$CCIDs=array();
$campaign_CID_stmt="select campaign_cid from vicidial_campaigns $campaign_SQL_where";
$campaign_CID_rslt=mysql_to_mysqli($campaign_CID_stmt, $link);
while ($ccid_row=mysqli_fetch_row($campaign_CID_rslt)) {
array_push($CCIDs, "$ccid_row[0]");
}
$stmt="select lead_id, call_date, status from ".$vicidial_log_table." vl where call_date>='$query_date $query_time' and call_date<='$end_date $end_time' $campaign_SQL";
$rslt=mysql_to_mysqli($stmt, $link);
$found_calls=mysqli_num_rows($rslt);
$vlog_calls=mysqli_num_rows($rslt);
while ($row=mysqli_fetch_row($rslt))
{
$lead_id=$row[0];
$call_date=$row[1];
$stmt2="select call_date, channel, outbound_cid from vicidial_dial_log where lead_id='$lead_id' and call_date>='$call_date'-INTERVAL $interval SECOND and call_date<='$call_date'+INTERVAL $interval SECOND";
$status=$row[2];
$stmt2="select call_date, channel, outbound_cid from ".$vicidial_dial_log_table." where lead_id='$lead_id' and call_date>='$call_date'-INTERVAL $interval SECOND and call_date<='$call_date'+INTERVAL $interval SECOND";
$rslt2=mysql_to_mysqli($stmt2, $link);
while($row2=mysqli_fetch_row($rslt2))
{
preg_match('/<[0-9]+>/', $row2[2], $matches);
$caller_id=preg_replace('/[^0-9]/', '', $matches[0]);
$CID["$caller_id"]++;
$log_calls++;
$total_calls++;
$CID["$caller_id"][0]++;
if (preg_match("/\|($status|\-\-\-ALL\-\-\-)\|/i", $status_string))
{
$CID["$caller_id"][1]++;
$log_calls++;
}
}
}
ksort($CID);
$alt_stmt="select vdl.call_date, vdl.channel, vdl.outbound_cid from ".$vicidial_dial_log_table." vdl, ".$vicidial_log_table." vl where vl.call_date>='$query_date 00:00:00' and vl.call_date<='$end_date 23:59:59' $status_SQL $campaign_SQL and vdl.lead_id=vl.lead_id and vdl.call_date>=vl.call_date-INTERVAL $interval SECOND and vdl.call_date<=vl.call_date+INTERVAL $interval SECOND";
/*
$alt_stmt="select vdl.call_date, vdl.channel, vdl.outbound_cid from vicidial_dial_log vdl, vicidial_log vl where vl.call_date>='$query_date 00:00:00' and vl.call_date<='$end_date 23:59:59' $status_SQL $campaign_SQL and vdl.lead_id=vl.lead_id and vdl.call_date>=vl.call_date-INTERVAL $interval SECOND and vdl.call_date<=vl.call_date+INTERVAL $interval SECOND";
$alt_rslt=mysql_to_mysqli($alt_stmt, $link);
$found_calls=mysqli_num_rows($alt_rslt);
$log_calls=mysqli_num_rows($alt_rslt);
@@ -395,7 +420,7 @@ if ($SUBMIT)
}
*/
if ($found_calls>0)
if ($vlog_calls>0)
{
if ($file_download==1)
{
@@ -414,11 +439,21 @@ if ($SUBMIT)
$i=0;
echo "CALLER ID\tCOUNT\n";
echo "CALLER ID\tCALLS WITH STATUS\tTOTAL CALLS\tPERCENT\n";
foreach($CID as $key => $value)
{
echo $key."\t".$value."\n";
if (in_array($key, $CCIDs))
{
$apx=" **";
}
else
{
$apx="";
}
$pct=round((1000*$value[1])/$value[0])/10;
echo $key.$apx."\t".($value[1]+0)."\t".$value[0]."\t".$pct." %\n";
}
exit;
@@ -426,10 +461,12 @@ if ($SUBMIT)
}
else
{
$rslt_msg="<TABLE BORDER=0 align='center' width='500' cellpadding=0 cellspacing=0>";
$rslt_msg="<TABLE BORDER=0 align='center' width='600' cellpadding=5 cellspacing=0>";
$rslt_msg.="<tr bgcolor=black>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("Caller ID")."</B></font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("COUNT")."</B></font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("CALLS W/STATUS")."</B></font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("TOTAL CALLS")."</B></font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("PCT")."</B></font></td>";
$rslt_msg.="</tr>\n";
foreach($CID as $key => $value)
@@ -438,17 +475,34 @@ if ($SUBMIT)
{$bgcolor='class="records_list_x"';}
else
{$bgcolor='class="records_list_y"';}
if (in_array($key, $CCIDs))
{
$bgcolor="bgcolor='$SSstd_row3_background'";
$apx=" **";
}
else
{
$apx="";
}
$rslt_msg.="<tr $bgcolor>";
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".$key."</font></td>";
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".$value."</font></td>";
$rslt_msg.="<td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".$key.$apx."</font></td>";
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".($value[1]+0)."</font></td>";
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".$value[0]."</font></td>";
$pct=round((1000*$value[1])/$value[0])/10;
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=black align=left>".$pct." %</font></td>";
$rslt_msg.="</tr>";
$p++;
}
$rslt_msg.="<tr bgcolor=black>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left><B>"._QXZ("TOTAL")."</B></font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left>$log_calls</font></td>";
$rslt_msg.="<td align='center'><font SIZE=3 FACE=\"Arial,Helvetica\" color=white align=left>$total_calls</font></td>";
$pct=round((1000*$log_calls)/$total_calls)/10;
$rslt_msg.="<td align='center'><font SIZE=2 FACE=\"Arial,Helvetica\" color=white align=left>".$pct." %</font></td>";
$rslt_msg.="</tr>\n";
$rslt_msg.="<tr><th colspan='2'><font SIZE=3 FACE=\"Arial,Helvetica\"><a href='$PHP_SELF?query_date=$query_date&end_date=$end_date$campaignQS$statusQS&SUBMIT=SUBMIT&file_download=1&interval=$interval'>Download file here</a></font></th></tr>";
$rslt_msg.="<tr><th colspan='4'><font SIZE=3 FACE=\"Arial,Helvetica\"><a href='$PHP_SELF?query_date=$query_date&end_date=$end_date$campaignQS$statusQS&SUBMIT=SUBMIT&file_download=1&interval=$interval&search_archived_data=$search_archived_data'>Download file here</a></font></th></tr>";
$rslt_msg.="<tr><td align='left'><font SIZE=2 FACE=\"Arial,Helvetica\">** - denotes default campaign CID</font></td></tr>";
$rslt_msg.="</table>";
@@ -459,7 +513,7 @@ if ($SUBMIT)
echo "$campaign_ct|$campaign_string|$campaign_SQL\n";
echo "<BR>\n";
echo "$status_ct|$status_string|$status_SQL\n";
echo "<BR>$stmt<BR>$stmt2<BR>\n";
echo "<BR>$Tstmt<BR>$stmt<BR>$alt_stmt<BR>\n";
}
}
}
@@ -476,6 +530,8 @@ if ($file_exported < 1)
if (!isset($status)) {$status = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_time)) {$query_time = "00:00:00";}
if (!isset($end_time)) {$end_time = "23:59:59";}
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -582,6 +638,7 @@ if ($file_exported < 1)
// o_cal.a_tpl.weekstart = 1; // Monday week start
</script>
<?php
echo "<INPUT TYPE=TEXT NAME=query_time SIZE=8 MAXLENGTH=8 VALUE=\"$query_time\">";
echo "<BR>"._QXZ("to")."<BR>\n";
echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
@@ -598,6 +655,7 @@ if ($file_exported < 1)
// o_cal.a_tpl.weekstart = 1; // Monday week start
</script>
<?php
echo "<INPUT TYPE=TEXT NAME=end_time SIZE=8 MAXLENGTH=8 VALUE=\"$end_time\">";
echo "<BR><BR>\n";
@@ -634,7 +692,12 @@ if ($file_exported < 1)
echo "<font class=\"select_bold\"><B>"._QXZ("Log second diff").":</B></font>$NWB#callerID_log_report-log_second_diff$NWE<BR><CENTER>\n";
echo "<INPUT TYPE=TEXT NAME=interval SIZE=2 MAXLENGTH=2 VALUE=\"".$interval."\">";
echo "<BR><BR><BR>";
echo "<BR><BR>";
if ($archives_available=="Y")
{
echo "<input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."<BR>\n";
echo "<BR><BR>";
}
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
echo "</TD></TR><TR></TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=4> &nbsp; \n";
@@ -1,4 +1,4 @@
# version: 20200115170501
# version: 20200122122501
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N.</QXZ>
@@ -693,6 +693,9 @@ campaigns-script_top_dispo Script on top of Dispo <QXZ>If you are using an IFRAM
xfer_presets If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent. <QXZ>Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent.</QXZ>
campaign_cid_areacodes CAMPAIGN CID AREACODES <B><QXZ>If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used. An areacode in this section can be from 2 to 5 digits in length, and if a shorter defined areacode overlaps with a longer areacode then the longer areacode will be used. For example, if the areacodes 31 and 312 are both defined and active for a campaign, then areacode 312 would be used for phone number 3125551212.</QXZ></B>
cid_groups CID Groups <QXZ>CID Groups are very similar to Campaign AC-CID, except with CID Groups you can use the same set of CIDs across multiple campaigns, and you can also define CID Groups on a per-state basis as well as per-areacode, instead of just by areacode like with Campaign AC-CID. There is also the option to have no geographic separations and to just use a group of CIDs to call all numbers. If the STATE type is used, then the STATE value should match the state field for a lead, and if no match is found, the dialer will use the campaign CID as a default. If the NONE type is used, then the active CIDs will be rotated with every call made.</QXZ>
cid_groups-cid_auto_rotate_minutes CID Auto Rotate Minutes <QXZ>This feature only works with CID Groups, and only when the CID Group Type of NONE is used. This feature allows the system to automatically rotate the Caller IDs in the CID Group from inactive to active, leaving only one CID active at a time, every X minutes as long as active dialing is happening. This feature will rotate though all CIDs in the CID Group whether it is active or not unless the CID has a description of NOROTATE. For reference, one hour is 60 minutes, 6 hours is 360 minutes, 12 hours is 720 minutes and 24 hours is 1440 minutes. Default is 0 for disabled.</QXZ>
cid_groups-cid_auto_rotate_minimum CID Auto Rotate Minimum <QXZ>Works together with the CID Auto Rotate Minutes setting above, if it is enabled, and will not rotate to the next CID until at least this number of calls have been placed while active for the current CID that is dialing. Default is 0 for no limit.</QXZ>
cid_groups-cid_auto_rotate_calls CID Auto Rotate Calls, CID and Time <QXZ>Shows the number of calls placed using the current CID, the CID currently being used and the Date-Time the CID was activated.</QXZ>
vm_message_groups VM Message Groups <QXZ>Voicemail Message Groups are designed to allow agents to select from several messages to leave on a customer voicemail box when transferring to a voicemail message in the agent screen. The ID must be from 2 to 40 characters in length with no punctuation other than an underscore allowed. The Name must be from 5 to 255 characters in length. Active will determine if the VM Message Group is shown as an option in the campaign modify screen setting for VM Message Groups. For the Audio Files, you can define the order in which they appear on the agent screen by using the Rank setting. The Time Range will define what time of the customers day the message are displayed on the agent screen, in 2400 hours time format. The Display is what text will show up for this audio file on the agent screen.</QXZ>
inbound_groups-park_ext Park Music-on-Hold <QXZ>This optional setting will override the agent campaign setting for Park Music-on-Hold, if populated. Default is empty for disabled.</QXZ>
inbound_groups-populate_lead_source Populate Lead Source <QXZ>If this option is not DISABLED and there is no source_id channel variable set on the call, then the system will fill the source_id lead field with one of the other options when leads are added with an inbound call. INBOUND_NUMBER will use the inbound phone number dialed. BLANK will leave the source_id field blank. DISABLED will use the default behavior which will set the source_id field to VDCL. Default is DISABLED.</QXZ>