Updates for agent 3-way press-1 calls feature
git-svn-id: svn://192.168.202.10@3778 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
# 180420-2302 - Fix for high-volume systems, added varibles to hangup queryCID
|
||||
# 200413-1356 - Fix for \n\n at the end of PING commands causing errors in AMI
|
||||
# 231117-2254 - Added AMI version 5 compatibility
|
||||
# 231118-1111 - Added override option of up to Xtimeout9 for 3WAY_... leave-3way sessions
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -400,6 +401,12 @@ if ($no_vc_3way_check < 1)
|
||||
{
|
||||
$NEWexten[$i] = $PTextensions[$i];
|
||||
$leave_3waySQL='1';
|
||||
if ($PTextensions[$i] =~ /Xtimeout9$/i) {$NEWexten[$i] =~ s/Xtimeout9$/Xtimeout8/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout8$/i) {$NEWexten[$i] =~ s/Xtimeout8$/Xtimeout7/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout7$/i) {$NEWexten[$i] =~ s/Xtimeout7$/Xtimeout6/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout6$/i) {$NEWexten[$i] =~ s/Xtimeout6$/Xtimeout5/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout5$/i) {$NEWexten[$i] =~ s/Xtimeout5$/Xtimeout4/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout4$/i) {$NEWexten[$i] =~ s/Xtimeout4$/Xtimeout3/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout3$/i) {$NEWexten[$i] =~ s/Xtimeout3$/Xtimeout2/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout2$/i) {$NEWexten[$i] =~ s/Xtimeout2$/Xtimeout1/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout1$/i) {$NEWexten[$i] = ''; $leave_3waySQL='0';}
|
||||
@@ -612,6 +619,12 @@ if ( !( ( @PTextensions == 1 ) && ( $PTextensions[0] eq '') ) )
|
||||
else
|
||||
{
|
||||
$NEWexten[$i] = $PTextensions[$i];
|
||||
if ($PTextensions[$i] =~ /Xtimeout9$/i) {$NEWexten[$i] =~ s/Xtimeout9$/Xtimeout8/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout8$/i) {$NEWexten[$i] =~ s/Xtimeout8$/Xtimeout7/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout7$/i) {$NEWexten[$i] =~ s/Xtimeout7$/Xtimeout6/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout6$/i) {$NEWexten[$i] =~ s/Xtimeout6$/Xtimeout5/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout5$/i) {$NEWexten[$i] =~ s/Xtimeout5$/Xtimeout4/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout4$/i) {$NEWexten[$i] =~ s/Xtimeout4$/Xtimeout3/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout3$/i) {$NEWexten[$i] =~ s/Xtimeout3$/Xtimeout2/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout2$/i) {$NEWexten[$i] =~ s/Xtimeout2$/Xtimeout1/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout1$/i) {$NEWexten[$i] = '';}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
# 180420-2301 - Fix for high-volume systems, added varibles to hangup queryCID
|
||||
# 200413-1356 - Fix for \n\n at the end of PING commands causing errors in AMI
|
||||
# 231117-2255 - Added AMI version 5 compatibility
|
||||
# 231118-1110 - Added override option of up to Xtimeout9 for 3WAY_... leave-3way sessions
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -405,6 +406,13 @@ while ($loops > $loop_counter)
|
||||
{
|
||||
$NEWexten[$i] = $PTextensions[$i];
|
||||
$leave_3waySQL='1';
|
||||
if ($PTextensions[$i] =~ /Xtimeout9$/i) {$NEWexten[$i] =~ s/Xtimeout9$/Xtimeout8/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout8$/i) {$NEWexten[$i] =~ s/Xtimeout8$/Xtimeout7/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout7$/i) {$NEWexten[$i] =~ s/Xtimeout7$/Xtimeout6/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout6$/i) {$NEWexten[$i] =~ s/Xtimeout6$/Xtimeout5/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout5$/i) {$NEWexten[$i] =~ s/Xtimeout5$/Xtimeout4/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout4$/i) {$NEWexten[$i] =~ s/Xtimeout4$/Xtimeout3/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout3$/i) {$NEWexten[$i] =~ s/Xtimeout3$/Xtimeout2/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout2$/i) {$NEWexten[$i] =~ s/Xtimeout2$/Xtimeout1/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout1$/i) {$NEWexten[$i] = ''; $leave_3waySQL='0';}
|
||||
if ( ($PTextensions[$i] !~ /Xtimeout\d$/i) and (length($PTextensions[$i])> 0) ) {$NEWexten[$i] .= 'Xtimeout2';}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
# 191029-1555 - Added flushing of vicidial_agent_vmm_overrides table
|
||||
# 220921-1148 - Added optimize of vicidial_users table
|
||||
# 230414-1622 - Added --reset-stuck-leads option
|
||||
# 231118-1256 - Added clearing of old vicidial_3way_press_live records
|
||||
#
|
||||
|
||||
$session_flush=0;
|
||||
@@ -591,6 +592,25 @@ while ($sthArowsSERVERS > $aas)
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
$stmtA = "DELETE from vicidial_3way_press_live where call_date < '$SQLdate_NEG_sixhour';";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
if (!$T) { $affected_rows = $dbhA->do($stmtA);}
|
||||
if (!$Q) {print " - vicidial_3way_press_live flush: $affected_rows rows\n";}
|
||||
|
||||
$stmtA = "OPTIMIZE table vicidial_3way_press_live;";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
if (!$T)
|
||||
{
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
}
|
||||
if (!$Q) {print " - OPTIMIZE vicidial_3way_press_live \n";}
|
||||
|
||||
|
||||
if ($session_flush > 0)
|
||||
{
|
||||
$stmtA = "DELETE from vicidial_sessions_recent where call_date < '$SQLdate_NEG_1hour';";
|
||||
|
||||
+36
-1
@@ -98,7 +98,8 @@
|
||||
# 221221-2134 - Added enhanced_disconnect_logging=3 support , issue #1367
|
||||
# 230120-1557 - Added CAMPDTO dialplan variable for ^DC 3-way agent screen calls
|
||||
# 231116-0846 - Added hopper_hold_inserts option
|
||||
#
|
||||
# 231118-1054 - Added hangup processing of 3-way press outside-agent calls
|
||||
#
|
||||
|
||||
# defaults for PreFork
|
||||
$VARfastagi_log_min_servers = '3';
|
||||
@@ -1042,6 +1043,40 @@ sub process_request
|
||||
}
|
||||
### END log end of real-time blind monitor calls ###
|
||||
|
||||
|
||||
### BEGIN log end of 3-way press outside-agent calls ###
|
||||
if ($callerid =~ /^T\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/)
|
||||
{
|
||||
$stmtA = "SELECT status from vicidial_3way_press_live where call_3way_id='$callerid';";
|
||||
$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;
|
||||
$sthA->finish();
|
||||
$TW_status = $aryA[0];
|
||||
|
||||
if ($TW_status !~ /HUNGUP/)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_3way_press_live SET status='HUNGUP' where call_3way_id='$callerid';";
|
||||
$affected_rowsTWV = $dbhA->do($stmtA);
|
||||
|
||||
$stmtB = "UPDATE vicidial_3way_press_log SET result=CONCAT(result,'|Hungup: ',NOW()) where call_3way_id='$callerid';";
|
||||
$affected_rowsTWL = $dbhA->do($stmtB);
|
||||
|
||||
if ($AGILOG) {$agi_string = "3WAY press outside-agent call updated: |$affected_rowsTWV|$affected_rowsTWL|$stmtA|$stmtB|"; &agi_output;}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "3WAY press outside-agent call NOT updated: |$TW_status|$stmtA|"; &agi_output;}
|
||||
}
|
||||
}
|
||||
if ($AGILOG) {$agi_string = "|$affected_rowsBM|$stmtA|$monitor_start_time|$EPOCHmonitor_start_time|"; &agi_output;}
|
||||
}
|
||||
### END log end of real-time blind monitor calls ###
|
||||
|
||||
|
||||
### get uniqueid and start_epoch from the call_log table
|
||||
$CALLunique_id = $unique_id;
|
||||
$stmtA = "SELECT uniqueid,start_epoch,channel,end_epoch,channel_group FROM call_log where uniqueid='$unique_id';";
|
||||
|
||||
Reference in New Issue
Block a user