Asterisk ends when reloading res_odbc.so

Hello

using Asterisk 13.38.3.

Using realtime architecture for dialplan extensions.
When just using MySQL configuration, all works fine.

But I would like to use ODBC, as it is more supported now and in future releases.

When issuing ‘module reload’ or ‘module reload res_odbc.so’, Asterisk quits and I get a “core dump”.
If I leave out al the ODBC config, Asterisk works stable.

I followed several guides online to get to the ODBC - MySQL configuration.
Here is my setup :

ODBC install :

[root@ig0 asterisk]# odbcinst -j
unixODBC 2.3.1
DRIVERS…: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES…: /etc/ODBCDataSources
USER DATA SOURCES…: /root/.odbc.ini
SQLULEN Size…: 8
SQLLEN Size…: 8
SQLSETPOSIROW Size.: 8

ODBC config works :

[root@ig0 asterisk]# echo "select 1" | isql -vvv asterisk-connector
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select 1
+---------------------+
| 1                   |
+---------------------+
| 1                   |
+---------------------+
SQLRowCount returns 1
1 rows fetched

/etc/odbc.ini :

[asterisk-connector]
Driver       = /usr/lib64/libmyodbc8w.so
Description  = MySQL connection to 'asterisk' database
Database     = asteriskdb
SERVER       = 10.11.12.13
USER         = 123
Password     = 123
PORT         = 3306
OPTION       = 3
SOCKET       =

res_odbc.conf file :

[mysqlgcp]
enabled => yes
dsn => asterisk-connector
username => 123
password => 123
;max_connections => 20
connect_timeout => 5
pre-connect => yes

extconfig.conf file :
realtime_incoming => odbc,mysqlgcp,extensions_incoming

The var/log/asterisk/debug file gives only this output (debug level 99) :

[Dec  1 14:55:10] DEBUG[2698] config.c: Parsing /etc/asterisk/res_odbc.conf
[Dec  1 14:55:10] DEBUG[2698] res_odbc.c: Connecting mysqlgcp(0x7fcd000029b8)
[Dec  1 14:55:14] Asterisk 13.38.3 built by root @ ig0 on a x86_64 running Linux on 2023-12-01 13:00:24 UTC

The current version is up to 21 - you might find that upgrading improves the situation.

Indeed. Tried Asterisk version 18. No Asterisk failure (and core dump) when loading res_odbc.

But this means that ODBC was never usable up to Asterisk version 13, so it seems…

odbc works fine in 1.8 and later, have been using it for years,
it is just helping with tracing down the problem, we want to do that on a current version
as it is no fun using days tracing down a known + fixed bug

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