Freepbx not writing CDR data to MySQL DB

My FreePBX installation (CentOS, Asterisk, FreePBX 1.4.29.1, FreePBX 2.6.0.1, MySQL 5.0.77, all on the same server) is not recording CDR data into the database, nor to CSV files.
I can access the database by logging in to mysql as freepbx, or as root.  The file owner of the database files is mysql.  Any suggestions to start chasing this down would be appreciated!

Below is the contents of /etc/asterisk/cdr_mysql.conf.
[root@localhost asterisk]# cat cdr_mysql.conf
;
; Note - if the database server is hosted on the same machine as the
; asterisk server, you can achieve a local Unix socket connection by
; setting hostname = localhost
;
; port and sock are both optional parameters.  If hostname is specified
; and is not "localhost", then cdr_mysql will attempt to connect to the
; port specified or use the default port.  If hostname is not specified
; or if hostname is "localhost", then cdr_mysql will attempt to connect
; to the socket file specified by sock or otherwise use the default socket
; file.
;
[global]
hostname = localhost
dbname=asteriskcdrdb
password = fpbx
user = freepbx
userfield=1
;port=3306
;sock=/tmp/mysql.sock
[root@localhost asterisk]#

I
hmaupinAsked:
Who is Participating?
 
nasirbestConnect With a Mentor Commented:
furthermore if you have installed asterisk via yum instead of custom compilation. then please note that "yum list" does show only installed packages but all packages including available.

so in your case you need to

yum install asterisk-addons.i386

OR

yum install asterisk14-addons.i386

and then restart asterisk
0
 
nasirbestCommented:
first make sure that you have proper privileges to connected mysql. issue following command at command line

mysql -u freepbx -D asteriskcdrdb -p

and enter "fbpx" when prompted for password,

you can also try a scoks connection for asterisk cdr. just replace

;sock=/tmp/mysql.sock

with (no semicolon at start!)

sock=/var/lib/mysql/mysql.sock



0
 
hmaupinAuthor Commented:
Thanks, will try this when I am back on site tomorrow!
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
hmaupinAuthor Commented:
Sorry, still early here, I tried that yesterday, slightly different way, but was able to query the DB and get  result:

[root@localhost asterisk]# mysql -u freepbx -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 470
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use asteriskcdrdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from cdr;
Empty set (0.00 sec)

mysql>
0
 
hmaupinAuthor Commented:
Also, if this helps, here are the file permissions on the data files:

[root@localhost asteriskcdrdb]# ls -la
total 52
drwx------ 2 mysql mysql 4096 Mar 11 16:37 .
drwxr-xr-x 6 mysql mysql 4096 Apr 21 19:29 ..
-rw-rw---- 1 mysql mysql 9122 Mar 11 16:37 cdr.frm
-rw-rw---- 1 mysql mysql    0 Mar 11 16:37 cdr.MYD
-rw-rw---- 1 mysql mysql 1024 Mar 11 16:37 cdr.MYI
-rw-rw---- 1 mysql mysql   65 Mar 11 16:37 db.opt
[root@localhost asteriskcdrdb]# cd ..


Will try the socks approach tomorrow.
0
 
hmaupinAuthor Commented:
Well, that did not seem to do it, made the edit, reloaded asterisk, made a couple of calls, then checked via the gui and via mysql.  No records.  

[root@= asterisk]# asterisk -rx reload
[root@= asterisk]# pwd
/etc/asterisk
[root@= asterisk]# cat cdr_mysql.conf
;
; Note - if the database server is hosted on the same machine as the
; asterisk server, you can achieve a local Unix socket connection by
; setting hostname = localhost
;
; port and sock are both optional parameters.  If hostname is specified
; and is not "localhost", then cdr_mysql will attempt to connect to the
; port specified or use the default port.  If hostname is not specified
; or if hostname is "localhost", then cdr_mysql will attempt to connect
; to the socket file specified by sock or otherwise use the default socket
; file.
;
[global]
hostname = localhost
dbname=asteriskcdrdb
password = fpbx
user = freepbx
userfield=1
;port=3306
;sock=/tmp/mysql.sock
sock=/var/lib/mysql/mysql.sock
[root@= asterisk]# ls -la /var/lib/mysql/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Apr 30 17:50 /var/lib/mysql/mysql.sock
[root@= asterisk]#
[root@= asterisk]# ps -A | grep mysql*
 4555 pts/1    00:00:00 mysqld_safe
 4605 pts/1    00:00:00 mysqld
[root@= asterisk]#
0
 
nasirbestCommented:
what version of asterisk you running? did you have installed asterisk-addons?
0
 
hmaupinAuthor Commented:
It is Asterisk 1.4.29.1 installed as part of FreePBX.  It appears addons are installed, module list is attached (from CLI module show) and a listing of yum list asterisk.
module-list-20100502.txt
0
 
nasirbestCommented:
From your log it seems that "cdr_addon_mysql.so" is missing.

Please reinstall asterisk adons and during compilation issue "make menuselect" just after ./configure command, and then make sure that "mysql cdr" is available and checked.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.