CDR issues with 1.4.23.1. Gods of Asterisk please help!

I have scoured the Internet and this forum hoping to find a glimmer of insight on why I can’t get CDR logging to work. My test PBX is running on CentOS 5.2 with Asterisk 1.4.23.1 and Asterisk Addons 1.4.7. I can successfully configure CDR logging using the CSV method, mysql and ODBC, but I can’t get any method to actually write the CDR. Both through Asterisk and with query logging in mysql I have verified that Asterisk will connect to the database, but when a call is placed (via a call file) no cdr record is written. This is the ccase wih CSV logging as well. I have the exact same setup (I copied all of the conf files) on a Asterisk 1.4.10 installation running on Ubuntu and the CDR logging works as expected. Please tell me there is an undocumented configuration parameter change between 1.4.23 and 1.4.10 or something I am missing. I plead for any assistance.

Alright, please post the following:

  1. CLI output when you drop in a call file.
  2. CLI output when you type in “cdr status”
  3. CLI output when you type in “core show config mappings”
  4. CLI output when you type in “module show like cdr”
  5. The contents of the following files:
    cdr.conf
    cdr_custom.conf
    cdr_manager.conf
    cdr_mysql.conf

That should give enough info…

Hi Mark,

Thanks for responding. Below is the information you requested. I have also included the output of “cdr mysql status” after the call file was processed so you can see that I am indeed connected to the database. Let me know if you need additional detail.

Charles

  1. CLI output when you drop in a call file.

Verbosity is at least 3
– Attempting call on IAX2/voicepulse03/1678XXXXXXX for application Playback(projectX) (Retry 1)
– Call accepted by 64.61.93.109 (format ulaw)
– Format for call is ulaw
– <IAX2/voicepulse03-12995> Playing ‘projectX’ (language ‘en’)
– Hungup ‘IAX2/voicepulse03-12995’
[Feb 14 04:52:55] NOTICE[3247]: pbx_spool.c:366 attempt_thread: Call completed to IAX2/voicepulse03/1678XXXXXXX

  1. CLI output when you type in “cdr status”

CDR logging: enabled
CDR mode: simple
CDR output unanswered calls: no
CDR registered backend: mysql
CDR registered backend: cdr_manager
CDR registered backend: csv
CDR registered backend: cdr-custom

  1. CLI output when you type in “core show config mappings”

localhostCLI> core show config mappings
localhost
CLI>

localhostCLI>
Config Engine: odbc
localhost
CLI>
Config Engine: mysql
localhost*CLI>

  1. CLI output when you type in “module show like cdr”

localhost*CLI> module show like cdr
Module Description Use Count
cdr_custom.so Customizable Comma Separated Values CDR 0
func_cdr.so CDR dialplan function 0
cdr_odbc.so ODBC CDR Backend 0
app_cdr.so Tell Asterisk to not maintain a CDR for 0
cdr_csv.so Comma Separated Values CDR Backend 0
app_setcdruserfield.so CDR user field apps 0
cdr_manager.so Asterisk Manager Interface CDR Backend 0
app_forkcdr.so Fork The CDR into 2 separate entities 0
cdr_addon_mysql.so MySQL CDR Backend 0

  1. The contents of the following files:

cdr.conf

[general]

[csv]
usegmtime=yes ;log date/time in GMT
loguniqueid=yes ;log uniqueid
loguserfield=yes ;log user field

cdr_custom.conf

;[mappings]
;Master.csv => “${CDR(clid)}”,"${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"

cdr_manager.conf

[general]
enabled = no

cdr_mysql.conf

[global]
hostname=127.0.0.1
port=3306
user=valid_user
password=valid_password
dbname=valid_db
table=tbl_cdr
userfield=1
loguniqueid=yes
usegmtime=yes

cdr mysql status
Connected to valid_db@127.0.0.1, port 3306 using table tbl_cdr for 5 minutes, 44 seconds.
Wrote 0 records since last restart.

Okay, that all looks good except for one thing…

Could you please log into mysql and do the following:

use valid_db
show tables
desc tbl_cdr

thanks!

After that, if you could paste your extconfig.conf as well… that’s going to help.

There is only one table in the database at the moment.

mysql> show tables;
±--------------------+
| Tables_in_valid_db |
±--------------------+
| tbl_cdr |
±--------------------+

mysql> desc tbl_cdr;
±------------±-----------------±-----±----±--------------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-----------------±-----±----±--------------------±---------------+
| calldate | datetime | YES | MUL | 0000-00-00 00:00:00 | |
| clid | varchar(80) | YES | | | |
| src | varchar(80) | YES | | | |
| dst | varchar(80) | YES | | | |
| dcontext | varchar(80) | YES | | | |
| channel | varchar(80) | YES | | | |
| dstchannel | varchar(80) | YES | | | |
| lastapp | varchar(80) | YES | | | |
| lastdata | varchar(80) | YES | | | |
| duration | int(11) | YES | | 0 | |
| billsec | int(11) | YES | | 0 | |
| disposition | varchar(45) | YES | MUL | | |
| amaflags | int(11) | YES | | 0 | |
| accountcode | varchar(20) | YES | | | |
| uniqueid | varchar(20) | YES | MUL | NULL | |
| userfield | varchar(255) | YES | | | |
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
±------------±-----------------±-----±----±--------------------±---------------+

extconfig.conf is blank.

try adding to extconfig.conf the following

[settings] cdr.conf => mysql,valid_db,tbl_cdr

Then reload asterisks and preform a “core show config mappings” from the cli.

Now you should see something like

Then try making a call…

Then throw down a “cdr mysql status” into the CLI and hopfully you get:

Connected to valid_db on socket file /var/lib/mysql/mysql.sock using table tbl_cdr for 10 hours, 43 minutes, 34 seconds. Wrote 3 records since last restart.

I added the section to extconfig.conf as you suggested, but the CDR is not written. Do you know of a way to increase the logging for CDR? I have enabled debug in logger.conf, but it doesn’t seem to add anything useful.

[logfiles]
console => debug,notice,warning,error
messages => debug,notice,warning,error

Mark,

It looks like a bug. I found defect 0014167 bugs.digium.com/view.php?id=14167 which talks about CDR’s not processing with call files. I went back to build 1.4.21 and everything magically started working. Thank you for taking the time to help out. I really appreciate the effort.

I hope this thread helps someone else.

Charles

Has anyone found a fix for this. I have installed 2 AsteriskNOW 1.5 beta2 machines and no calls are logged nor do the recordings show up monitor. The calls are recorded in the directory.

Linux noob.

Mick