Page 1 of 1

AST_CRON_audio_compress_2.pl delete originals

PostPosted: Sat Mar 10, 2012 1:06 pm
by Acidshock
Out of curiousity why do we not delete the originals during this script action? Is it for maybe wanting to record in different formats besides the original? Maybe we should add a delete option to delete the original. If what I am doing is considered alright I will write that option.

I have a system that fills the recordings up almost daily... I added a `rm "$dir2/$ALLfile"`; so that it will delete live and it seems to work just fine. Just making sure I am not doing anything that may cause problems.

VERSION: 2.4-349a
BUILD: 111122-1333
Asterisk 1.4
Suse 10.3
Redux 3.1.13


Code: Select all
                        if ($MP3 > 0)
                                {
                                $MP3file = $FILES[$i];
                                $MP3file =~ s/-all\.wav/-all.mp3/gi;

                                if ($DB) {print "|$recording_id|$ALLfile|$MP3file|     |$SQLfile|\n";}

                                `$lamebin -b 16 -m m --silent "$dir2/$ALLfile" "$dir2/MP3/$MP3file"`;
                                `rm "$dir2/$ALLfile"`;
                                $stmtA = "UPDATE recording_log set location='http://$server_ip/RECORDINGS/MP3/$MP3file' where recording_id='$recording_id';";
                                        if($DBX){print STDERR "\n|$stmtA|\n";}
                                $affected_rows = $dbhA->do($stmtA); #  or die  "Couldn't execute query:|$stmtA|\n";
                                }

PostPosted: Sat Mar 10, 2012 6:25 pm
by mflorell
We had too many cases where "something went wrong" and having the original recordings meant they could be run through the compress process again after the issue had been fixed.

PostPosted: Mon Mar 12, 2012 1:32 pm
by Acidshock
Makes perfect sense. Think people would want the option to turn that feature off? Is it worth me taking the time to add an optional switch?

PostPosted: Mon Mar 12, 2012 2:03 pm
by mflorell
I think if there was an optional switch that there are people that would use it. If you have the time to do that please go ahead and post it to the Issue Tracker.