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:
@@ -1714,7 +1714,7 @@ if ( ($start_hold_estimate > 0) && ($moh_delay == '1') )
|
|||||||
{
|
{
|
||||||
@aryA = $sthA->fetchrow_array;
|
@aryA = $sthA->fetchrow_array;
|
||||||
$stage_wait_sec = $aryA[0];
|
$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)
|
if ($stage_wait_sec >= $holdtime_estimate_sec)
|
||||||
{
|
{
|
||||||
$livetime_estimate_sec = ($livetime_estimate_sec + $stage_wait_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);
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
if ($affected_rows < 1)
|
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);
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;}
|
if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,7 +292,6 @@ exit;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmtA = "SELECT count(*) FROM vicidial_live_agents where callerid='$callerid';";
|
$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 = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
$sthArows=$sthA->rows;
|
$sthArows=$sthA->rows;
|
||||||
@@ -304,6 +303,7 @@ while ($sthArows > $rec_count)
|
|||||||
$rec_count++;
|
$rec_count++;
|
||||||
}
|
}
|
||||||
$sthA->finish();
|
$sthA->finish();
|
||||||
|
if ($AGILOG) {$agi_string = "$Pseudo_duplicate_count|$stmtA|"; &agi_output;}
|
||||||
|
|
||||||
if ($Pseudo_duplicate_count > 0)
|
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');";
|
$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 = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
$sthArows=$sthA->rows;
|
$sthArows=$sthA->rows;
|
||||||
@@ -324,6 +323,7 @@ while ($sthArows > $rec_count)
|
|||||||
$rec_count++;
|
$rec_count++;
|
||||||
}
|
}
|
||||||
$sthA->finish();
|
$sthA->finish();
|
||||||
|
if ($AGILOG) {$agi_string = "$dialplan_duplicate_count|$stmtA|"; &agi_output;}
|
||||||
|
|
||||||
if ($dialplan_duplicate_count > 0)
|
if ($dialplan_duplicate_count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#
|
#
|
||||||
# changes:
|
# changes:
|
||||||
# 80525-0144 - First Build
|
# 80525-0144 - First Build
|
||||||
|
# 81015-0305 - Added drop logging
|
||||||
#
|
#
|
||||||
|
|
||||||
$script = 'agi-VDAD_inbound_calltime_check.agi';
|
$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);
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $uniqueid|$callerid|"; &agi_output;}
|
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;}
|
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||||
$affected_rowsL = $dbhA->do($stmtA);
|
$affected_rowsL = $dbhA->do($stmtA);
|
||||||
if ($AGILOG) {$agi_string = "-- LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;}
|
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/)
|
if ($after_hours_action =~ /MESSAGE/)
|
||||||
{
|
{
|
||||||
$AGI->stream_file('sip-silence');
|
$AGI->stream_file('sip-silence');
|
||||||
|
$AGI->stream_file('sip-silence');
|
||||||
$AGI->stream_file("$after_hours_message_filename");
|
$AGI->stream_file("$after_hours_message_filename");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user