# CDR direct execute failed

**URL:** <https://community.asterisk.org/t/cdr-direct-execute-failed/64886>\
**Category:** Asterisk Support\
**Created:** [January 13, 2016, 1:51pm UTC](https://community.asterisk.org/t/cdr-direct-execute-failed/64886 "2016-01-13T13:51:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitormazuco](https://avatars.discourse-cdn.com/v4/letter/v/df705f/32.png) [@vitormazuco](https://community.asterisk.org/u/vitormazuco)\
**Post date:** [January 13, 2016, 1:51pm UTC](https://community.asterisk.org/t/cdr-direct-execute-failed/64886/1 "2016-01-13T13:51:50Z")

</div>

Hi everybody!

I’m trying to install a CDR Viewer [https://github.com/g613/asterisk-cdr-viewer](https://github.com/g613/asterisk-cdr-viewer)

I’ts work well, but my problem is to make Asterisk store to MySQL using ODBC

When I make a call the CLI returns for me, see the log below:

```auto
== Using SIP RTP CoS mark 5
    -- Executing [2021@ramais:1] Dial("SIP/2020-00000000",
"SIP/2021,60,tT") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/2021
    -- SIP/2021-00000001 is ringing
       > 0x7fd3f8014240 -- Probation passed - setting RTP source
address to 192.168.25.49:35528
[Jan 13 11:31:07] NOTICE[2279][C-00000000]: res_rtp_asterisk.c:4441
ast_rtp_read: Unknown RTP codec 95 received from '(null)'
    -- SIP/2021-00000001 answered SIP/2020-00000000
       > 0x7fd3b4004eb0 -- Probation passed - setting RTP source
address to 192.168.25.100:8000
       > 0x7fd3f8014240 -- Probation passed - setting RTP source
address to 192.168.25.49:35528
       > cdr_odbc: Error in ExecDirect: -1
[Jan 13 11:31:08] WARNING[2279][C-00000000]: res_odbc.c:604
ast_odbc_direct_execute: SQL Execute error! Verifying connection to
asterisk [asterisk-connector]...
       > cdr_odbc: Error in ExecDirect: -1
[Jan 13 11:31:08] ERROR[2279][C-00000000]: cdr_odbc.c:177 odbc_log:
CDR direct execute failed
```

See my res\_odbc.conf

```auto
[asterisk]
enabled = yes
dsn = asterisk-connector
username = root
password = 100567
pooling = no
limit = 1
pre-connect = yes
```

What can be happened? I use Asterisk 11 with Ubuntu Server 14.04.

Thank in advanced.

---

<div class="post-metadata">

**Author:** ![abw1oim](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@abw1oim](https://community.asterisk.org/u/abw1oim)\
**Post date:** [January 14, 2016, 7:54am UTC](https://community.asterisk.org/t/cdr-direct-execute-failed/64886/2 "2016-01-14T07:54:55Z")

</div>

Did You already verify wheter the ODBC-connection itself is running (You may check this with isql for the connection description asterisk-connector). And: How do the configuration cdr\_adaptive\_odbc.conf look like ? What’s the output of cdr show status in the Asterisk-CLI?
