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/te...1.6.2.3.tar.gz
10. tar –zxvf asterisk-addons-1.6.2.3.tar.gz
# cd /usr/src/asterisk/asterisk-addons-1.6.2.3
# 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.
Tuesday, May 7, 2013
Subscribe to:
Post Comments (Atom)
Change this line
ReplyDeletecd /usr/src/asterisk/asterisk-addons-1.6.2.3
To
cd /usr/src/asterisk-addons-1.6.2.3
Asterisk version and CDR asterisk addons package version should be same to work
ReplyDeletewhich asterisk addons is suited for asterisk version 13.7.2
Deletei am using asterisk 13.7.2..which version of asterisk addons is suited for this
ReplyDeletei am getting this error while entering make && make install
ReplyDeletemake[1]: Entering directory `/usr/src/asterisk-addons-1.6.2.2/channels'
[CC] chan_ooh323.c -> chan_ooh323.o
In file included from chan_ooh323.c:18:0:
chan_ooh323.h:53:26: fatal error: asterisk/rtp.h: No such file or directory
compilation terminated.
make[1]: *** [chan_ooh323.o] Error 1
make[1]: Leaving directory `/usr/src/asterisk-addons-1.6.2.2/channels'
make: *** [channels] Error 2
please reply..urgent need