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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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
nasirbestCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.