Added code for 3-way-press-agent functions in agent screen, more to follow.

git-svn-id: svn://192.168.202.10@3777 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2023-11-18 12:42:31 +00:00
parent fd3dae330e
commit 0175a169be
8 changed files with 1518 additions and 3 deletions
@@ -69,6 +69,7 @@
# 230421-0057 - Added vicidial_agent_latency_summary_log archiving
# 230507-0804 - Added vicidial_latency_gaps archiving
# 231028-0810 - Added --url-log-only and --url-log-days=x options for purging of vicidial_url_log table only
# 231117-1914 - Added vicidial_3way_press_log archiving
#
$CALC_TEST=0;
@@ -3444,6 +3445,58 @@ if (!$T)
}
##### vicidial_3way_press_log
$stmtA = "SELECT count(*) from vicidial_3way_press_log;";
$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;
$vicidial_3way_press_log_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from vicidial_3way_press_log_archive;";
$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;
$vicidial_3way_press_log_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_3way_press_log table... ($vicidial_3way_press_log_count|$vicidial_3way_press_log_archive_count)\n";}
$stmtA = "INSERT IGNORE INTO vicidial_3way_press_log_archive SELECT * from vicidial_3way_press_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows inserted into vicidial_3way_press_log_archive table \n";}
$rv = $sthA->err();
if (!$rv)
{
if ($wipe_all > 0)
{$stmtA = "DELETE FROM vicidial_3way_press_log;";}
else
{$stmtA = "DELETE FROM vicidial_3way_press_log WHERE call_date < '$del_time';";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from vicidial_3way_press_log table \n";}
$stmtA = "optimize table vicidial_3way_press_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$stmtA = "optimize table vicidial_3way_press_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
##### vicidial_call_notes
$stmtA = "SELECT count(*) from vicidial_call_notes;";
+38 -1
View File
@@ -4,7 +4,7 @@
#
# This script checks if there are channels in reserved conferences
#
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# 50810-1532 - Added database server variable definitions lookup
# 50823-1456 - Added commandline arguments for debug at runtime
@@ -21,6 +21,7 @@
# 170916-0947 - Added support for AMI version 2+
# 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
#
# constants
@@ -350,6 +351,24 @@ if ($no_vc_3way_check < 1)
if ($DB) {print "\n\n|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/--END COMMAND--\n\n/');
}
elsif ($ami_version =~ /^5\./i)
{
# get the current time
( $now_sec, $now_micro_sec ) = gettimeofday();
# figure out how many micro seconds since epoch
$now_micro_epoch = $now_sec * 1000000;
$now_micro_epoch = $now_micro_epoch + $now_micro_sec;
$begin_micro_epoch = $now_micro_epoch;
# create a new action id
$action_id = "$now_sec.$now_micro_sec";
$COMMAND = "Action: Command\nActionID:$action_id\nCommand: Meetme list $PT_conf_extens[$i]";
if ($DB) {print "\n\n|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/\n\n/');
}
$j=0;
$conf_empty[$i]=0;
@@ -541,6 +560,24 @@ if ( !( ( @PTextensions == 1 ) && ( $PTextensions[0] eq '') ) )
if ($DB) {print "|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/--END COMMAND--/');
}
elsif ($ami_version =~ /^5\./i)
{
# get the current time
( $now_sec, $now_micro_sec ) = gettimeofday();
# figure out how many micro seconds since epoch
$now_micro_epoch = $now_sec * 1000000;
$now_micro_epoch = $now_micro_epoch + $now_micro_sec;
$begin_micro_epoch = $now_micro_epoch;
# create a new action id
$action_id = "$now_sec.$now_micro_sec";
$COMMAND = "Action: Command\nActionID: $action_id\nCommand: Meetme list $PT_conf_extens[$i]";
if ($DB) {print "|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/\n\n/');
}
$j=0;
$conf_empty[$i]=0;
+21 -1
View File
@@ -11,7 +11,7 @@
# script's crontab entry that does some of these functions:
# AST_conf_update.pl --no-vc-3way-check
#
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# 100811-2119 - First build, based upon AST_conf_update.pl script
# 100928-1506 - Changed from hard-coded 60 minute limit to servers.vicidial_recording_limit
@@ -21,6 +21,7 @@
# 170921-1814 - Added support for AMI2
# 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
#
# constants
@@ -349,6 +350,25 @@ while ($loops > $loop_counter)
&event_logger;
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/--END COMMAND--\n\n/');
}
elsif ($ami_version =~ /^5\./i)
{
# get the current time
( $now_sec, $now_micro_sec ) = gettimeofday();
# figure out how many micro seconds since epoch
$now_micro_epoch = $now_sec * 1000000;
$now_micro_epoch = $now_micro_epoch + $now_micro_sec;
$begin_micro_epoch = $now_micro_epoch;
# create a new action id
$action_id = "$now_sec.$now_micro_sec";
$COMMAND = "Action: Command\nActionID:$action_id\nCommand: Meetme list $PT_conf_extens[$i]";
$event_string = "|$PT_conf_extens[$i]|$COMMAND|";
&event_logger;
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/\n\n/');
}
$j=0;