CDR and Adaptative ODBC Problem

Hi guys
Currently We’re working in a new IP Telephony proyect. We have:

  • asterisk 1.8.2
  • elastix 2.4.0
  • unixODBC 2.3
  • ODBC Driver 11 for SQL Server

I’d configured res_odbc.conf:

[asterisk]
enabled => yes
dsn => MSSQL-Asterisk
share_connections => no
limit => 5
username => asteriskuser
password => password
pre-connect => yes
sanitysql => select count(*) from systables
backslash_is_escape => no

and cdr_adaptive_odbc.conf.

[first]
connection=asterisk
table=cdr
usegmtime=yes

All is working fine, I can connect to the database but when I make a call, it’s not written to the database and the following error was displayed in asterisk logs:

[Oct 25 12:18:27] VERBOSE[7434] pbx.c: – Executing [s@macro-hangupcall:51] Hangup(“SIP/3205-00000000”, “”) in new stack
[Oct 25 12:18:27] VERBOSE[7434] app_macro.c: == Spawn extension (macro-hangupcall, s, 51) exited non-zero on ‘SIP/3205-00000000’ in macro ‘hangupcall’
[Oct 25 12:18:27] VERBOSE[7434] features.c: == Spawn extension (macro-dial-one, h, 1) exited non-zero on ‘SIP/3205-00000000’
[Oct 25 12:18:27] VERBOSE[7434] cdr_adaptive_odbc.c: > [INSERT INTO cdr () VALUES ()]
[Oct 25 12:18:27] WARNING[7434] res_odbc.c: SQL Execute returned an error -1: 42000: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near ‘)’. (80)
[Oct 25 12:18:27] WARNING[7434] res_odbc.c: SQL Execute returned an error -1: 42000: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Statement(s) could not be prepared. (89)

Can you help me to resolve this?

Regards,