I’m facing an issue with asterisk
cdr table. Data is inserting successfully after call hangup. But the issue, I’m getting this below error.
[Jun 13 11:04:02] ERROR: cdr_odbc.c:175 odbc_log: Unable to retrieve database handle. CDR failed.
Below settings I’ve made in my config files. What’s wrong is going here? Can anyone have any idea?
Description = MySQL ODBC Driver Testing
Driver = MySQL
Socket = /var/run/mysqld/mysqld.sock
Server = localhost
User = xxxx
Password = xxxx
Database = asterisk
Nothing I’ve change in
Note that my server config:
CentOS Linux release 7.3.1611 (Core)
Thanks in advance.
@jcolp can you have a look please if you are available. Sorry for tagging you.
When you posted this it was 3AM my time so tagging me wasn’t really needed. In fact I generally already respond to any posts which I have knowledge on.
If you haven’t changed anything in res_odbc.conf then your configuration is incomplete, as it is explicitly disabled in that file by default.
Thanks for the response. I’m really apologies for tagging you.
I’m checking and updating the res_odbc.conf file.
Maybe this tutorial can help You http://www.minestron.it/node/352.
Thank you @jeanne. The problem has been resolved from your given link.
I followed The link that @jeanne posted, but with no luck!
Some times the call get stored in CDR table, but some other times I get the error : Unable to retrieve database handle. CDR failed. !!
Any help ?
What I learnt on how to resolve this error:
The DSN name in /etc/asterisk/cdr_odbc.conf must point to the section name in /etc/asterisk/res_odbc.conf.
The DSN name in /etc/asterisk/res_odbc.conf must point to the section name in /etc/odbc.ini
The Driver name in /etc/odbc.ini must point to the section name in /etc/odbcinst.ini
I hope this helps someone.