CDR is not logging

Hi Guys

I have been battling with this for the last month now and tried everything i could find on the web to rectify it to no avail.
I have managed to actually break the webadmin interface on a few occasions trying to rectify the CDR problem.

We are runing
FreePBX 2.10
Asterisk 1.8.11.0-digiumphones1
Modules we have installed and enabled.

Backup and Restore
Custom Applications
Digium Addons
Feature Code Admin
Online Support
Recordings
Call Forward
Call Recording
Call Waiting
Conferences
Core
IVR
Info Services
Paging and Intercom
Queues
Ring Groups
Time Conditions

We have 1 trunk offering 8 channels and all calls go through this.
The switchboard is working like a charm except that is is not logging and calls to the CDR table in the Mysql DB.

/etc/asterisk/cdr_mysql.conf

[global]
hostname = localhost
dbname=asteriskcdrdb
password = ****
user = freepbx
userfield=1
;port=3306
;sock=/tmp/mysql.sock
These details are correct. After logging in into the MySQL db with the details.

mysql> show tables;
±------------------------+
| Tables_in_asteriskcdrdb |
±------------------------+
| cdr |
±------------------------+
1 row in set (0.00 sec)

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

not sure if this will help.
from /var/log/asterisk/full
[2012-05-30 09:08:14] VERBOSE[18110] pbx.c: == Setting global variable ‘AMPDBENGINE’ to ‘mysql’

from /var/log/asterisk/freepbx.log
[2012-May-30 09:08:13] [INFO] (core/functions.inc.php:1795) - Added to globals: AMPDBENGINE = mysql

any advice or something i need to check would be greatly appreciated.
I really need to get call logs working.

What does “module show like cdr_mysql.so” say?

pbxCLI> module show like cdr_mysql.so
Module Description Use Count
0 modules loaded
pbx
CLI>

Then tried this

pbxCLI> module load cdr_mysql.so
Unable to load module cdr_mysql.so
Command ‘module load cdr_mysql.so’ failed.
[2012-06-05 15:01:33] WARNING[8426]: loader.c:398 load_dynamic_module: Error loading module ‘cdr_mysql.so’: /usr/lib/asterisk/modules/cdr_mysql.so: cannot open shared object file: No such file or directory
[2012-06-05 15:01:33] WARNING[8426]: loader.c:850 load_resource: Module ‘cdr_mysql.so’ could not be loaded.
pbx
CLI>

i do not have the file cdr_mysql.so anywhere on this system.

thank you for the quick responce.

i dont think you’ve compiled the add-ons with Asterisk. Search this forum, you will find the fix on how to do it, what Ast version you are using btw?

Asterisk 1.8.11.0-digiumphones1, Copyright © 1999 - 2012 Digium, Inc. and others.

Not sure why i just left this.
found directory asterisk-addons-1.6-2.3 would not compile

chan_ooh323.c:3144: error: âAST_CAUSE_FAILUREâ undeclared (first use in this function)
chan_ooh323.c:3146: error: âAST_CAUSE_NORMALâ undeclared (first use in this function)
chan_ooh323.c: At top level:
chan_ooh323.c:3161: error: expected â)â before string constant
make[1]: *** [chan_ooh323.o] Error 1
make[1]: Leaving directory `/root/asterisk-addons-1.6.2.4/channels’
make: *** [channels] Error 2

downloaded 1.6.2.4 sam error.
searching now to see why im getting this.

Thanks for info much appreciated.

why are u using 1.6 add-ons with 1.8? 1.8 comes with it already, you just need to make menuselect (or make menuconfig) straight off the 1.8 source dir.

follow this
http://www.freepbx.org/forum/freepbx/installation/asterisk-1-8-installation
start from the cd asterisk-1.8.x.x.x.x part

Hi guys thanks for all the help.

This was a fresh install from the CD.

Not sure but i must have missed something during installation.

You led me to the right fix though.
for anyone else having similar issues ill post my fix as ive seen this on a few forums and you are the first to help me rectify it.

/etc/yum.conf - removed the exclude freepbx and asterisk entry so yum could search the repos again.

yum install asterisk-addons-mysql
It showed it would clash with digium phones addon which i removed as we dont use digium phones.

this ran through after that went into asterisk -r
ran module load cdr_mysql.so

and all calls started logging in the db perfectly.

Many thanks again guys.

Hi mark,
I am using freepbx 2.10 and asterisknow 1.8.12 and also having the same problem of no CDR record. In my /etc/yum.conf file there is no string to remove the exclude freepbx and asterisk entry. could you clarify it a bit more?

Hi tad

i place the line
exclude=freepbx* asterisk* digium*
in my /etc/yum.conf file to avoid yum updating asterisk or components which has broken my freepbx before. I find it easier to do it manually through the web interface.

running the command. yum list asterisk18*
will list all the asterisk1.8 packages that you may install.

running yum list asterisk-addons*
will list only addon packages.

you will need asterisk-addons-core and asterisk-addons-mysql

so the command yum install asterisk-addons-mysql will inform you that asterisk-addons-core is required and you can accept this.

it will then check conflicts and so on and if all is in order will procede to install the addons-core and addon-mysql

after this to load the module do the
asterisk -r
module load cdr_mysql.so

and the module should happily load and you will find your cdr table being populated on the next call.

hello
thanks for your reply. i followed as per your instruction but when i execute the command to list asterisk-addons, it replies with no matching packages to list. hence there are no module loaded in asterisk cli named cdr_mysql.so
still in the gloomy situation…

form work ok:

yum erase asterisk18-addons-mysql

yum install asterisk-addons-mysql