added queue_seconds to vicidial_closer_log

added update of queue_seconds in all inbound and closer AGI scripts
Fixed bug for inbound and closer calls in VDhangup agi script

git-svn-id: svn://192.168.202.10@245 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-09-05 16:49:30 +00:00
parent ba0b203521
commit e10a4b6ce8
15 changed files with 109 additions and 44 deletions
+10 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# VD_hangup.agi version 0.4 *DBI-version*
# VD_hangup.agi version 0.5 *DBI-version*
#
# NOTE: This script is only needed on Asterisk 1.2.X and higher systems
#
@@ -29,6 +29,7 @@
# 60719-1118 - changed to use DBI-DBD::mysql
# - changed to use /etc/astguiclient.conf for configs
# 60815-1210 - added output options check from database
# 60905-1113 - fixed Closer dropped call issue, added queue_seconds to VDCL
#
$script = 'VD_hangup.agi';
@@ -354,7 +355,7 @@ if (!$epc_countCUSTDATA)
$sthArows=$sthA->rows;
$epc_countCUSTDATA=0;
$VD_closecallid='';
while ($sthArows > $rec_countCUSTDATA)
while ($sthArows > $epc_countCUSTDATA)
{
@aryA = $sthA->fetchrow_array;
$VD_start_epoch = "$aryA[0]";
@@ -397,9 +398,14 @@ if (length($VD_closecallid) < 1)
if ($AGILOG) {$agi_string = "no VDCL record found: $uniqueid $calleridname $VD_lead_id $uniqueid"; &agi_output;}
exit;
}
if ($VD_status =~ /^DONE$|^INCALL$|^XFER$/)
{$VDCLSQL_status = "";}
else
{$VDCLSQL_status = "status='DROP',queue_seconds='$VD_seconds',";}
$VD_seconds = ($now_date_epoch - $VD_start_epoch);
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where closecallid = '$VD_closecallid';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set $VDCLSQL_status end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where closecallid = '$VD_closecallid';";
if ($AGILOG) {$agi_string = "|$VDCLSQL_status|$VD_status|\n|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL update: |$affected_rows|$uniqueid|$VD_closecallid|"; &agi_output;}
+7 -3
View File
@@ -414,8 +414,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDXL XFER vicidial_xfer_log update: |$affected_rows|$CIDlead_id|$VDADuser\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
### format the remote server dialstring to get the call to the overflow agent meetme room
$S='*';
$VDADremDIALstr='';
@@ -446,6 +444,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$CIDlead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -565,7 +569,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -463,8 +463,6 @@ if ($channel_status < 1)
my $affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
### format the remote server dialstring to get the call to the overflow agent meetme room
$S='*';
if( ($VDADserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/) && ($VDADserver_ip !~ /$VARserver_ip/) )
@@ -494,6 +492,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -615,7 +619,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+13 -5
View File
@@ -414,8 +414,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDXL XFER vicidial_xfer_log update: |$affected_rows|$CIDlead_id|$VDADuser\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -433,6 +431,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$CIDlead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -499,8 +503,6 @@ if ($channel_status < 1)
$stmtA = "UPDATE vicidial_xfer_log set closer='$VDADuser' where lead_id = '$CIDlead_id' order by call_date desc limit 1;";
my $affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDXL vicidial_xfer_log update: |$affected_rows|$new_lead_id|$VDADuser\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
### format the remote server dialstring to get the call to the overflow agent meetme room
$S='*';
@@ -531,6 +533,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$CIDlead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -650,7 +658,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
+13 -5
View File
@@ -464,8 +464,6 @@ if ($channel_status < 1)
my $affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -483,6 +481,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -553,8 +557,6 @@ if ($channel_status < 1)
my $affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|update of vcl table: $new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
### format the remote server dialstring to get the call to the overflow agent meetme room
$S='*';
if( $VDADserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ )
@@ -584,6 +586,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -703,7 +711,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -408,8 +408,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDXL XFER vicidial_xfer_log update: |$affected_rows|$CIDlead_id|$VDADuser\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -427,6 +425,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$CIDlead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -546,7 +550,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -452,8 +452,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDXL XFER vicidial_xfer_log update: |$affected_rows|$CIDlead_id|$VDADuser\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -471,6 +469,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$CIDlead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -590,7 +594,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$CIDlead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$CIDlead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -462,8 +462,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -481,6 +479,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -600,7 +604,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -447,8 +447,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -466,6 +464,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -585,7 +589,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -463,8 +463,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -482,6 +480,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -601,7 +605,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -485,8 +485,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -504,6 +502,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -623,7 +627,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -460,8 +460,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -479,6 +477,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -598,7 +602,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+7 -3
View File
@@ -459,8 +459,6 @@ if ($channel_status < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|$new_lead_id\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
if ($AGILOG) {$agi_string = "exiting VDAD app, transferring call to $VDADconf_exten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
@@ -478,6 +476,12 @@ if ($channel_status < 1)
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$new_lead_id' and call_date='$SQLdate';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
$dbhA->disconnect();
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
if ($AGILOG) {$agi_string = "XXXXX VDAD transferred: start|stop $start_time|$now_date"; &agi_output;}
@@ -597,7 +601,7 @@ if ($drop_seconds < 1)
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$new_lead_id' order by start_epoch desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$new_lead_id|\n|$stmtA|"; &agi_output;}
+1
View File
@@ -357,6 +357,7 @@ phone_number VARCHAR(12),
user VARCHAR(20),
comments VARCHAR(255),
processed ENUM('Y','N'),
queue_seconds DECIMAL(7,2) default '0',
index (lead_id),
index (call_date)
);
+2
View File
@@ -28,3 +28,5 @@ ALTER TABLE vicidial_campaigns ADD adaptive_dl_diff_target SMALLINT(3) default '
ALTER TABLE vicidial_campaign_stats ADD differential_onemin VARCHAR(20) default '0';
ALTER TABLE vicidial_campaign_stats ADD agents_average_onemin VARCHAR(20) default '0';
ALTER TABLE vicidial_closer_log ADD queue_seconds DECIMAL(7,2) default '0';