AFLLC
asked on
asterisk odbc show command is empty and cdr is not working
I'm trying to get odbc working and connected to MySQL for cdr using asterisk 1.8.3.2 and I get no errors and no odbc cdr logging, but it does log to the csv. Can anyone help with this?
I get this output from odbc show:
and this output from cdr show status:
and this output from echo "select 1" | isql -v asterisk-connector:
I have edited these files and restarted asterisk:
/etc/odbcinst.ini
/etc/odbc.ini
/etc/asterisk/modules.conf
/etc/asterisk/res_odbc.con f
/etc/asterisk/cdr_adaptive _odbc.conf
and I have created a mysql database, user, and table as follows:
I get this output from odbc show:
*CLI> odbc show
ODBC DSN Settings
-----------------
phreaknasty*CLI>
and this output from cdr show status:
*CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: No
* Registered Backends
-------------------
cdr-custom
csv
cdr_sqlite3_custom
Adaptive ODBC
phreaknasty*CLI>
and this output from echo "select 1" | isql -v asterisk-connector:
[root]# echo "select 1" | isql -v asterisk-connector
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> +---------------------+
| 1 |
+---------------------+
| 1 |
+---------------------+
SQLRowCount returns 1
1 rows fetched
SQL> [root]#
I have edited these files and restarted asterisk:
/etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc3.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
/etc/odbc.ini
[asterisk-connector]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asterisk
Server = localhost
User = asterisk
Password = ****
Port = 3306
Socket = /var/lib/mysql/mysql.sock
/etc/asterisk/modules.conf
preload => res_odbc.so
preload => res_config_odbc.so
/etc/asterisk/res_odbc.con
[asterisk]
enabled => yes
dsn => asterisk-connector
username => asterisk
password => ****
pre-connect => yes
limit => 0
pooling => no
/etc/asterisk/cdr_adaptive
[first]
connection=asterisk
table=cdr
and I have created a mysql database, user, and table as follows:
CREATE USER 'asterisk'@'localhost' IDENTIFIED BY '****';
CREATE DATABASE asterisk;
GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost';
FLUSH PRIVILEGES;
CREATE TABLE cdr (
calldate datetime NOT NULL default '0000-00-00 00:00:00',
clid varchar(80) NOT NULL default '',
src varchar(80) NOT NULL default '',
dst varchar(80) NOT NULL default '',
dcontext varchar(80) NOT NULL default '',
channel varchar(80) NOT NULL default '',
dstchannel varchar(80) NOT NULL default '',
lastapp varchar(80) NOT NULL default '',
lastdata varchar(80) NOT NULL default '',
duration int(11) NOT NULL default '0',
billsec int(11) NOT NULL default '0',
disposition varchar(45) NOT NULL default '',
amaflags int(11) NOT NULL default '0',
accountcode varchar(20) NOT NULL default '',
uniqueid varchar(32) NOT NULL default '',
userfield varchar(255) NOT NULL default ''
);
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER