small bug fixes and logging changes for inbound and outbound AGI scripts

git-svn-id: svn://192.168.202.10@978 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-10-15 08:09:12 +00:00
parent 3df164b645
commit 218888aba6
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -1714,7 +1714,7 @@ if ( ($start_hold_estimate > 0) && ($moh_delay == '1') )
{
@aryA = $sthA->fetchrow_array;
$stage_wait_sec = $aryA[0];
$stage_wait_sec =~ s/LIVE-|CLOSE-//gi;
$stage_wait_sec =~ s/LIVE-|CLOSE-|CLOSER-//gi;
if ($stage_wait_sec >= $holdtime_estimate_sec)
{
$livetime_estimate_sec = ($livetime_estimate_sec + $stage_wait_sec);
@@ -1947,7 +1947,7 @@ $stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid
$affected_rows = $dbhA->do($stmtA);
if ($affected_rows < 1)
{
$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority) values('$VARserver_ip','$channel_group','CLOSER','$insert_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','CLOSER-$drop_timer','$queue_priority')";
$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority) values('$VARserver_ip','$channel_group','LIVE','$insert_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-$drop_timer','$queue_priority')";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;}
}
+2 -2
View File
@@ -292,7 +292,6 @@ exit;
}
$stmtA = "SELECT count(*) FROM vicidial_live_agents where callerid='$callerid';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -304,6 +303,7 @@ while ($sthArows > $rec_count)
$rec_count++;
}
$sthA->finish();
if ($AGILOG) {$agi_string = "$Pseudo_duplicate_count|$stmtA|"; &agi_output;}
if ($Pseudo_duplicate_count > 0)
{
@@ -312,7 +312,6 @@ exit;
}
$stmtA = "SELECT count(*) FROM vicidial_auto_calls where callerid='$callerid' and status IN('LIVE','XFER');";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -324,6 +323,7 @@ while ($sthArows > $rec_count)
$rec_count++;
}
$sthA->finish();
if ($AGILOG) {$agi_string = "$dialplan_duplicate_count|$stmtA|"; &agi_output;}
if ($dialplan_duplicate_count > 0)
{
@@ -23,6 +23,7 @@
#
# changes:
# 80525-0144 - First Build
# 81015-0305 - Added drop logging
#
$script = 'agi-VDAD_inbound_calltime_check.agi';
@@ -346,7 +347,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $uniqueid|$callerid|"; &agi_output;}
$stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,start_time) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$SQLdate')";
$stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,start_time,comment_a,comment_b,comment_c) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$SQLdate','$channel_group','$phone_number','AFTERHOURSDROP')";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsL = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;}
@@ -361,6 +362,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
if ($after_hours_action =~ /MESSAGE/)
{
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
$AGI->stream_file("$after_hours_message_filename");
sleep(1);