I’ve been reading a lot of forum (too Asterisk- The Definitive Guide, 4th Edition) but without success…
I thought to appeal for your help.
I have this system config:
/etc/odbcinst.ini
[MySQLAnsi]
Description = ODBC MySQL 5.3.4-1 Ansi
Driver = /usr/lib64/libmyodbc5a.so
UsageCount = 2
/etc/odbc.ini
[MySQL-connector]
Driver=MySQLAnsi
Server=192.168.0.20
Database=pippo
Port=3306
Option=3
User=root
Password=pwd
UsageCount=1
ReadOnly = No
test connection with isql works fine…
/etc/asterisk/res_odbc.conf
[ENV]
ODBCINI => /etc/odbc.ini
ODBCSYSINI => /etc
[MySQL-asterisk]
enabled => yes
dsn => MySQL-connector
username => root
password => pwd
pre-connect => yes
sanitysql => select 1
share_connections => yes
idlecheck => 3600
isolation => repeatable_read
/etc/asterisk/cdr_adaptive_odbc.conf
[MySQL-asterisk]
connection=MySQL-asterisk
table=tp_astcdr
alias start => calldate
/etc/asterisk/cdr_odbc.conf
[global]
dsn=MySQL-asterisk
loguniqueid=yes
dispositionstring=yes
table=tp_astcdr
usegmtime=no
hrtime=yes
Asterisk console:
[Aug 8 16:38:28] NOTICE[10068]: res_odbc.c:792 load_odbc_config: Adding ENV var: ODBCINI=/etc/odbc.ini
[Aug 8 16:38:28] NOTICE[10068]: res_odbc.c:792 load_odbc_config: Adding ENV var: ODBCSYSINI=/etc
[Aug 8 16:38:28] NOTICE[10068]: res_odbc.c:1527 odbc_obj_connect: Connecting MySQL-asterisk
[Aug 8 16:38:28] NOTICE[10068]: res_odbc.c:1559 odbc_obj_connect: res_odbc: Connected to MySQL-asterisk [MySQL-connector]
[Aug 8 16:38:28] NOTICE[10068]: res_odbc.c:919 load_odbc_config: Registered ODBC class ‘MySQL-asterisk’ dsn->[MySQL-connector]
…
…
[Aug 8 16:41:01] WARNING[10073][C-00000006]: res_odbc.c:608 ast_odbc_direct_execute: SQL Execute error! Verifying connection to MySQL-asterisk [MySQL-connector]…
[Aug 8 16:41:01] ERROR[10073][C-00000006]: cdr_odbc.c:162 odbc_log: CDR direct execute failed
…
…
Can someone help me?
Thank you
Luca