[Home]

Summary:ASTERISK-15540: I can't store CDRs in mysql DB
Reporter:swider (swider)Labels:
Date Opened:2010-01-28 13:25:41.000-0600Date Closed:2011-06-07 14:00:33
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I installed asterisk-addons-1.6.1 and didn't find any errors during compilation. I created mysql db, modules were loaded but I can't still load cdrs to my new my sql DB:

+---- Asterisk-Addons Build Complete ----+
+                                           +
+   Addons has successfully been built .    +
+   If you would like to install it :       +
+                                           +
+                make install               +
+-------------------------------------------+


linux-1i0f*CLI> module show like sql
Module                         Description                              Use Count
cdr_addon_mysql.so             MySQL CDR Backend                        0        
res_config_mysql.so            MySQL RealTime Configuration Driver      0        
app_addon_sql_mysql.so         Simple Mysql Interface                   0        
3 modules loaded
linux-1i0f*CLI> cdr mysql status
No such command 'cdr mysql status' (type 'help cdr mysql status' for other possible commands)
linux-1i0f*CLI> realtime mysql status
general connected to asteriskcdrdb@127.0.0.1, port 3306 with username asteriskuser for 0 seconds.
linux-1i0f*CLI> cdr show status
linux-1i0f*CLI>
Call Detail Record (CDR) settings
----------------------------------
 Logging:                    Enabled
 Mode:                       Simple
 Log unanswered calls:       No

* Registered Backends
 -------------------
   cdr-custom
   csv

linux-1i0f*CLI>


****** ADDITIONAL INFORMATION ******

vim cdr_mysql.conf

[globals]
hostname=localhost
;dbname=asterisk
password=asterisk
;user=asterisk
table=cdr
;port=3306
;userfield=1
;sock=/var/lib/mysql/mysql.sock
dbname=asteriskcdrdb
user=asteriskuser
;user=root

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| asterisk           |
| asteriskcdrdb      |
| mysql              |
| test               |
+--------------------+
5 rows in set (0.00 sec)

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

mysql>

Comments:By: Alec Davis (alecdavis) 2010-01-28 21:25:45.000-0600

from configs/cdr_mysql.conf.samples

shouldn't it be [global] not [globals]

By: swider (swider) 2010-01-29 01:23:14.000-0600

Yes, you are right, mis-print. And I spent so much time to check everything step by step.. Thanks for the solution. Now it works proper.

By: Tilghman Lesher (tilghman) 2010-01-29 12:19:00.000-0600

Fixed with configuration change.