Answer the question
In order to leave comments, you need to log in
Asterisk 12 ODBC bug or crooked hands?
I'm trying to get CDR to work through the ODBC driver.
sip*CLI> core show version
Asterisk 12.5.0 built by ubuntu @ sip.xxxxxx on a x86_64 running Linux on 2014-07-25 04:57:36 UTC
sip*CLI> module show like odbc
Module Description Use Count Status
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0 Running
cdr_odbc.so ODBC CDR Backend 0 Running
cel_odbc.so ODBC CEL backend 0 Running
func_odbc.so ODBC lookups 0 Running
res_config_odbc.so Realtime ODBC configuration 0 Running
res_odbc.so ODBC resource 0 Running
6 modules loaded
sip*CLI> odbc show all
ODBC DSN Settings
-----------------
Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last connection attempt: 1970-01-01 05:00:00
Pooled: No
Connected: Yes
sip*CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: Yes
Log congestion: No
* Registered Backends
-------------------
ODBC
csv
cdr-custom
Adaptive ODBC
cdr_manager
[2014-08-25 12:14:58] WARNING[7049] cdr_odbc.c: cdr_odbc: Error in ExecDirect: -1, query is: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ({ts '2014-08-25 12:14:39'},?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[2014-08-25 12:14:58] WARNING[7049] res_odbc.c: SQL Execute error! Verifying connection to asteriskcdrdb [MySQL-asteriskcdrdb]...
[2014-08-25 12:14:58] WARNING[7049] cdr_odbc.c: cdr_odbc: Error in ExecDirect: -1, query is: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ({ts '2014-08-25 12:14:39'},?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[2014-08-25 12:14:58] ERROR[7049] cdr_odbc.c: CDR direct execute failed
root@sip:/var/log/asterisk# echo 'insert into asteriskcdrdb.cdr (calldate) VALUES ("0000-00-00 00:00:00");' | isql -v MySQL-asteriskcdrdb asteriskuser 2Nv6kUAtRrC76y7jL
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> insert into asteriskcdrdb.cdr (calldate) VALUES ("0000-00-00 00:00:00");
SQLRowCount returns 1
root@sip:/var/log/asterecho 'select * from asteriskcdrdb.cdr;' | isql -v MySQL-asteriskcdrdb asteriskuser 2Nv6kUAtRrC76y7jL
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select * from asteriskcdrdb.cdr;
SQLRowCount returns 1
1 rows fetched
Answer the question
In order to leave comments, you need to log in
Why search when you already have everything...
current_elem.checkboxDiv.addEventListener('click', function() {
hide(current_elem.cardDiv);
},false);
@rostel
root@sip:/var/log/asterisk# cat /etc/asterisk/res_odbc.conf | grep -v "^;"
#include res_odbc_custom.conf
#include res_odbc_additional.conf
root@sip:/var/log/asterisk# cat /etc/asterisk/cdr_odbc.conf | grep -v "^;"
[global]
dsn=asteriskcdrdb
loguniqueid=yes
dispositionstring=yes
table=cdr ;"cdr" is default table name
usegmtime=no ; set to "yes" to log in GMT
hrtime=yes ;Enables microsecond accuracy with the billsec and duration fields
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question