delete monitor in bulk

Status
Not open for further replies.

dwhoff

Joined
Aug 13, 2011
Messages
12
Reaction score
0
Here is my problem.

I have an installation at a busines that records all public facing DID's. We access the recordings through the monitor tab of the Elastix gui. If I manually delete the recordings (through the command line) they are still listed on the web interface. It is tedious to delete them indivually (high call volume). How do I best approach the problem of aging out and deleting these recordings?

Thanks in advance for your time

Denny
 
For anyone interested, I am making some headway here. The information is stored under Mysql in the asteriskcdrdb database. The cdr table has a field call userfield. The field contains the name of the wav file created by monitor. I am working on a script to erase the recording and the row (this is how the web interface does it) in the database. Hope this helps others.
 
Quick update: Sorry for the misinformation above. The web interface removes the data in the userfield column. It doesn't erase the row like I stated above. I have found mysql update commands to be problematic due to character escaping issues. I am moving on to php or perl. As I am not an expert with either it might be a few days before I get something working. I will post it here then.
 
Here is what I have come up with:

I decided to deal with escaping issues by creating a stored procedure
/////////////////////////////////////////////////////////////////////////
CREATE DEFINER=`root`@`localhost` PROCEDURE `monitor_cleanup`()
BEGIN
UPDATE cdr SET userfield = '' where calldate <= date(date_sub(NOW(),Interval 91 DAY))
AND userfield like "audio:%";
END
////////////////////////////////////////////////////////////////////////
This will get rid of the records older than 90 days. The user is free to create a script in their favorite language to call this routine. To do so, use the following query to mysql:
"call asteriskcdrdb.monitor_cleanup"
Voila the recordings no longer show up in the monitor tab. A quick command such as
"find /var/spool/asterisk/monitor/*.wav -mtime +90 -exec rm -f '{}' /;"
erases the actual recordings. PHP is a good choice for this task.

I hope this is usefull to someone. I have avoided presenting this as a recipe to avoid having someone blindly follow and lose something that they wanted/neede.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,862
Messages
589,443
Members
164,702
Latest member
iamatlas