CDR report is blank

Hey
we have installed asterisk 13.16 with freepbx 12.0-
and i cant see the cdr it doenst find anything

here is the log :

[2017-08-24 09:35:09] NOTICE[7790] res_odbc.c: Registered ODBC class ‘asteriskcdrdb’ dsn->[MySQL-asteriskcdrdb]
[2017-08-24 09:35:09] NOTICE[7790] res_odbc.c: Registered ODBC class ‘asteriskcdrdb’ dsn->[MySQL-asteriskcdrdb]
[2017-08-24 09:35:19] WARNING[7790] cdr_adaptive_odbc.c: Unable to load cdr_adaptive_odbc.conf. No adaptive ODBC CDRs.
[2017-08-24 09:35:19] WARNING[7790] cdr_adaptive_odbc.c: Unable to load cdr_adaptive_odbc.conf. No adaptive ODBC CDRs.
[2017-08-24 09:35:50] ERROR[7799] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-24 09:35:50] ERROR[7799] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-24 09:35:50] WARNING[7799] cdr_adaptive_odbc.c: Unable to load cdr_adaptive_odbc.conf. No adaptive ODBC CDRs.
[2017-08-24 09:35:50] WARNING[7799] cdr_adaptive_odbc.c: Unable to load cdr_adaptive_odbc.conf. No adaptive ODBC CDRs.
[2017-08-24 09:35:50] WARNING[7799] cel_odbc.c: No such connection ‘asteriskcdrdb’ in the ‘cel’ section of cel_odbc.conf. Check res_odbc.conf.
[2017-08-24 09:35:50] WARNING[7799] cel_odbc.c: No such connection ‘asteriskcdrdb’ in the ‘cel’ section of cel_odbc.conf. Check res_odbc.conf.

when i added the file
/etc/asterisk/cdr_custom.conf
as suggested like this :

;
;
; Mappings for custom config file
;
; To get your CSV output in a format tailored to your liking, uncomment the
; following lines and look for the output in the cdr-custom directory (usually
; in /var/log/asterisk). Depending on which mapping you uncomment, you may see
; Master.csv, Simple.csv, or both.
;
[mappings]
Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)

; High Resolution Time for billsec and duration fields
Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)
Simple.csv => ${CSV_QUOTE(${EPOCH})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})}

then i get this error and still CDR is blank :
pbx_functions.c: Can't find trailing parenthesis for function 'CDR(dst'?

Your problem and your solution are unrelated. The first (as the error message says) is that you haven’t set up your ODBC database interface for the CDR database.

The second is for setting up and CDR file in /var/spool/asterisk/cdr/, and you’ve defined the Master.csv file twice (comment the first one out).

The ODBC CDR table is the one used for the FreePBX GUI.

An interesting outcome of your solution is that you can use a "mysqlimport’ to import your CSV file into the database. You will won’t be able to access it through FreePBX (your ODBC interface is still broken) but you will have your data.

We just had a CDR issue happen Monday and now its not saving anything. I found this upon grep’ing the reload:

[2017-08-25 08:05:39] ERROR[25615] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-25 08:05:53] WARNING[25615] cdr_mysql.c: Unable to load config for mysql CDR’s: cdr_mysql.conf
[2017-08-25 08:08:41] ERROR[27825] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-25 08:08:56] WARNING[27825] cdr_mysql.c: Unable to load config for mysql CDR’s: cdr_mysql.conf
[2017-08-25 11:21:18] ERROR[8302] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-25 11:21:35] WARNING[8302] cdr_mysql.c: Unable to load config for mysql CDR’s: cdr_mysql.conf
[2017-08-25 13:56:38] ERROR[16991] cdr_custom.c: Unable to load cdr_custom.conf. Not logging custom CSV CDRs.
[2017-08-25 13:56:54] WARNING[16991] cdr_mysql.c: Unable to load config for mysql CDR’s: cdr_mysql.conf

are you having this?

None of those conf files are used so that’s not an error.

1 Like

Thanks for the heads up.

Check your MySQL asteriskcdrdb database health. If the CDR table is crashed, you’d see this.

i dont understand then what i should do,
my asterisk cdrdb is empty do you have any suggestion on reparing my issue ?

thanks

<Pedantic mode>

Your CDR database is called ‘asteriskcdrdb’. The table is called “cdr”. Which one of those is empty? Have you done a “repair table cdr” in the ‘asteriskcdrdb’ database?

<\Pedantic mode>

If your table is OK, your ODBC configuration is not correct and/or you haven’t set up the CDR backend correctly.