Module res_odbc.so disconnect Asterisk server on Module reload

Hi everyone,

I am trying to setup ODBC for Asterisk 13.10.0. On “odbc show” command on the CLI. It shows these 7 modules already installed.

Module Description Use Count Status Support Level
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0 Running core
cdr_odbc.so ODBC CDR Backend 0 Running extended
cel_odbc.so ODBC CEL backend 0 Running core
func_odbc.so ODBC lookups 0 Running core
res_config_odbc.so Realtime ODBC configuration 0 Running core
res_odbc.so ODBC resource 0 Running core
res_odbc_transaction.so ODBC transaction resource 0 Running core
7 modules loaded

Doing odbc show gives

ODBC DSN Settings

Name: asterisk
DSN: asterisk-connector
Last connection attempt: 1969-12-31 19:00:00
Number of active connections: 1 (out of 10)

But when I try to reload res_odbc.so using “module reload res_odbc.so”. The command just disconnect the Asterisk server and it exit the CLI window. Also trying to run this command

odbc read ACTIVE_INFO 20 exec

where ACTIVE_INFO is a function in the func_odbc.conf just exit the CLI and disconnect the Asterisk server.

My /etc/odbc.ini file

[asterisk-connector]
Description= MySQL connection to ‘mytestdatabase’ database
Driver= MySQL
Database=test
Server=152.17.X.X
User=tester
Password=tester
Port=3306
Socket= /var/lib/mysql/mysql.sock

Also, the mysql.sock file is present in the /var/lib/mysql/ directory

My/etc/asterisk/res_odbc.conf file

[asterisk]
enabled => yes
dsn => asterisk-connector
max_connections => 10
username => developer
password => developer
;pooling => no
;limit => 1
pre-connect => yes

In the /etc/asterisk/modules.conf file

I have uncomment res_odbc.so and res_config_odbc.so

Also when I checked /var/log/asterisk/messages

[Feb 10 04:45:16] Asterisk 13.10.0 built by root @ scw-eeb8cd on a x86_64 running Linux on 2017-02-10 08:24:33 UTC
[Feb 10 04:45:16] NOTICE[20191] loader.c: 2 modules will be loaded.
[Feb 10 04:45:16] NOTICE[20191] res_odbc.c: Registered ODBC class ‘asterisk’ dsn->[asterisk-connector]
[Feb 10 04:45:16] NOTICE[20191] res_odbc.c: res_odbc loaded.
[Feb 10 04:45:16] NOTICE[20191] cdr.c: CDR simple logging enabled.
[Feb 10 04:45:16] NOTICE[20191] loader.c: 237 modules will be loaded.
[Feb 10 04:45:16] WARNING[20191] res_phoneprov.c: Unable to find a valid server address or name.
[Feb 10 04:45:16] ERROR[20191] ari/config.c: No configured users for ARI
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database user found, using ‘asterisk’ as default.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database password found, using ‘asterisk’ as default.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database host found, using localhost via socket.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database name found, using ‘asterisk’ as default.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database port found, using 3306 as default.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database socket found, using ‘/var/lib/mysql/mysql.sock’ as default.
[Feb 10 04:45:16] WARNING[20191] res_config_mysql.c: MySQL RealTime: No database socket found (and unable to detect a suitable path).
[Feb 10 04:45:16] NOTICE[20191] chan_skinny.c: Configuring skinny from skinny.conf
[Feb 10 04:45:17] NOTICE[20191] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[2017-02-11 06:10:56] ERROR[4644] pbx_dundi.c: Unable to bind to 0.0.0.0 port 4520: Address already in use

// Since I am using ODBC I dont think the issue is from res_config_mysql config

I don’t know what Im doing wrong, I have remove and installed again but still getting similar problem.