-2

I am facing an issue while generating CDR report from freepbx / asterisk , we are getting blank report.

After troubleshooting , we fund error below error in CDR logs :

ERROR[6576][C-000018df] cdr_mysql.c: Failed to insert into database: (1062) Duplicate entry '' for key 'accountcode'

2 Answers2

0

You have created unique key for cdr.account code.

Since accountcode is same for all records of same users, you get that error.

Solution is remove key and create non-unique one

arheops
  • 15,544
  • 1
  • 21
  • 27
0

Encountered the same error in my logs. It appears that the mysql index was corrupted for the CDR table.

The fix was to run

mysql
use asteriskcdrdb
repair table cdr;

After that record insertion started running fine again.

Tyler W. Cox
  • 323
  • 2
  • 6