0 like 0 dislike
90 views
I have asterisk installed version 1.6.1.8 and would like to write cdrs on asterisk db automatically
asked May 27, 2014 in Education & Reference by Yogi (180 points) | 90 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 – appaddonsqlmysql
• Call Detail Recording – cdr
addonmysql
• 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 cdraddonmysql.so file under /usr/lib/asterisk/modules, you will have to re-compile.
2. edit /etc/asterisk/modules.conf and add lin: load => cdraddonmysql.so
3. save and restart asterisk – then check if cdrs are wrking in mysql.

answered May 27, 2014 by Krish (860 points)
edited May 27, 2014 by Krish
0 like 0 dislike

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

answered Jun 7, 2014 by Smithg69

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 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

Mathe Forum Schule und Studenten
1,173 questions
1,313 answers
276 comments
1,603 users