hw
2018-Dec-07 13:19 UTC
[asterisk-users] cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.
Hi, is cdr logging using odbc buggy? I'im only getting an error "cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.". Connecting with isql to the datasource given in cdr_odbc.conf works just fine, and using the database for sippeers also works. The documentation[1] is confusing because it says freeTDS is required and that you must not use multiple database connectors and remains entirely unclear about whether odbc works at all for this and doesn't say what to do when you use odbc for sippeers and want to log CDRs in your database. [1]: https://wiki.asterisk.org/wiki/display/AST/MSSQL+CDR+Backend
Joshua C. Colp
2018-Dec-07 13:25 UTC
[asterisk-users] cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.
On Fri, Dec 7, 2018, at 9:19 AM, hw wrote:> > Hi, > > is cdr logging using odbc buggy? I'im only getting an error > "cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.". > > Connecting with isql to the datasource given in cdr_odbc.conf works just > fine, and using the database for sippeers also works.This message is output when the "dsn" value provided in cdr_odbc.conf does not match a dsn/class (context name) configured in res_odbc.conf You should confirm they match and if still encountering a problem then provide the configuration. -- Joshua C. Colp Digium - A Sangoma Company | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org
hw
2018-Dec-07 13:54 UTC
[asterisk-users] cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.
On 12/07/2018 02:25 PM, Joshua C. Colp wrote:> On Fri, Dec 7, 2018, at 9:19 AM, hw wrote: >> >> Hi, >> >> is cdr logging using odbc buggy? I'im only getting an error >> "cdr_odbc.c:174 odbc_log: Unable to retrieve database handle. CDR failed.". >> >> Connecting with isql to the datasource given in cdr_odbc.conf works just >> fine, and using the database for sippeers also works. > > This message is output when the "dsn" value provided in cdr_odbc.conf does not match a dsn/class (context name) configured in res_odbc.conf > > You should confirm they match and if still encountering a problem then provide the configuration. >Thanks, it's working now. I've been using the name of the data source rather than the name of the section. It doesn't make any sense to call it data source name (dsn) at places where the name of a section is expected. It also doesn't make sense that the section name in res_odbc.conf should be relevant here. Resources (res) would be configuration information --- the tables for this are created with alembic --- while logging information is something else --- and the tables for it are not created with alembic. This could use a lot of cleanup and (or at least) much better documentation.