There are many people around having problems with cdr_addon_mysql.so
lacking this the system won’t save your call logs to cdr table.
I had this issue with Asterisknow distribution, but I think that the solution will be the same: recompile asterisk addons as it failed to load.
Anyway before proceeding you could check if logging is enabled and module loaded.
pbx*CLI> cdr show status
Call Detail Record (CDR) settings
Logging: Enabled
Mode: Simple
Log unanswered calls: No
pbx*CLI> module show like cdr
Module Description Use Count
cdr_addon_mysql.so MySQL CDR Backend 0
…
Now it’s working but to rebuild it I had to install mysql-devel and asterisk16-devel frome the repos, then I downloaded asterisk-addons-1.6.2.3.tar.gz and unpacked it to /usr/src
I made a symlink:
ln -s asterisk-addons-1.6.2.3 asterisk-addons
Then I ran:
./configure
./make menuconfig
./make all
Don’t make install!
I replaced only cdr_addon_mysql.so in /var/lib/asterisk/modules as this file was already present from the asterisk16-addons distribution package. Maybe it was built in a wrong way by the package maintainer.
Now you have to restart asterisk.
If it doesn’t build it’s only matter of deps.
Now you can run mysql -u freepbx -p
this is what you should get:
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| asterisk |
| asteriskcdrdb |
| test |
±-------------------+
4 rows in set (0.00 sec)
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> show tables;
±------------------------+
| Tables_in_asteriskcdrdb |
±------------------------+
| cdr |
±------------------------+
1 row in set (0.01 sec)
mysql> describe cdr;
±------------±-------------±-----±----±--------------------±------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------------------±------+
| calldate | datetime | NO | | 0000-00-00 00:00:00 | |
| clid | varchar(80) | NO | | | |
| src | varchar(80) | NO | | | |
| dst | varchar(80) | NO | | | |
| dcontext | varchar(80) | NO | | | |
| channel | varchar(80) | NO | | | |
| dstchannel | varchar(80) | NO | | | |
| lastapp | varchar(80) | NO | | | |
| lastdata | varchar(80) | NO | | | |
| duration | int(11) | NO | | 0 | |
| billsec | int(11) | NO | | 0 | |
| disposition | varchar(45) | NO | | | |
| amaflags | int(11) | NO | | 0 | |
| accountcode | varchar(20) | NO | | | |
| uniqueid | varchar(32) | NO | | | |
| userfield | varchar(255) | NO | | | |
±------------±-------------±-----±----±--------------------±------+
16 rows in set (0.00 sec)
mysql> select * from cdr;
You should start to get something as you receive or make calls.