diff --git a/bin/AST_CRON_mix_recordings.pl b/bin/AST_CRON_mix_recordings.pl index 1de86d84..39e98e24 100644 --- a/bin/AST_CRON_mix_recordings.pl +++ b/bin/AST_CRON_mix_recordings.pl @@ -68,6 +68,8 @@ foreach(@conf) {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) @@ -100,6 +102,7 @@ $server_ip = $VARserver_ip; # Asterisk server IP ### directory where in/out recordings are saved to by Asterisk $dir1 = "$PATHmonitor"; +$dir2 = "$PATHDONEmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} @@ -153,20 +156,19 @@ foreach(@FILES) if ($ping_good) { - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir2/$ALLfile"`; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} if (!$T) { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + `mv -f "$dir1/$INfile" "$dir2/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir2/ORIG/$OUTfile"`; } $ftp = Net::FTP->new("$VARFTP_host", Port => 21); $ftp->login("$VARFTP_user","$VARFTP_pass"); $ftp->cwd("$VARFTP_dir"); $ftp->binary(); - $ftp->put("$dir1/DONE/$ALLfile", "$ALLfile"); + $ftp->put("$dir2/$ALLfile", "$ALLfile"); $ftp->quit; } ### END Remote file transfer diff --git a/bin/AST_CRON_mix_recordings_GSM.pl b/bin/AST_CRON_mix_recordings_GSM.pl index a8d9b0f7..56e2fe7b 100644 --- a/bin/AST_CRON_mix_recordings_GSM.pl +++ b/bin/AST_CRON_mix_recordings_GSM.pl @@ -67,6 +67,8 @@ foreach(@conf) {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) @@ -99,6 +101,7 @@ $server_ip = $VARserver_ip; # Asterisk server IP ### directory where in/out recordings are saved to by Asterisk $dir1 = "$PATHmonitor"; +$dir2 = "$PATHDONEmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} @@ -164,34 +167,29 @@ foreach(@FILES) if ($ping_good) { - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir2/$ALLfile"`; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} if (!$T) { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + `mv -f "$dir1/$INfile" "$dir2/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir2/ORIG/$OUTfile"`; } - `$soxbin "$dir1/DONE/$ALLfile" "$dir1/DONE/$GSMfile"`; + `$soxbin "$dir2/$ALLfile" "$dir2/$GSMfile"`; if (!$T) { - `rm -f "$dir1/DONE/$ALLfile"`; + `rm -f "$dir2/$ALLfile"`; } if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} - chmod 0755, "$dir1/DONE/$GSMfile"; + chmod 0755, "$dir2/$GSMfile"; $ftp = Net::FTP->new("$VARFTP_host", Port => $VARFTP_port, Debug => 0, Passive => 1); $ftp->login("$VARFTP_user","$VARFTP_pass"); $ftp->cwd("$VARFTP_dir"); $ftp->binary(); - $ftp->put("$dir1/DONE/$GSMfile", "$GSMfile"); + $ftp->put("$dir2/$GSMfile", "$GSMfile"); $ftp->quit; } ### END Remote file transfer diff --git a/bin/AST_CRON_mix_recordings_MP3.pl b/bin/AST_CRON_mix_recordings_MP3.pl index 8ce3116c..c548a14a 100644 --- a/bin/AST_CRON_mix_recordings_MP3.pl +++ b/bin/AST_CRON_mix_recordings_MP3.pl @@ -68,6 +68,8 @@ foreach(@conf) {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) @@ -100,6 +102,7 @@ $server_ip = $VARserver_ip; # Asterisk server IP ### directory where in/out recordings are saved to by Asterisk $dir1 = "$PATHmonitor"; +$dir2 = "$PATHDONEmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} @@ -165,34 +168,29 @@ foreach(@FILES) if ($ping_good) { - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir2/$ALLfile"`; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - `$lamebin -b 16 -m m --silent "$dir1/$ALLfile" "$dir1/$MP3file"`; + `$lamebin -b 16 -m m --silent "$dir2/$ALLfile" "$dir2/$MP3file"`; if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} - chmod 0755, "$dir1/DONE/$MP3file"; + chmod 0755, "$dir2/$MP3file"; $ftp = Net::FTP->new("$VARFTP_host", Port => $VARFTP_port, Debug => 0, Passive => 1); $ftp->login("$VARFTP_user","$VARFTP_pass"); $ftp->cwd("$VARFTP_dir"); $ftp->binary(); - $ftp->put("$dir1/DONE/$MP3file", "$MP3file"); + $ftp->put("$dir2/$MP3file", "$MP3file"); $ftp->quit; if (!$T) { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + `mv -f "$dir1/$INfile" "$dir2/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir2/ORIG/$OUTfile"`; } if (!$T) { - `rm -f "$dir1/DONE/$ALLfile"`; + `rm -f "$dir2/$ALLfile"`; } } diff --git a/bin/AST_CRON_mix_recordings_MP3_DATE.pl b/bin/AST_CRON_mix_recordings_MP3_DATE.pl index ba18d42e..e3a9cf01 100644 --- a/bin/AST_CRON_mix_recordings_MP3_DATE.pl +++ b/bin/AST_CRON_mix_recordings_MP3_DATE.pl @@ -84,6 +84,8 @@ foreach(@conf) {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) @@ -116,6 +118,7 @@ $server_ip = $VARserver_ip; # Asterisk server IP ### directory where in/out recordings are saved to by Asterisk $dir1 = "$PATHmonitor"; +$dir2 = "$PATHDONEmonitor"; # get current date in the format YYYYMMDD for use in directory name on the storage server ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @@ -185,24 +188,19 @@ foreach(@FILES) { if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir2/$ALLfile"`; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} if (!$T) { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + `mv -f "$dir1/$INfile" "$dir2/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir2/ORIG/$OUTfile"`; } - `$lamebin -b 16 -m m --silent "$dir1/DONE/$ALLfile" "$dir1/DONE/$MP3file"`; + `$lamebin -b 16 -m m --silent "$dir2/$ALLfile" "$dir2/$MP3file"`; - if($DB){print STDERR "\n|$lamebin -b 16 -m m --silent \"$dir1/DONE/$ALLfile\" \"$dir1/DONE/$MP3file\"\n";} - chmod 0755, "$dir1/DONE/$MP3file"; + if($DB){print STDERR "\n|$lamebin -b 16 -m m --silent \"$dir2/$ALLfile\" \"$dir2/$MP3file\"\n";} + chmod 0755, "$dir2/$MP3file"; $ftp = Net::FTP->new("$VARFTP_host", Port => $VARFTP_port, Debug => ($v? 1 : 0), Passive => 1); $ftp->login("$VARFTP_user","$VARFTP_pass"); @@ -210,16 +208,16 @@ foreach(@FILES) $ftp->mkdir("$VARFTP_dir/$today", 1); $ftp->cwd("$VARFTP_dir/$today"); $ftp->binary(); - $ftp->put("$dir1/DONE/$MP3file", "$MP3file"); + $ftp->put("$dir2/$MP3file", "$MP3file"); $ftp->quit; # clean up if (!$T) { - `rm -f "$dir1/ORIG/$INfile"`; - `rm -f "$dir1/ORIG/$OUTfile"`; - `rm -f "$dir1/DONE/$ALLfile"`; - `rm -f "$dir1/DONE/$MP3file"`; + `rm -f "$dir2/ORIG/$INfile"`; + `rm -f "$dir2/ORIG/$OUTfile"`; + `rm -f "$dir2/$ALLfile"`; + `rm -f "$dir2/$MP3file"`; } } ### END Remote file transfer diff --git a/bin/AST_CRON_mix_recordings_VDonly_DATE.pl b/bin/AST_CRON_mix_recordings_VDonly_DATE.pl index 33ec4f4e..bbd8363d 100644 --- a/bin/AST_CRON_mix_recordings_VDonly_DATE.pl +++ b/bin/AST_CRON_mix_recordings_VDonly_DATE.pl @@ -66,6 +66,8 @@ foreach(@conf) {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) @@ -105,6 +107,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA ### directory where in/out recordings are saved to by Asterisk $dir1 = "$PATHmonitor"; +$dir2 = "$PATHDONEmonitor"; use Net::Ping; use Net::FTP; @@ -177,8 +180,8 @@ foreach(@FILES) if (!$T) { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + `mv -f "$dir1/$INfile" "$dir2/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir2/ORIG/$OUTfile"`; } } ### END Remote file transfer