Claim your Biolink Click Here
0 like 0 dislike
293 views
I have asterisk installed version 1.6.1.8 and would like to write cdrs on asterisk db automatically
in Education & Reference by (460 points) | 293 views

2 Answers

0 like 0 dislike

CREATE DATABASE asterisk;
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';

USE asterisk;

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 '',
userfield varchar(255) NOT NULL default ''
);

ALTER TABLE cdr ADD uniqueid VARCHAR(32) NOT NULL default '';
ALTER TABLE cdr ADD INDEX ( calldate );
ALTER TABLE cdr ADD INDEX ( dst );
ALTER TABLE cdr ADD INDEX ( accountcode );
5. service mysqld restart
6. Check asterisk db and cdr table for errors.
we need to install some of the options from the Asterisk-Addons download.
7. cd /usr/src
8. wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.1.4.tar.gz
10. tar –zxvf asterisk-addons-1.6.1.4.tar.gz

cd /usr/src/asterisk/asterisk-addons-1.6.1.4

make clean

./configure

make menuselect

At this point, be sure to select at least the following items:
• Applications – app_addon_sql_mysql
• Call Detail Recording – cdr_addon_mysql
• Resource Modules – res_config_mysql
After you’ve got those selected, save and exit. Then proceed with the following steps:

make

make install

make samples

Once we’ve got that done, we need to edit the cdr_mysql.conf file to enter the mysql username and password, database, and table we setup earlier.

vi /etc/asterisk/cdr_mysql.conf

[global]
hostname=localhost
dbname=asterisk
table=cdr
password=PASSWORD
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
userfield=1
loguniqueid=yes

============
HELP
1. If you do not find cdr_addon_mysql.so file under /usr/lib/asterisk/modules, you will have to re-compile.
2. edit /etc/asterisk/modules.conf and add lin: load => cdr_addon_mysql.so
3. save and restart asterisk – then check if cdrs are wrking in mysql.

by (1.1k points)
edited by
0 like 0 dislike

I gotta preferred this web web page it appears very valuable quite advantageous eedgkckfededddfd

by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
2 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,310 questions
1,471 answers
569 comments
4,809 users