Very weird problem for abandoned calls and CDR on *

Hello friends…

I would like to share a weird problem that i’m confronting with Asterisk on debian. Because of this problem, today i’m going back to Asterisk 1.6.1 installation. I dont know if its a bug or a misconfiguration…

Heres my problem:

Normally, asterisk records an entry in cdr table for every call ended. But, SOMETIMES, my asterisk dont record an entry for an abandoned call. So, i dont have a precise information in my database. Sometimes it records, sometimes not; and this happens ONLY for abandoned calls.

But how do I know how many cdr entries I lost?
Answer: I can get the number for abandoned calls in 5 different places:

  1. Original asterisk cdr table using postgresql
  2. Another cdr table with custom fields using odbc and postgres
  3. In the master.csv log file
  4. In the queue log, that it is being recorded in a table.
  5. I’m recording the event QueueCallerAbandon in a table.

An today example with numbers:

Number of abandoned calls in cdr table: 3
Number of abandoned calls in custom cdr table: 3
Number of abandoned calls in queue log table: 6
Number of abandoned calls in QueueCallerAbandon table: 6

There were 3 abandoned calls that wasn’t recorded in cdr tables and being show in queue log and QueueCallerAbandon event table. Also, i took the uniqueid of the 3 missed calls and look into master.csv and they wasn’t there.
This example is only for today and for one queue. I have 4 queues in my server that randomly dont record an abandoned call in cdr table. Last month I was using asterisk 1.6.1 and all the values in the 5 places matched.

What happens in CLI (v=20 d=10)?
I had the oportunity to see in CLI exacly the moment when this problem happen. And everything goes fine except the fact that I dont see the cdr insert command. For other calls it show me “INSERT INTO cdr …” normally for both cdr tables.

What happens in the full log?
Same as CLI.

Could be the database?
My database is local, but i also tried with a database in a remote host. Same problem.

Does anybody have a clue of whats happening?
Anywhere else that I could take a look?