Created
December 19, 2018 03:04
-
-
Save ambiorixg12/2c208cac05b129dd50bad24564da1642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://community.asterisk.org/t/call-detail-records-are-not-saving-in-cdr/76743/6 | |
Install packages | |
apt-get install unixodbc-dev unixodbc-bin unixodbc | |
/etc/odbc.ini | |
[asterisk-mysql] | |
Description = MySQL connection to ‘asterisk’ database | |
Driver = MySQL | |
Database = asterisk | |
Server = localhost | |
UserName = root | |
Password = ‘’ | |
Port = 3306 | |
Socket = /var/run/mysqld/mysqld.sock | |
This lib need to be downloaded from MYSQL SITE | |
/etc/odbcinst.ini | |
[MySQL] | |
Description = ODBC for MySQL | |
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so | |
Setup = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8S.so | |
FileUsage = 1 | |
/etc/asterisk/cdr_adaptive_odbc.conf | |
[asterisk-mysql] | |
connection=asterisk-mysql | |
table=cdr | |
alias start => calldate | |
/etc/asterisk/res_odbc.conf | |
[asterisk-mysql] | |
enabled => yes | |
dsn => asterisk-mysql | |
username => root | |
password => ‘’ | |
pre-connect => yes | |
assuming asterisk db exist create the table | |
CREATE TABLE cdr ( | |
calldate datetime NULL , | |
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 ‘’ | |
); | |
restart asterisk | |
service asterisk restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment