Enable CDR Logging?

Home » Asterisk Users » Enable CDR Logging?
Asterisk Users 3 Comments


I am currently trying to set up CDR logging. I got all the ODBC stuff for my mysql server set up, also checked there’s a connection using “odbc show”
in the Asterisk console:

Name: asterisk

I also created a table for the CDR logs:

This table is also referenced in /etc/asterisk/cdr_adaptive_odbc.conf.

Now, what is the next step?
1) Do I have to call any CDR function in my dialplan for the CDR logging to become really active?
2) Do I have to create more fields in my asterisk_cdr table manually? Guess it should all be done automatically? Would I have needed the ID field at all?

Thanks for any hint 🙂

Best regards Stefan

3 thoughts on - Enable CDR Logging?

  • Stefan at WPF wrote:


    Description = CDR Database Driver = MySQL
    Socket = /var/lib/mysql/mysql.sock Server =
    User = username Password = password Database = asteriskcdr Option = 3


    enable => yes dsn => MySQL-cdr username => username password => password preconnect => yes


    ;loguniqueid=yes dispositionstring=yes table

  • Thank you Doug, but if I don’t understand things wrong, you are not using adaptive ODBC?

    I meanwhile found out that things work when I manually create the columns. Just wondering, is there any official specifications for the default columns, e.g. which datatype they shall have and so on?

    Also, I am getting this errors:

    As a reference, here is my complete configuration for adaptive odbc:

    2012/8/19 Doug Lytle

  • Stefan at WPF wrote:

    No, I’m not.

    It looks like it’s failing to connect. I have had issue in the past, where connecting to a mysql database via would work, where as using localhost would fail. And some times, where neither would work and I had to use the real IP address of the machine.

    Maybe this is one of those cases?

    Have you verified that your odbc setup is working properly for other queries?

    This may be helpful: