fixed vicidial_log bug for closer calls in vdc_db_query.php
added hopper insertion logging to AST_VDhopper scripts added better DMTF filtering in agi-IVR script as well as a one hour timeout git-svn-id: svn://192.168.202.10@773 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -651,7 +651,7 @@ while ($digit_loop_counter < 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
$digit_loop_counter=1;
|
||||
$digit_loop_counter=-1;
|
||||
}
|
||||
|
||||
$digit_loop_counter++;
|
||||
|
||||
@@ -1155,9 +1155,10 @@ if ($agent_search_method =~ /^LO|^LB/)
|
||||
if ($hold_message_counter > $prompt_interval)
|
||||
{
|
||||
$AGI->stream_file('sip-silence'); # stop music-on-hold process
|
||||
$AGI->stream_file("$onhold_prompt_filename");
|
||||
$AGI->stream_file("$onhold_prompt_filename"); # this prompt must be less than 10 seconds long
|
||||
$hold_message_counter = 0;
|
||||
$start_moh=1;
|
||||
if ($drop_timer > 3) {$drop_timer = ($drop_timer + 5);} # add propmt play time to total queue time
|
||||
}
|
||||
else {$hold_message_counter++;}
|
||||
if ($hold_tone_counter > 3)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
# 71029-1929 - Added 5th and 6th NEW to list order
|
||||
# 71030-2043 - Added hopper priority for callbacks
|
||||
# 80112-0221 - Added 2nd, 3rd,... NEW for LAST NAME/PHONE Sort
|
||||
# 80125-0821 - Added detail logging of each lead inserted
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -122,7 +123,7 @@ if (length($ARGV[0])>1)
|
||||
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n";
|
||||
print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [--dbdetail] = additional level of logging the leads that are inserted into the hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -160,6 +161,11 @@ if (length($ARGV[0])>1)
|
||||
{
|
||||
$DB_show_offset=1;
|
||||
print "\n-----DEBUG GMT -----\n\n";
|
||||
}
|
||||
if ($args =~ /--dbdetail/i)
|
||||
{
|
||||
$DB_detail=1;
|
||||
# print "\n-----DEBUG DETAIL -----\n\n";
|
||||
}
|
||||
if ($args =~ /-t/i)
|
||||
{
|
||||
@@ -216,6 +222,7 @@ foreach(@conf)
|
||||
}
|
||||
|
||||
if (!$VDHLOGfile) {$VDHLOGfile = "$PATHlogs/hopper.$year-$mon-$mday";}
|
||||
if (!$VDHDLOGfile) {$VDHDLOGfile = "$PATHlogs/hopper-detail.$year-$mon-$mday";}
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
@@ -1076,11 +1083,14 @@ foreach(@campaign_id)
|
||||
@REC_leads_to_hopper=@MT;
|
||||
@REC_lists_to_hopper=@MT;
|
||||
@REC_phone_to_hopper=@MT;
|
||||
@REC_gmt_to_hopper=@MT;
|
||||
@REC_state_to_hopper=@MT;
|
||||
@REC_status_to_hopper=@MT;
|
||||
if ($rec_ct[$i] > 0)
|
||||
{
|
||||
if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";}
|
||||
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] limit 100;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] limit 100;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1095,6 +1105,7 @@ foreach(@campaign_id)
|
||||
$REC_gmt_to_hopper[$REC_rec_countLEADS] = "$aryA[2]";
|
||||
$REC_phone_to_hopper[$REC_rec_countLEADS] = "$aryA[3]";
|
||||
$REC_state_to_hopper[$REC_rec_countLEADS] = "$aryA[4]";
|
||||
$REC_status_to_hopper[$REC_rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$REC_rec_countLEADS++;
|
||||
}
|
||||
@@ -1112,6 +1123,9 @@ foreach(@campaign_id)
|
||||
@NEW_leads_to_hopper=@MT;
|
||||
@NEW_lists_to_hopper=@MT;
|
||||
@NEW_phone_to_hopper=@MT;
|
||||
@NEW_gmt_to_hopper=@MT;
|
||||
@NEW_state_to_hopper=@MT;
|
||||
@NEW_status_to_hopper=@MT;
|
||||
if ($NEW_count > 0)
|
||||
{
|
||||
$NEW_level = int($hopper_level[$i] / $NEW_count);
|
||||
@@ -1119,7 +1133,7 @@ foreach(@campaign_id)
|
||||
# $order_stmt = 'order by called_count, lead_id asc';
|
||||
if ($DB) {print " looking for $NEW_level NEW leads mixed in with $OTHER_level other leads\n";}
|
||||
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $NEW_level;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $NEW_level;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1132,6 +1146,7 @@ foreach(@campaign_id)
|
||||
$NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$aryA[2]";
|
||||
$NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$aryA[3]";
|
||||
$NEW_state_to_hopper[$NEW_rec_countLEADS] = "$aryA[4]";
|
||||
$NEW_status_to_hopper[$NEW_rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$NEW_rec_countLEADS++;
|
||||
}
|
||||
@@ -1150,10 +1165,11 @@ foreach(@campaign_id)
|
||||
@gmt_to_hopper=@MT;
|
||||
@state_to_hopper=@MT;
|
||||
@phone_to_hopper=@MT;
|
||||
@status_to_hopper=@MT;
|
||||
if ($campaign_leads_to_call[$i] > 0)
|
||||
{
|
||||
if ($DB) {print " lead call order: $order_stmt\n";}
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1175,6 +1191,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$NEW_status_to_hopper[$NEW_in]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";}
|
||||
$rec_countLEADS++;
|
||||
$NEW_in++;
|
||||
@@ -1188,6 +1205,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$REC_status_to_hopper[$REC_insert_count]";
|
||||
$rec_countLEADS++;
|
||||
$REC_insert_count++;
|
||||
}
|
||||
@@ -1196,6 +1214,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$aryA[2]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$aryA[4]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$aryA[3]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$rec_countLEADS++;
|
||||
$rec_count++;
|
||||
@@ -1210,6 +1229,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$REC_status_to_hopper[$REC_insert_count]";
|
||||
$rec_countLEADS++;
|
||||
$REC_insert_count++;
|
||||
}
|
||||
@@ -1251,6 +1271,11 @@ foreach(@campaign_id)
|
||||
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0');";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";}
|
||||
if ($DB_detail)
|
||||
{
|
||||
$detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|";
|
||||
&detail_logger;
|
||||
}
|
||||
}
|
||||
}
|
||||
$h++;
|
||||
@@ -1293,3 +1318,16 @@ if ($SYSLOG)
|
||||
$event_string='';
|
||||
}
|
||||
|
||||
sub detail_logger
|
||||
{
|
||||
if ($SYSLOG)
|
||||
{
|
||||
### open the log file for writing ###
|
||||
open(LDout, ">>$VDHDLOGfile")
|
||||
|| die "Can't open $VDHDLOGfile: $!\n";
|
||||
print LDout "$now_date|$detail_string|\n";
|
||||
close(LDout);
|
||||
}
|
||||
$detail_string='';
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
# 71029-1929 - Added 5th and 6th NEW to list order
|
||||
# 71030-2043 - Added hopper priority for callbacks
|
||||
# 80112-0221 - Added 2nd, 3rd,... NEW for LAST NAME/PHONE Sort
|
||||
# 80125-0821 - Added detail logging of each lead inserted
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -124,7 +125,7 @@ if (length($ARGV[0])>1)
|
||||
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n";
|
||||
print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [--dbdetail] = additional level of logging the leads that are inserted into the hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -162,6 +163,11 @@ if (length($ARGV[0])>1)
|
||||
{
|
||||
$DB_show_offset=1;
|
||||
print "\n-----DEBUG GMT -----\n\n";
|
||||
}
|
||||
if ($args =~ /--dbdetail/i)
|
||||
{
|
||||
$DB_detail=1;
|
||||
# print "\n-----DEBUG DETAIL -----\n\n";
|
||||
}
|
||||
if ($args =~ /-t/i)
|
||||
{
|
||||
@@ -218,6 +224,7 @@ foreach(@conf)
|
||||
}
|
||||
|
||||
if (!$VDHLOGfile) {$VDHLOGfile = "$PATHlogs/hopper.$year-$mon-$mday";}
|
||||
if (!$VDHDLOGfile) {$VDHDLOGfile = "$PATHlogs/hopper-detail.$year-$mon-$mday";}
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
@@ -1126,11 +1133,14 @@ foreach(@campaign_id)
|
||||
@REC_leads_to_hopper=@MT;
|
||||
@REC_lists_to_hopper=@MT;
|
||||
@REC_phone_to_hopper=@MT;
|
||||
@REC_gmt_to_hopper=@MT;
|
||||
@REC_state_to_hopper=@MT;
|
||||
@REC_status_to_hopper=@MT;
|
||||
if ($rec_ct[$i] > 0)
|
||||
{
|
||||
if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";}
|
||||
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] limit 100;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] limit 100;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1145,6 +1155,7 @@ foreach(@campaign_id)
|
||||
$REC_gmt_to_hopper[$REC_rec_countLEADS] = "$aryA[2]";
|
||||
$REC_phone_to_hopper[$REC_rec_countLEADS] = "$aryA[3]";
|
||||
$REC_state_to_hopper[$REC_rec_countLEADS] = "$aryA[4]";
|
||||
$REC_status_to_hopper[$REC_rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$REC_rec_countLEADS++;
|
||||
}
|
||||
@@ -1162,6 +1173,9 @@ foreach(@campaign_id)
|
||||
@NEW_leads_to_hopper=@MT;
|
||||
@NEW_lists_to_hopper=@MT;
|
||||
@NEW_phone_to_hopper=@MT;
|
||||
@NEW_gmt_to_hopper=@MT;
|
||||
@NEW_state_to_hopper=@MT;
|
||||
@NEW_status_to_hopper=@MT;
|
||||
if ( ($NEW_count > 0) && ($list_order_mix[$i] =~ /DISABLED/) )
|
||||
{
|
||||
$NEW_level = int($hopper_level[$i] / $NEW_count);
|
||||
@@ -1169,7 +1183,7 @@ foreach(@campaign_id)
|
||||
# $order_stmt = 'order by called_count, lead_id asc';
|
||||
if ($DB) {print " looking for $NEW_level NEW leads mixed in with $OTHER_level other leads\n";}
|
||||
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $NEW_level;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $NEW_level;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1182,6 +1196,7 @@ foreach(@campaign_id)
|
||||
$NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$aryA[2]";
|
||||
$NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$aryA[3]";
|
||||
$NEW_state_to_hopper[$NEW_rec_countLEADS] = "$aryA[4]";
|
||||
$NEW_status_to_hopper[$NEW_rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$NEW_rec_countLEADS++;
|
||||
}
|
||||
@@ -1200,13 +1215,14 @@ foreach(@campaign_id)
|
||||
@gmt_to_hopper=@MT;
|
||||
@state_to_hopper=@MT;
|
||||
@phone_to_hopper=@MT;
|
||||
@status_to_hopper=@MT;
|
||||
if ($campaign_leads_to_call[$i] > 0)
|
||||
{
|
||||
if ($DB) {print " lead call order: $order_stmt\n";}
|
||||
|
||||
if ($list_order_mix[$i] =~ /DISABLED/)
|
||||
{
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1228,6 +1244,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$NEW_status_to_hopper[$NEW_in]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";}
|
||||
$rec_countLEADS++;
|
||||
$NEW_in++;
|
||||
@@ -1241,6 +1258,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$REC_status_to_hopper[$REC_insert_count]";
|
||||
$rec_countLEADS++;
|
||||
$REC_insert_count++;
|
||||
}
|
||||
@@ -1249,6 +1267,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$aryA[2]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$aryA[4]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$aryA[3]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$aryA[5]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
|
||||
$rec_countLEADS++;
|
||||
$rec_count++;
|
||||
@@ -1276,7 +1295,7 @@ foreach(@campaign_id)
|
||||
if ($DBX) {print " LM $x |$list_mix_stepARY[0]|$list_mix_stepARY[2]|$LM_step_goal[$x]|$list_mix_stepARY[3]|\n";}
|
||||
$list_mix_dialableSQL = "(list_id='$list_mix_stepARY[0]' and status IN($list_mix_stepARY[3]))";
|
||||
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and $list_mix_dialableSQL and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $LM_step_goal[$x];";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status FROM vicidial_list where called_since_last_reset='N' and $list_mix_dialableSQL and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $LM_step_goal[$x];";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1299,7 +1318,7 @@ foreach(@campaign_id)
|
||||
$order = ( ($x * 1000000) + $rec_count);
|
||||
}
|
||||
}
|
||||
$LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]";
|
||||
$LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]$USX$aryA[5]";
|
||||
# if ($DBX) {print " $z|$LM_results[$z]\n";}
|
||||
|
||||
$rec_count++;
|
||||
@@ -1323,6 +1342,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$REC_status_to_hopper[$REC_insert_count]";
|
||||
$rec_countLEADS++;
|
||||
$REC_insert_count++;
|
||||
}
|
||||
@@ -1331,6 +1351,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$aryA[3]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$aryA[4]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$aryA[5]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$aryA[6]";
|
||||
if ($DB_show_offset) {print "LEAD_ADD: $aryA[3] $aryA[4] $aryA[5]\n";}
|
||||
if ($DBX) {print " $w|$LM_results[$w]\n";}
|
||||
$rec_countLEADS++;
|
||||
@@ -1346,6 +1367,7 @@ foreach(@campaign_id)
|
||||
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
|
||||
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
|
||||
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
|
||||
$status_to_hopper[$rec_countLEADS] = "$REC_status_to_hopper[$REC_insert_count]";
|
||||
$rec_countLEADS++;
|
||||
$REC_insert_count++;
|
||||
}
|
||||
@@ -1387,6 +1409,11 @@ foreach(@campaign_id)
|
||||
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0');";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";}
|
||||
if ($DB_detail)
|
||||
{
|
||||
$detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|";
|
||||
&detail_logger;
|
||||
}
|
||||
}
|
||||
}
|
||||
$h++;
|
||||
@@ -1429,3 +1456,16 @@ if ($SYSLOG)
|
||||
$event_string='';
|
||||
}
|
||||
|
||||
sub detail_logger
|
||||
{
|
||||
if ($SYSLOG)
|
||||
{
|
||||
### open the log file for writing ###
|
||||
open(LDout, ">>$VDHDLOGfile")
|
||||
|| die "Can't open $VDHDLOGfile: $!\n";
|
||||
print LDout "$now_date|$detail_string|\n";
|
||||
close(LDout);
|
||||
}
|
||||
$detail_string='';
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# 71121-1048 - Added -p flag to mkdir to not show errors
|
||||
# 80107-2341 - Added --build_multiserver_conf flag to generate dynamic multi-server conf sections
|
||||
# 80115-1426 - Added ip_relay scripts for port forwarding
|
||||
# 80122-0320 - Added build_phones_conf flag to generate phones conf entries from phones table records
|
||||
#
|
||||
|
||||
############################################
|
||||
|
||||
@@ -143,10 +143,11 @@
|
||||
# 71223-0318 - changed logging of closer calls
|
||||
# 71226-1117 - added option to kick all calls from conference upon logout
|
||||
# 80116-1032 - added user_closer_log logging in regCLOSER
|
||||
# 80125-1213 - fixed vicidial_log bug when call is from closer
|
||||
#
|
||||
|
||||
$version = '2.0.5-68';
|
||||
$build = '80116-1032';
|
||||
$version = '2.0.5-69';
|
||||
$build = '80125-1213';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -1111,11 +1112,20 @@ if ($stage == "end")
|
||||
}
|
||||
else {$length_in_sec = ($StarTtime - $start_epoch);}
|
||||
|
||||
$closer_logged=0;
|
||||
if ($check_inbound > 0)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' order by start_epoch desc limit 1;";
|
||||
$four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d")-1,date("Y")));
|
||||
|
||||
$stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by start_epoch desc limit 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
if ($affected_rows > 0)
|
||||
{
|
||||
$closer_logged=1;
|
||||
echo "$uniqueid\n$channel\n";
|
||||
}
|
||||
}
|
||||
|
||||
#############################################
|
||||
@@ -1357,19 +1367,22 @@ if ($stage == "end")
|
||||
}
|
||||
}
|
||||
|
||||
##### look for the channel in the UPDATED vicidial_manager record of the call initiation
|
||||
$stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
if ($closer_logged < 1)
|
||||
{
|
||||
##### update the duration and end time in the vicidial_log table
|
||||
$stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
|
||||
if ($affected_rows > 0)
|
||||
{
|
||||
echo "$uniqueid\n$channel\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "LOG NOT ENTERED\n\n";
|
||||
if ($affected_rows > 0)
|
||||
{
|
||||
echo "$uniqueid\n$channel\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "LOG NOT ENTERED\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user