Fix for manual dial alt dial stuck vac calls

Fix for FTP cron scripts with transfer limit set

git-svn-id: svn://192.168.202.10@1745 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-10-21 20:28:47 +00:00
parent 308a00d13c
commit 32676364c9
4 changed files with 40 additions and 20 deletions
+2 -2
View File
@@ -89,7 +89,7 @@ if (length($ARGV[0])>1)
print " [--transfer-limit=XXX] = number of files to transfer before exiting\n";
print " [--list-limit=XXX] = number of files to list in the directory before moving on\n";
print " [--debugX] = super debug\n";
print " [-t] = test\n";
print " [--test] = test\n";
print " [--GSM] = copy GSM files\n";
print " [--MP3] = copy MPEG-Layer-3 files\n";
print " [--OGG] = copy OGG Vorbis files\n";
@@ -115,7 +115,7 @@ if (length($ARGV[0])>1)
$DBX=1;
print "\n----- SUPER DEBUG -----\n\n";
}
if ($args =~ /-t/i)
if ($args =~ /--test/i)
{
$T=1; $TEST=1;
print "\n----- TESTING -----\n\n";
+2 -2
View File
@@ -80,7 +80,7 @@ if (length($ARGV[0])>1)
print " [--ftp-pass=XXX] = FTP server password\n";
print " [--ftp-dir=XXX] = FTP server directory\n";
print " [--debugX] = super debug\n";
print " [-t] = test\n";
print " [--test] = test\n";
print " [--nodatedir] = do not put into dated directories\n\n";
exit;
}
@@ -96,7 +96,7 @@ if (length($ARGV[0])>1)
$DBX=1;
print "\n----- SUPER DEBUG -----\n\n";
}
if ($args =~ /-t/i)
if ($args =~ /--test/i)
{
$T=1; $TEST=1;
print "\n----- TESTING -----\n\n";
+32 -13
View File
@@ -91,6 +91,8 @@
# - $custom_field_names - ('|start_date|finish_date|favorite_color|')
# - $call_notes
# - $disable_alter_custphone = ('N','Y','HIDE')
# - $old_CID = ('M06301413000000002',...)
#
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -293,12 +295,13 @@
# 111006-1425 - Added call_count_limit campaign option
# 111015-2104 - Added SEARCHCONTACTSRESULTSview function
# 111018-1529 - Added more fields to contact search
# 111021-1549 - Added old_CID variable to help clear alt-dial-old calls
#
$version = '2.4-196';
$build = '111018-1529';
$version = '2.4-197';
$build = '111021-1549';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=425;
$mysql_log_count=436;
$one_mysql_log=0;
require("dbconnect.php");
@@ -509,6 +512,8 @@ if (isset($_GET["job_title"])) {$job_title=$_GET["job_title"];}
elseif (isset($_POST["job_title"])) {$job_title=$_POST["job_title"];}
if (isset($_GET["location"])) {$location=$_GET["location"];}
elseif (isset($_POST["location"])) {$location=$_POST["location"];}
if (isset($_GET["old_CID"])) {$old_CID=$_GET["old_CID"];}
elseif (isset($_POST["old_CID"])) {$old_CID=$_POST["old_CID"];}
header ("Content-type: text/html; charset=utf-8");
@@ -2372,7 +2377,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$temp_ac = substr("$agent_dialed_number", 0, 3);
$stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00426',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vcca_ct = mysql_num_rows($rslt);
if ($vcca_ct > 0)
@@ -2383,7 +2388,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00427',$user,$server_ip,$session_name,$one_mysql_log);}
}
$temp_CID = preg_replace("/\D/",'',$temp_vcca);
}
@@ -2868,6 +2873,20 @@ if ($ACTION == 'manDiaLonly')
}
else
{
##### clear out last call to same lead if exists #####
if (strlen($old_CID) > 16)
{
$old_lead_id = substr($old_CID, -10);
$old_lead_id = ($old_lead_id + 0);
if ($lead_id == "$old_lead_id")
{
$stmt="DELETE FROM vicidial_auto_calls where callerid='$old_CID' and lead_id='$old_lead_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00428',$user,$server_ip,$session_name,$one_mysql_log);}
}
}
##### grab number of calls today in this campaign and increment
$stmt="SELECT calls_today,extension FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
@@ -2960,7 +2979,7 @@ if ($ACTION == 'manDiaLonly')
$temp_ac = substr("$phone_number", 0, 3);
$stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00429',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vcca_ct = mysql_num_rows($rslt);
if ($vcca_ct > 0)
@@ -2971,7 +2990,7 @@ if ($ACTION == 'manDiaLonly')
$stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00430',$user,$server_ip,$session_name,$one_mysql_log);}
}
$temp_CID = preg_replace("/\D/",'',$temp_vcca);
}
@@ -8867,7 +8886,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
{$stage = '670';}
$stmt="select agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00431',$user,$server_ip,$session_name,$one_mysql_log);}
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
if ($camps_to_print > 0)
@@ -9044,7 +9063,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
$stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$user', source='agent', results='0', search_query=\"$SQL_log\";";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00432',$user,$server_ip,$session_name,$one_mysql_log);}
$search_log_id = mysql_insert_id($link);
if ( (preg_match("/contact_information/",$tables_use_alt_log_db)) and (strlen($alt_log_server_ip)>4) and (strlen($alt_log_dbname)>0) )
@@ -9056,7 +9075,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
{$linkALT = $link;}
$rsltALT=mysql_query($stmt, $linkALT);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00433',$user,$server_ip,$session_name,$one_mysql_log);}
$counts_to_print = mysql_num_rows($rsltALT);
if ($counts_to_print > 0)
{
@@ -9069,7 +9088,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
$stmtL="UPDATE vicidial_lead_search_log set results='$search_result_count',seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00434',$user,$server_ip,$session_name,$one_mysql_log);}
echo "<CENTER>\n";
echo "<font style=\"font-size:14px;font-family:sans-serif;\"><B>";
@@ -9092,7 +9111,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
{
$stmt="SELECT first_name,last_name,office_num,cell_num,other_num1,other_num2,bu_name,department,group_name,job_title,location from contact_information where $searchSQL order by first_name,last_name desc limit 1000;";
$rsltALT=mysql_query($stmt, $linkALT);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00435',$user,$server_ip,$session_name,$one_mysql_log);}
$out_logs_to_print = mysql_num_rows($rsltALT);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
@@ -9154,7 +9173,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
$stmtL="UPDATE vicidial_lead_search_log set seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00436',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{echo "<tr bgcolor=white><td colspan=10 align=center>No results found</td></tr>";}
+4 -3
View File
@@ -368,10 +368,11 @@
# 110919-1603 - Added Phone login load balancing grouping options
# 111015-2037 - Added contact search functions
# 111018-1528 - Added more contact fields, added code to prevent API transfer duplicates
# 111021-1623 - Fix for rare stuck vac issue with manual alt dial
#
$version = '2.4-335c';
$build = '111018-1528';
$version = '2.4-336c';
$build = '111021-1623';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=75;
$one_mysql_log=0;
@@ -6970,7 +6971,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{var call_prefix = manual_dial_prefix;}
manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension;
manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension + "&old_CID=" + LastCallCID;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(manDiaLonly_query);