Hi,
I am having some issues with the ODBC connection to a mysql database from within asterisk. The trouble is, in all the tutorials people say if isql is working, asterisk should work.
This is not the case on my setup.
I have unixodbc - iodbc and mysql5 with the mysql-connector installed.
This is the odbc.ini file:
[MySQL-asterisk]
Driver=MySQL
SERVER=localhost
User=asterisk
Password=XXXXXXXXXXX
DATABASE=asterisk
SOCKET=/tmp/mysql.sock
The odbcinst.ini file is:
[MySQL]
Driver=/usr/local/lib/libmyodbc5.so
SETUP=/usr/local/lib/libodbcmyS.so
UsageCount=1
My res_odbc.conf is:
[asterisk]
enabled => yes
dsn => MySQL-asterisk
username => asterisk
password => XXXXXXXXX
preconnect => yes
IF i run the command : isql -v MySQL-asterisk … It connects just fine. I can run queries on the database.
When i start asterisk it shows the following in the log:
NOTICE[2829] res_odbc.c: Registered ODBC class ‘asterisk’ dsn->[MySQL-asterisk]
NOTICE[2829] res_odbc.c: res_odbc loaded.
NOTICE[2829] config.c: Registered Config Engine odbc
But it wont connect , the response from odbc show is:
ODBC DSN Settings
Name: asterisk
DSN: MySQL-asterisk
Last connection attempt: 1970-01-01 01:00:00
If asterisk tries to read from the database i get this error :
[Apr 26 14:47:53] WARNING[2898] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=-1248415568 [iODBC][Driver Manager]/usr/local/lib/libmyodbc5.so: undefined symbol: dynstr_append_mem
That is the same error that i get when i use iodbctest …
I hope someone can explain me what it is going on. Every tutorial i read says that if isql works that asterisk odbc connection should work also… But it doesn’t …
Thank you,
With kind regards,
Marco