From 243a84d1f560356d6d4fca8e30e19d71788248a8 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 20 Dec 2010 02:30:04 +0000 Subject: [PATCH] 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 --- agi/agi-VDAD_ALL_inbound.agi | 12 ++++++++---- agi/agi-VDAD_inbound_calltime_check.agi | 15 ++++++++------- .../TO_BE_TRANSLATED_2.4.txt | 1 + www/vicidial/admin.php | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 2bae27b3..4cb6c3ad 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -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++; } diff --git a/agi/agi-VDAD_inbound_calltime_check.agi b/agi/agi-VDAD_inbound_calltime_check.agi index 7a787375..0362c32d 100644 --- a/agi/agi-VDAD_inbound_calltime_check.agi +++ b/agi/agi-VDAD_inbound_calltime_check.agi @@ -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 LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell 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"; diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 6531fe41..18f8dbe7 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -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 diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 511976ee..b6a3e826 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -6022,7 +6022,7 @@ if ($ADD==99999)
- Default Start and Stop Times - 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. + Default Start and Stop Times - 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.