Changed call time overflow to look at previous day stop time
git-svn-id: svn://192.168.202.10@1768 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -172,6 +172,7 @@
|
||||
# 111116-0157 - Added ALT and ADDR3 methods for CIDLOOKUP
|
||||
# 111201-1457 - Added grade-random next-agent-call option for inbound
|
||||
# 111219-2124 - Added max stats updating
|
||||
# 111229-1726 - Changed call time overflow to look at previous day stop time
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -755,16 +756,44 @@ if ($sthArows > 0)
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($wday==0) {$daySQL=',ct_sunday_start,ct_sunday_stop,sunday_afterhours_filename_override';}
|
||||
if ($wday==1) {$daySQL=',ct_monday_start,ct_monday_stop,monday_afterhours_filename_override';}
|
||||
if ($wday==2) {$daySQL=',ct_tuesday_start,ct_tuesday_stop,tuesday_afterhours_filename_override';}
|
||||
if ($wday==3) {$daySQL=',ct_wednesday_start,ct_wednesday_stop,wednesday_afterhours_filename_override';}
|
||||
if ($wday==4) {$daySQL=',ct_thursday_start,ct_thursday_stop,thursday_afterhours_filename_override';}
|
||||
if ($wday==5) {$daySQL=',ct_friday_start,ct_friday_stop,friday_afterhours_filename_override';}
|
||||
if ($wday==6) {$daySQL=',ct_saturday_start,ct_saturday_stop,saturday_afterhours_filename_override';}
|
||||
if ($wday==0)
|
||||
{
|
||||
$daySQL=',ct_sunday_start,ct_sunday_stop,sunday_afterhours_filename_override';
|
||||
$yestSQL=',ct_saturday_start,ct_saturday_stop';
|
||||
}
|
||||
if ($wday==1)
|
||||
{
|
||||
$daySQL=',ct_monday_start,ct_monday_stop,monday_afterhours_filename_override';
|
||||
$yestSQL=',ct_sunday_start,ct_sunday_stop';
|
||||
}
|
||||
if ($wday==2)
|
||||
{
|
||||
$daySQL=',ct_tuesday_start,ct_tuesday_stop,tuesday_afterhours_filename_override';
|
||||
$yestSQL=',ct_monday_start,ct_monday_stop';
|
||||
}
|
||||
if ($wday==3)
|
||||
{
|
||||
$daySQL=',ct_wednesday_start,ct_wednesday_stop,wednesday_afterhours_filename_override';
|
||||
$yestSQL=',ct_tuesday_start,ct_tuesday_stop';
|
||||
}
|
||||
if ($wday==4)
|
||||
{
|
||||
$daySQL=',ct_thursday_start,ct_thursday_stop,thursday_afterhours_filename_override';
|
||||
$yestSQL=',ct_wednesday_start,ct_wednesday_stop';
|
||||
}
|
||||
if ($wday==5)
|
||||
{
|
||||
$daySQL=',ct_friday_start,ct_friday_stop,friday_afterhours_filename_override';
|
||||
$yestSQL=',ct_thursday_start,ct_thursday_stop';
|
||||
}
|
||||
if ($wday==6)
|
||||
{
|
||||
$daySQL=',ct_saturday_start,ct_saturday_stop,saturday_afterhours_filename_override';
|
||||
$yestSQL=',ct_friday_start,ct_friday_stop';
|
||||
}
|
||||
|
||||
### Grab call_times values from the database
|
||||
$stmtA = "SELECT ct_default_start,ct_default_stop,default_afterhours_filename_override $daySQL FROM vicidial_call_times where call_time_id = '$call_time_id';";
|
||||
$stmtA = "SELECT ct_default_start,ct_default_stop,default_afterhours_filename_override $daySQL $yestSQL FROM vicidial_call_times where call_time_id = '$call_time_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -776,8 +805,15 @@ $deafult_afterhours_filename_override = $aryA[2];
|
||||
$ct_day_start = $aryA[3];
|
||||
$ct_day_stop = $aryA[4];
|
||||
$day_afterhours_filename_override = $aryA[5];
|
||||
$ct_yest_start = $aryA[6];
|
||||
$ct_yest_stop = $aryA[7];
|
||||
$sthA->finish();
|
||||
|
||||
if ( ($ct_yest_start < 1) && ($ct_yest_stop < 1) )
|
||||
{
|
||||
$ct_yest_start = $ct_default_start;
|
||||
$ct_yest_stop = $ct_default_stop;
|
||||
}
|
||||
if ( ($ct_day_start > 0) || ($ct_day_stop > 0) )
|
||||
{
|
||||
$ct_default_start = $ct_day_start;
|
||||
@@ -1223,8 +1259,8 @@ if ( ($max_calls_method !~ /DISABLED/) && ($max_calls_count > 0) )
|
||||
|
||||
##### BEGIN AFTER HOURS CHECK #####
|
||||
$ct_stop_overflow=0; # allow for overflow time, past midnight
|
||||
if ($ct_default_stop > 2400)
|
||||
{$ct_stop_overflow = ($ct_default_stop - 2400);}
|
||||
if ($ct_yest_stop > 2400)
|
||||
{$ct_stop_overflow = ($ct_yest_stop - 2400);}
|
||||
if ( ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_stop_overflow) ) || ($MCafterhours_override > 0) )
|
||||
{
|
||||
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
# 91122-2353 - Added QueueMetrics logging as IVR INFO entries
|
||||
# 101219-2110 - Added call time overflow
|
||||
# 110525-1347 - Added compatibility for outbound IVR logging
|
||||
# 111229-1716 - Changed call time overflow to look at previous day stop time
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_inbound_calltime_check.agi';
|
||||
@@ -134,7 +135,7 @@ if ($sthArows > 0)
|
||||
{
|
||||
$AGILOG = '0';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = "$aryA[0]";
|
||||
$DBagi_output = $aryA[0];
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
@@ -362,35 +363,70 @@ if (length($route_context_override) > 1)
|
||||
$ext_context = $route_context_override;
|
||||
}
|
||||
|
||||
if ($wday==0) {$daySQL=',ct_sunday_start,ct_sunday_stop';}
|
||||
if ($wday==1) {$daySQL=',ct_monday_start,ct_monday_stop';}
|
||||
if ($wday==2) {$daySQL=',ct_tuesday_start,ct_tuesday_stop';}
|
||||
if ($wday==3) {$daySQL=',ct_wednesday_start,ct_wednesday_stop';}
|
||||
if ($wday==4) {$daySQL=',ct_thursday_start,ct_thursday_stop';}
|
||||
if ($wday==5) {$daySQL=',ct_friday_start,ct_friday_stop';}
|
||||
if ($wday==6) {$daySQL=',ct_saturday_start,ct_saturday_stop';}
|
||||
if ($wday==0)
|
||||
{
|
||||
$daySQL=',ct_sunday_start,ct_sunday_stop';
|
||||
$yestSQL=',ct_saturday_start,ct_saturday_stop';
|
||||
}
|
||||
if ($wday==1)
|
||||
{
|
||||
$daySQL=',ct_monday_start,ct_monday_stop';
|
||||
$yestSQL=',ct_sunday_start,ct_sunday_stop';
|
||||
}
|
||||
if ($wday==2)
|
||||
{
|
||||
$daySQL=',ct_tuesday_start,ct_tuesday_stop';
|
||||
$yestSQL=',ct_monday_start,ct_monday_stop';
|
||||
}
|
||||
if ($wday==3)
|
||||
{
|
||||
$daySQL=',ct_wednesday_start,ct_wednesday_stop';
|
||||
$yestSQL=',ct_tuesday_start,ct_tuesday_stop';
|
||||
}
|
||||
if ($wday==4)
|
||||
{
|
||||
$daySQL=',ct_thursday_start,ct_thursday_stop';
|
||||
$yestSQL=',ct_wednesday_start,ct_wednesday_stop';
|
||||
}
|
||||
if ($wday==5)
|
||||
{
|
||||
$daySQL=',ct_friday_start,ct_friday_stop';
|
||||
$yestSQL=',ct_thursday_start,ct_thursday_stop';
|
||||
}
|
||||
if ($wday==6)
|
||||
{
|
||||
$daySQL=',ct_saturday_start,ct_saturday_stop';
|
||||
$yestSQL=',ct_friday_start,ct_friday_stop';
|
||||
}
|
||||
|
||||
$ct_default_start = '0';
|
||||
$ct_default_stop = '9999';
|
||||
|
||||
### Grab call_times values from the database
|
||||
$stmtA = "SELECT ct_default_start,ct_default_stop $daySQL FROM vicidial_call_times where call_time_id = '$call_time_id';";
|
||||
$stmtA = "SELECT ct_default_start,ct_default_stop $daySQL $yestSQL FROM vicidial_call_times where call_time_id = '$call_time_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$ct_default_start = $aryA[0];
|
||||
$ct_default_stop = $aryA[1];
|
||||
$ct_day_start = $aryA[2];
|
||||
$ct_day_stop = $aryA[3];
|
||||
$ct_default_start = $aryA[0];
|
||||
$ct_default_stop = $aryA[1];
|
||||
$ct_day_start = $aryA[2];
|
||||
$ct_day_stop = $aryA[3];
|
||||
$ct_yest_start = $aryA[4];
|
||||
$ct_yest_stop = $aryA[5];
|
||||
$sthA->finish();
|
||||
|
||||
if ( ($ct_yest_start < 1) && ($ct_yest_stop < 1) )
|
||||
{
|
||||
$ct_yest_start = $ct_default_start;
|
||||
$ct_yest_stop = $ct_default_stop;
|
||||
}
|
||||
if ( ($ct_day_start > 0) || ($ct_day_stop > 0) )
|
||||
{
|
||||
$ct_default_start = $ct_day_start;
|
||||
$ct_default_stop = $ct_day_stop;
|
||||
$ct_default_start = $ct_day_start;
|
||||
$ct_default_stop = $ct_day_stop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,8 +435,8 @@ $AGI->stream_file('sip-silence');
|
||||
|
||||
##### BEGIN AFTER HOURS CHECK #####
|
||||
$ct_stop_overflow=0; # allow for overflow time, past midnight
|
||||
if ($ct_default_stop > 2400)
|
||||
{$ct_stop_overflow = ($ct_default_stop - 2400);}
|
||||
if ($ct_yest_stop > 2400)
|
||||
{$ct_stop_overflow = ($ct_yest_stop - 2400);}
|
||||
if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_stop_overflow) )
|
||||
{
|
||||
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
|
||||
|
||||
Reference in New Issue
Block a user