0

I had ODBC working with asterisk to write to my CDR then recently needed to check my CDR to realise nothing had been written for about 6 months. I had a look at my config, nothing seamed to have changed. but then tried to re-install everything except FREEPBX trying to get it to work. I have attempted several variations of config, and nothing is working... HOWEVER, I have now managed to avoid all other errors with the exceptoion of :

ERROR[2917] cdr_odbc.c: Unable to retrieve database handle.  CDR failed.

NO errors before, of after.

Debian 10 w/ MariaDB 10 Asterisk 16 FreeBPX 16

Here is my config:

/etc/odbc.ini
[MySQL-asteriskcdrdb]
Description = MySQL connection to 'asteriskcdrdb' database
Driver = MySQL
Server = localhost
Database = asteriskcdrdb
Username = freepbxuser
Password = **PASSWORD**
Port = 3306
Socket = /var/run/mysqld/mysqld.sock
Option = 3

/etc/odbcinst.ini

[MySQL]
Description = ODBC for MySQL (MariaDB)
Driver = /usr/local/lib/libmaodbc.so
FileUsage = 1

/etc/asterisk/cdr_adaptive_odbc.conf

[adaptive_connection]
connection=MySQL-asteriskcdrdb
table=cdr
usegmtime=yes
alias start => calldate

/etc/asterisk/cdr_odbc.conf

[global]
dsn=MySQL-asteriskcdrdb
username=freepbxuser
password=**PASSWORD**
loguniqueid=yes
dispositionstring=yes
table=cdr
usegmtime=no
hrtime=yes
newcdrcolumns=yes

/etc/asterisk/res_odbc_additional.conf

[asteriskcdrdb]
enabled => yes
dsn => MySQL-asteriskcdrdb
pre-connect => yes
max_connections => 5
username => freepbxuser
password => **PASSWORD**
database => asteriskcdrdb

.

  cdr show status
    Call Detail Record (CDR) settings
    ----------------------------------
      Logging:                    Enabled
      Mode:                       Simple
      Log unanswered calls:       Yes
      Log congestion:             No
    
    * Registered Backends
      -------------------
        cdr-custom
        cdr_manager
        ODBC
        Adaptive ODBC

.

odbc show asteriskcdrdb
ODBC DSN Settings
-----------------

  Name:   asteriskcdrdb
  DSN:    MySQL-asteriskcdrdb
    Last fail connection attempt: 2023-06-27 14:29:46
    Number of active connections: 0 (out of 5)
    Logging: Disabled
Ben
  • 23
  • 4

0 Answers0