Where can I change dsn parameter in /etc/asterisk/res_odbc_additional.conf?

Hi,
I am in the process of testing FreePBX 16 on Rocky Linux 9, I noticed the CDR feature was not working. After the digging, mariadb-connector-odbc setup was not done right, CDR feature worked again by modifying /etc/odbcinst.conf and /etc/odbc.ini.

  • /etc/odbcinst.conf

    [MariaDB]
    Description=ODBC for MariaDB
    Driver=/usr/lib64/libmaodbc.so
    FileUsage=1
    UsageCount=3

  • /etc/odbc.ini

    [MySQL-asteriskcdrdb]
    Description=MariaDB connection to ‘asteriskcdrdb’ database
    Driver=MariaDB
    server=localhost
    database=asteriskcdrdb
    Port=3306
    Socket=/var/lib/mysql/mysql.sock
    Option=3
    Charset=utf8
    UsageCount=1

The original /etc/odbcinst.ini was like below, and no connection was established since [MySQL] driver was used, not MariaDB which I installed before installing FreePBX 16.

#Example driver definitions

#Driver from the postgresql-odbc package
#Setup from the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbcw.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbcw.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1

#Driver from the mysql-connector-odbc package in Fedora >=29
#Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL 8
#mysql-connector-odbc package provides shared libraries with “w” or “a” suffix.
#‘w’ stands for ‘wide’ or ‘unicode’ character set, ‘a’ stands for ‘ANSI’
#Symlinks used in the configuration below lead to the ‘w’ variant by default
Driver = /usr/lib/libmyodbc8.so
Driver64 = /usr/lib64/libmyodbc8.so
FileUsage = 1

#Driver from the mysql-connector-odbc package in Fedora <=28
#Setup from the unixODBC package
[MySQL-5]
Description = ODBC for MySQL 5
#mysql-connector-odbc package provides shared libraries with “w” or “a” suffix.
#‘w’ stands for ‘wide’ or ‘unicode’ character set, ‘a’ stands for ‘ANSI’
#Symlinks used in the configuration below lead to the ‘w’ variant by default
Driver = /usr/lib/libmyodbc5.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1

#Driver from the freetds-libs package
#Setup from the unixODBC package
[FreeTDS]
Description = Free Sybase & MS SQL Driver
Driver = /usr/lib/libtdsodbc.so
Setup = /usr/lib/libtdsS.so
Driver64 = /usr/lib64/libtdsodbc.so
Setup64 = /usr/lib64/libtdsS.so
Port = 1433

#Driver from the mariadb-connector-odbc package
#Setup from the unixODBC package
[MariaDB]
Description = ODBC for MariaDB
Driver = /usr/lib/libmaodbc.so
Driver64 = /usr/lib64/libmaodbc.so
FileUsage = 1

At this moment, I modified the those two files, but it will be nice if I can tweak /res_odbc_additional.conf side setting, and wondering whether I can change the value from FreePBX side. (Instead of MySQL-asteriskcdrdb, perhaps MariaDB-asteriskcdrdb, etc…)

I appreciate any suggestions! Thank you!

  • Platform: Rocky Linux 9.1

    $ cat /etc/os-release
    NAME=“Rocky Linux”
    VERSION=“9.1 (Blue Onyx)”
    ID=“rocky”
    ID_LIKE=“rhel centos fedora”
    VERSION_ID=“9.1”
    PLATFORM_ID=“platform:el9”
    PRETTY_NAME=“Rocky Linux 9.1 (Blue Onyx)”
    ANSI_COLOR=“0;32”
    LOGO=“fedora-logo-icon”
    CPE_NAME=“cpe:/o:rocky:rocky:9::baseos”
    HOME_URL=“https://rockylinux.org/
    BUG_REPORT_URL=“https://bugs.rockylinux.org/
    ROCKY_SUPPORT_PRODUCT=“Rocky-Linux-9”
    ROCKY_SUPPORT_PRODUCT_VERSION=“9.1”
    REDHAT_SUPPORT_PRODUCT=“Rocky Linux”
    REDHAT_SUPPORT_PRODUCT_VERSION=“9.1”

  • Asterisk version: 18.17.1
  • FreePBX version: 16.0.40

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