Hi,
When I am trying to establish the connection with MySQL through UNIX ODBC, I am getting the below error:
ERROR[1413]: res_config_odbc.c:202 realtime_odbc: No database handle available with the name of ‘mydatabase’ (check res_odbc.conf)
I tried to find out the solution and searched many threads in internet. But, could not able to find the solution. Please find my below configuration:
Asterisk Version - 11.10
OS - Ubuntu Server 14.04 (64-Bit)
-
Installed MySQL client, server, development, unixodbc-dev, and libmyodbc libraries
-
Content in /etc/odbcinst.ini:
[MySQL]
Description = MySQL driver
Driver = libmyodbc.so
Setup = libodbcmyS.so
CPTimeout =
CPReuse =
UsageCount = 1 -
Content in /etc/odbc.ini:
[MySQL-asterisk]
Description = MySQL Asterisk database
Trace = Off
TraceFile = stderr
Driver = MySQL
SERVER = 10.0.0.253
USER = dbuser
PASSWORD = dbpassword
PORT = 3336
DATABASE = mydatabase -
Content in /etc/asterisk/res_odbc.conf:
[asterisk]
enabled => yes
dsn => MySQL-asterisk
username => dbuser
password => dbpassword
pre-connect => yes -
Content in /etc/asterisk/extconfig.conf:
[settings]
sipusers => odbc,mydatabase,sipuserstable
sippeers => odbc,mydatabase,sipuserstable
sipregs => odbc,mydatabase,sipregistrationstable
voicemail => odbc,mydatabase,sipvoicemailtable -
Enable below things in modules.conf:
autoload=yes
preload => res_odbc.so
preload => res_config_odbc.so
I am able to connect to the database manually. But, when I am trying to register from soft phone, it is showing the above error in Asterisk console.
Any help would be appreciated. Thanks in advance.