Added the ability to have inbound call times go beyond midnight.

git-svn-id: svn://192.168.202.10@1581 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-12-20 02:30:04 +00:00
parent c20d7a2447
commit 243a84d1f5
4 changed files with 18 additions and 12 deletions
+8 -4
View File
@@ -143,6 +143,7 @@
# 100903-0041 - Changed lead_id max length to 10 digits
# 100929-1201 - Added add_lead_url feature
# 101008-0410 - Added option for alternate Minimum Hold Time Message
# 101219-2110 - Added call time overflow
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -956,7 +957,10 @@ else
##### BEGIN AFTER HOURS CHECK #####
if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$ct_stop_overflow=0; # allow for overflow time, past midnight
if ($ct_default_stop > 2400)
{$ct_stop_overflow = ($ct_default_stop - 2400);}
if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_stop_overflow) )
{
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
@@ -975,7 +979,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$cbc++;
}
$sthA->finish();
if ($AGILOG) {$agi_string = "-- AH VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|\n|$stmtA|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|$hm|$ct_default_start|$ct_default_stop|$ct_stop_overflow\n|$stmtA|"; &agi_output;}
if ($VLEcount < 1)
{
@@ -1172,7 +1176,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/)
$stmtA = "INSERT INTO vicidial_log_extended set uniqueid='$uniqueid',server_ip='$VARserver_ip',call_date='$now_date',lead_id = '$insert_lead_id',caller_code='$callerid',custom_call_id='$custom_call_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02146'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- AH VLE insert: |$affected_rows|\n|$stmtA|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- NANQUE VLE insert: |$affected_rows|\n|$stmtA|"; &agi_output;}
$VLEcount++;
}
@@ -1582,7 +1586,7 @@ if ($VLEcount < 1)
$stmtA = "INSERT INTO vicidial_log_extended set uniqueid='$uniqueid',server_ip='$VARserver_ip',call_date='$now_date',lead_id = '$insert_lead_id',caller_code='$callerid',custom_call_id='$custom_call_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02147'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- AH VLE insert: |$affected_rows|\n|$stmtA|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- ENTER QUEUE VLE insert: |$affected_rows|\n|$stmtA|"; &agi_output;}
$VLEcount++;
}
+8 -7
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_inbound_calltime_check.agi version 2.2.0
# agi-VDAD_inbound_calltime_check.agi version 2.4
#
# Runs when a call comes in from an inbound call. This script will check the
# settings of the defined calltime scheme in VICIDIAL and either send the call
@@ -26,7 +26,7 @@
#exten => 1234,2,AGI(agi-VDAD_inbound_calltime_check.agi,INBOUND-----YES-----START-----24hours-----EXTENSION-----101-----default)
#exten => 1234,3,Hangup
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 80525-0144 - First Build
@@ -36,6 +36,7 @@
# 90504-1555 - Added call time scheme override
# 90621-1130 - Fixed issue when no call time is specified
# 91122-2353 - Added QueueMetrics logging as IVR INFO entries
# 101219-2110 - Added call time overflow
#
$script = 'agi-VDAD_inbound_calltime_check.agi';
@@ -369,11 +370,11 @@ if ($sthArows > 0)
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
##### BEGIN AFTER HOURS CHECK #####
if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$ct_stop_overflow=0; # allow for overflow time, past midnight
if ($ct_default_stop > 2400)
{$ct_stop_overflow = ($ct_default_stop - 2400);}
if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_stop_overflow) )
{
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
@@ -400,7 +401,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
sleep(1);
if ($AGILOG) {$agi_string = "exiting the VDAD app after hours, transferring call to $DROPexten"; &agi_output;}
if ($AGILOG) {$agi_string = "exiting the VDAD app after hours, transferring call to $DROPexten |$hm|$ct_default_start|$ct_default_stop|$ct_stop_overflow|"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
print "SET EXTENSION $DROPexten\n";
@@ -495,6 +495,7 @@ SHOW LEAD STATUSES IN THIS CAMPAIGN||
RELOAD NOW||
refresh||
You can also set a label to ---HIDE--- to hide both the label and the field||
For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time||
AST_LISTS_campaign_stats.php
+1 -1
View File
@@ -6022,7 +6022,7 @@ if ($ADD==99999)
<BR>
<A NAME="vicidial_call_times-ct_default_start">
<B>Default Start and Stop Times -</B> This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400.
<B>Default Start and Stop Times -</B> This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400. For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time.
<BR>
<A NAME="vicidial_call_times-ct_sunday_start">