# 1.6.0.5 - "Unable to retrieve database handle. CDR fail

**URL:** <https://community.asterisk.org/t/1-6-0-5-unable-to-retrieve-database-handle-cdr-fail/25277>\
**Category:** Asterisk Support\
**Created:** [January 31, 2009, 8:04pm UTC](https://community.asterisk.org/t/1-6-0-5-unable-to-retrieve-database-handle-cdr-fail/25277 "2009-01-31T20:04:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitolini](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vitolini](https://community.asterisk.org/u/vitolini)\
**Post date:** [January 31, 2009, 8:04pm UTC](https://community.asterisk.org/t/1-6-0-5-unable-to-retrieve-database-handle-cdr-fail/25277/1 "2009-01-31T20:04:16Z")

</div>

I was using 1.6.0.1 without any problems then my server died and i had to start everything from scratch. I retrieved my database and all config files from the backups without any problems. At the same time asterisk 1.6.0.5 was available for download and I installed this new version. Though when you run it; it actually says 1.6.0.3 ???

After that my cdr odbc stopped working. Again DB and my configuration files are all kept the same during this setup.

In my logs I have…

`[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:251 load_odbc_config: Adding ENV var: INFORMIXSERVER=my_special_database
[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:251 load_odbc_config: Adding ENV var: INFORMIXDIR=/opt/informix
[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:606 odbc_obj_connect: Connecting ast-conf
[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:620 odbc_obj_connect: res_odbc: Connected to ast-conf [asterisk-odbc]
[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:340 load_odbc_config: Registered ODBC class 'ast-conf' dsn->[asterisk-odbc]
[Jan 29 23:03:23] NOTICE[9952]: res_odbc.c:823 load_module: res_odbc loaded.
 res_odbc.so => (ODBC resource)
[Jan 29 23:03:23] NOTICE[9952]: config.c:1910 ast_config_engine_register: Registered Config Engine odbc
 res_config_odbc loaded.
 res_config_odbc.so => (Realtime ODBC configuration)`

When i issue “odbc show all” I get the following

`Name: ast-conf 
DSN: asterisk-odbc 
Pooled: No 
Connected: Yes `

issuing cdr show status prints

`CDR logging: enabled 
CDR mode: simple 
CDR output unanswered calls: no 
CDR registered backend: cdr-custom 
CDR registered backend: ODBC 
CDR registered backend: Adaptive ODBC `  
But after a call is completed I get the infamous "odbc\_log: Unable to retrieve database handle. CDR failed. "

any ideas?

Thanks,

Vito
