No Cdr records

Hello,

centos 8 on raspberry pi4. Installed asterisk 17 and freepbx 15. Everythink is ok except that no cdr records are written.

  1. nano /etc/asterisk/cdr_adaptive_odbc.conf
[asteriskcdrdb]
connection=asteriskcdrdb
loguniqueid=1
table=cdr
alias start => calldate
  1. nano /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
option=3
Charset=utf8

Commands below gives:

localhost*CLI> module reload res_odbc.so
Module 'res_odbc.so' reloaded successfully.
[2021-04-05 13:21:55] WARNING[37570]: res_odbc.c:1067 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
[2021-04-05 13:21:55] NOTICE[37570]: res_odbc.c:706 load_odbc_config: Registered ODBC class 'asteriskcdrdb' dsn->[MySQL-asteriskcdrdb]
localhost*CLI> module reload cdr_adaptive_odbc.so
Module 'cdr_adaptive_odbc.so' reloaded successfully.
[2021-04-05 13:22:51] WARNING[37570]: res_odbc.c:1067 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
[2021-04-05 13:22:51] WARNING[37570]: cdr_adaptive_odbc.c:136 load_config: No such connection 'asteriskcdrdb' in the 'asteriskcdrdb' section of cdr_adaptive_odbc.conf.  Check res_odbc.conf.
[2021-04-05 13:22:51] WARNING[37570]: cdr_adaptive_odbc.c:136 load_config: No such connection 'asteriskcdrdb' in the 'asteriskcdrdb' section of cdr_adaptive_odbc.conf.  Check res_odbc.conf.
localhost*CLI> cdr show status

Call Detail Record (CDR) settings
----------------------------------
  Logging:                    Enabled
  Mode:                       Simple
  Log unanswered calls:       No
  Log congestion:             No

* Registered Backends
  -------------------
    csv
    cdr_manager (suspended)
    Adaptive ODBC

localhost*CLI> odbc show
localhost*CLI>

ODBC DSN Settings
-----------------

  Name:   asteriskcdrdb
  DSN:    MySQL-asteriskcdrdb
    Last fail connection attempt: 2021-04-05 13:22:51
    Number of active connections: 0 (out of 5)
    Logging: Disabled

Any thoughts?

Right there

Can't open lib '/usr/lib64/libmyodbc5.so

are you using mysql or mariadb ?

MariaDB, something is mixed up with the libraries?

Not mixed up, just in abstentia as yet

Ok, I found the solution…

[root@localhost lib64]# cat /etc/odbcinst.ini
> [MySQL]
> Description=ODBC for MySQL
> Driver=/usr/lib/libmyodbc5.so  
> Setup=/usr/lib/libodbcmyS.so  
> Driver64=/usr/lib64/libmyodbc8w.so    <--change this!!!!!
> Setup64=/usr/lib64/libodbcmyS.so     
> FileUsage=1

Besides the fact that CDR works fine now, ! am not sure if this is the right solution…

Anmy ‘right solution’ is one that works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.