Score:0

CDR not working with asterisk & odbc

ru flag
Ben

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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.