I have task - write CEL events into mysql. I wrote next setting:

odbcinst.ini =>

Description = ODBC for MySQL
Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1

Drivers located as well. Next is /etc/odbc.ini - connection to db.

[asterisk]                         # my system DSN
Description = description of your DSN
Driver      = MySQL                         # custom driver name
Server      = localhost                    
Port        = 3306                          # custom port 
Socket      = /var/run/mysqld/mysqld.sock   # socket
Database    = asteriskcdrdb                 # MySQL DB name 
UserName    = admin
Password    = 123456
Option      = 3
ReadOnly    = No

When i use "odbcinst -s -q", i get

root@astes:~# odbcinst -s -q

Then i believe system see my dsn. But when i use "isql asterisk -v", i get

root@astes:~# isql asterisk -v
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

What did i wrong? I installed mysql-connector and ODBC.

UPD: when i use "reload" in CLI* i get

[Feb  1 03:41:02] NOTICE[3135]: res_odbc.c:1481 odbc_obj_connect: Connecting asterisk
[Feb  1 03:41:02] WARNING[3135]: res_odbc.c:1508 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
[Feb  1 03:41:02] WARNING[3135]: res_odbc.c:1329 _ast_odbc_request_obj2: Failed to connect to asterisk
[Feb  1 03:41:02] WARNING[3135]: cel_odbc.c:125 load_config: No such connection 'asterisk' in the 'first' section of cel_odbc.conf.  Check res_odbc.conf.

Change driver to newest, and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.