Stereo Call Recording commit

git-svn-id: svn://192.168.202.10@3941 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2025-09-19 17:23:26 +00:00
parent 437b3c463a
commit 4c6019a6be
36 changed files with 5618 additions and 279 deletions
+52 -2
View File
@@ -173,9 +173,10 @@
# 240401-1810 - Added purging of vicidial_pending_ar records older than 7 days
# 240420-2209 - Added Conference Updater option
# 250103-0932 - Added ConfBridge code and enhanced_agent_monitoring system setting code
# 250914-1601 - Added pruning of recording_live table entries over 7 days old, deletion of parallel recording source files 3+ days
#
$build = '250103-0932';
$build = '250914-1601';
$DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file
@@ -444,6 +445,8 @@ foreach(@conf)
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) )
{$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;}
if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) )
{$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;}
if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) )
@@ -496,7 +499,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
##### Get the settings from system_settings #####
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts FROM system_settings;";
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts,stereo_recording,stereo_parallel_recording FROM system_settings;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -528,6 +531,8 @@ if ($sthArows > 0)
$SSweekday_resets = $aryA[21];
$SShighest_lead_id = $aryA[22];
$SShopper_hold_inserts = $aryA[23];
$SSstereo_recording = $aryA[24];
$SSstereo_parallel_recording = $aryA[25];
}
$sthA->finish();
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
@@ -1216,6 +1221,36 @@ if ($timeclock_end_of_day_NOW > 0)
}
if ($teodDB) {$event_string = "Empty $vicidial_conf_table entries cleared: $conf_cleared"; &teod_logger;}
### If stereo parallel recording is enabled on this system, delete parallel source files over 3 days old every night
if ( ($SSstereo_recording > 0) && ($SSstereo_parallel_recording > 0) )
{
### find 'find' to gather the list of files to delete
$findbin = '';
if ( -e ('/usr/bin/find')) {$findbin = '/usr/bin/find';}
else
{
if ( -e ('/bin/find')) {$findbin = '/bin/find';}
else
{
if ( -e ('/usr/sbin/find')) {$findbin = '/usr/sbin/find';}
else
{
if ($DB) {print "Can't find -find- binary! No file deletions will be possible...\n";}
}
}
}
$PATHmonitorTRASH = $PATHmonitor.'TRASH';
$now_epoch = int(time());
# command to trigger old stereo parallel source file deletion:
$parallel_delete_command = "$findbin $PATHmonitorTRASH -maxdepth 2 -type f -mtime +3 | xargs rm -f ";
if (!$Q) {print "Triggering old Parallel source recording file deletion... |$parallel_delete_command| \n";}
`/usr/bin/screen -d -m -S PD$reset_test $parallel_delete_command `;
$end_epoch = int(time());
$run_length = ($end_epoch - $now_epoch);
if (!$Q) {print " Parallel source recording file deletion complete ($run_length sec) \n";}
if ($teodDB) {$event_string = "Old Parallel source recording file deletion complete ($run_length sec): $parallel_delete_command"; &teod_logger;}
}
### Only run the following on one server in the cluster, the one set as the active voicemail server ###
if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) )
@@ -2308,6 +2343,21 @@ if ($timeclock_end_of_day_NOW > 0)
##### END vicidial_lead_24hour_calls end of day process removing records older than 1 day #####
##### BEGIN recording_live_log end of day process removing records older than 7 days #####
$stmtA = "DELETE FROM recording_live_log WHERE start_time < \"$SDSQLdate\";";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
$event_string = "$sthArows rows deleted from recording_live_log table";
if (!$Q) {print "$event_string \n";}
if ($teodDB) {&teod_logger;}
$stmtA = "optimize table recording_live_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
##### END recording_live_log end of day process removing records older than 7 days #####
##### START latency log summary log inserts
##### gather vicidial_agent_latency_log #####