Clear CDR

How do you clear the CDR database?

I have been testing for quite some time and wish to clear all the test calls from CDR prior to deploying the system.

Cheers
GB

anyone?

Do a backup of your system in FreePBX. Include System Configuration.
When backup is done, go to /var/lib/asterisk/backups, go down to the directory named after you backup, open the .tar.gz file, find the asteriskcdr.sql file, open that and in the beginning of the file you will find something like this:

USE asteriskcdrdb;

DROP TABLE IF EXISTS ‘cdr’;
CREATE TABLE ‘cdr’ (
.
.
.
) ENGINE=MyISAM DEFAULT …

Copy that to a separate file, like empty.sql, then write at the console:
mysql -u asteriskuser -pamp109 < empty.sql

It will drop the table, then create it again.
If you mess up, well, that is why you began with a backup:-)
YMMV

/Mikael