No CDR in cdr MySQL Table

asterisk
Tags: #<Tag:0x00007fafc7540f78>

(Addison Burnside) #1

Okay I am struggling to get CDR working. As far as I can tell this is really an Asterisk problem and not a FreePBX problem but I am more familiar with this forum. I have installed from release packages Asterisk 11.25.3 and FreePBX 12.0.76.6 on CentOS 6.10.
Asterisk is putting data in the cel table but not the cdr table.

I found some problems initially with ODBC in that there was no /etc/odbc.ini file, I created it and initially had some incorrect parameters for the socket location. I got that corrected and reinstalled Asterisk.

When I run:

[~]# isql -v MySQL-asteriskcdrdb asteriskuser password
±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+
SQL>

So that is working but there is no data in the cdr table.

mysql> select * from cdr;
SQLRowCount returns 0
mysql> select * from cel;
SQLRowCount returns 274

[~]# asterisk -x “odbc show asteriskcdrdb”

ODBC DSN Settings

Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last connection attempt: 1970-01-01 00:00:00
Pooled: No
Connected: Yes

In the asterisk log after an “apply config” there is:

[2018-08-16 00:53:27] NOTICE[5445] res_odbc.c: Connecting asteriskcdrdb
[2018-08-16 00:53:27] NOTICE[5445] res_odbc.c: res_odbc: Connected to asteriskcdrdb [MySQL-asteriskcdrdb]
[2018-08-16 00:53:27] NOTICE[5445] res_odbc.c: Registered ODBC class ‘asteriskcdrdb’ dsn->[MySQL-asteriskcdrdb]

/etc/asterisk/cdr_mysql.conf settings:

[global]
hostname = localhost
dbname=asteriskcdrdb
password = password
user = asteriskuser
userfield=1
;port=3306
;sock=/tmp/mysql.sock

/etc/asterisk/res_odbc_additional.conf

; Do NOT edit this file as it is auto-generated by FreePBX. ;
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskuser
password=>password

So for the life of me I can’t tell why asterisk isn’t putting the cdr records in the database.
Thanks for any help and insight.


(Greg) #2

Look over here at this thread… it includes information on how to get to the CDR data, as well as a link on how to make sure that Asterisk is writing to the database.


(system) closed #3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.