This is the script you are looking for (usually in directory "/usr/share/astguiclient"):
AST_CRON_purge_recordings.pl
Then you should make a few adjustments in this script, because it looks only for recordings with certain save statuses which are predefined:
# runs every day, goes through recordings older than a certain number of days
# and deletes those recordings that are not of a certain status
# default is 30 days old to remove non-sales
#
# put an entry into the cron of of your asterisk machine to run this script
# every day or however often you desire
Here is the place for save states:
Line23: $save_statuses = '|SALE|UPSALE|UPSELL|XFER|DNC|DROP|A1|A2|A3|A4|A5|A6|A7|A8|A9|';
Next the trick for your purpose at line 113 with an adjustment to only delete recordings that are less than 100 seconds:
- Code: Select all
##### Get the lead_ids of all recordings that are not DELETED or NULL #####
$stmtA = "SELECT lead_id,recording_id,start_time,filename,location FROM recording_log where start_time < '$TDSQLdate' and start_time > '$FDSQLdate' and location IS NOT NULL and location NOT IN('','NOT_FOUND','NOT_FOUND_2','DELETED') and length_in_sec <= 100 LIMIT 5000;";
Very important: This will delete all recordings (30 days / LIMIT 5000 recordings) where the statuses are not defined in "$save_statuses" and where recording length is under 100 seconds. But if it's defined (e.g. SALE) then it will not be deleted even when it's under 100 seconds!
But you can also change $save_statuses to delete all of them:
$save_statuses = '||';