FreePBX | Register | Issues | Wiki | Portal | Support

Asteriskcdrdb not showing results of current date / proper results

configuration
Tags: #<Tag:0x00007f749fff8780>

(FAK) #1

HI guys,

I am into a strange issue. when I checked the CDRs it’s reflecting the CDRs properly but when I check in the database asteriskcdrdb it’s not showing any results of the current date.


(FAK) #2

e.g I have checked all the cdr details from freepbx gui cdr module it gives my 9000 plus record but when I check from asteriskcdrdb cdr table it gives me only 213 record.


(Dave Burgess) #3

Check your CDR Configuration. There are lots of ways to store CDR, only one of which uses the database. You could be reading information from a CSV file /var/spool/asterisk/something (I’d have to look) and not getting the data from the database.

If you get the database started back up, you can always transfer the CDR data back to the database store using mysql utilities (or write a PHP script to pull the data in).


(FAK) #4

thanks cynjut for coming up.

where can I currently see that CDRs are writing to the Database properly.


(Dave Burgess) #5

You already know they aren’t, or they’d be in the database…

You need to get the ODBC connector working so the database gets populated, once you’ve done that, you can copy the CSV files into the database and all will be good again.


(FAK) #6

Please check I have these settings:

ip-172-31-20-111CLI> module show like odbc
Module Description Use Count Status Support Level
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0 Running core
cdr_odbc.so ODBC CDR Backend 0 Not Running extended
cel_odbc.so ODBC CEL backend 0 Running core
func_odbc.so ODBC lookups 0 Not Running core
res_config_odbc.so Realtime ODBC configuration 0 Running core
res_odbc.so ODBC resource 0 Running core
res_odbc_transaction.so ODBC transaction resource 0 Running core
7 modules loaded
ip-172-31-20-111
CLI> module load cdr_odbc.so
Unable to load module cdr_odbc.so
Command 'module load cdr_odbc.so ’ failed.
[2019-02-01 07:39:48] WARNING[4719]: cdr_odbc.c:205 odbc_load_module: cdr_odbc: Unable to load config for ODBC CDR’s: cdr_odbc.conf
ip-172-31-20-111*CLI> exit


(FAK) #7

ip-172-31-20-111*CLI> odbc show

ODBC DSN Settings

Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last connection attempt: 1969-12-31 16:00:00
Number of active connections: 1 (out of 1)


(FAK) #8

ip-172-31-20-111*CLI> cdr show status

Call Detail Record (CDR) settings

Logging: Enabled
Mode: Simple
Log unanswered calls: No
Log congestion: No

  • Registered Backends

    csv
    cdr-custom
    Adaptive ODBC

cat full | grep -i odbc

[2019-02-01 09:30:36] NOTICE[20761] res_odbc.c: Registered ODBC class ‘asteriskcdrdb’ dsn->[MySQL-asteriskcdrdb]
[2019-02-01 09:30:36] NOTICE[20761] res_odbc.c: res_odbc loaded.
[2019-02-01 09:30:36] VERBOSE[20761] loader.c: res_odbc.so => (ODBC resource)
[2019-02-01 09:30:36] VERBOSE[20761] loader.c: Loading res_config_odbc.so.
[2019-02-01 09:30:36] VERBOSE[20761] loader.c: res_config_odbc.so => (Realtime ODBC configuration)
[2019-02-01 09:30:36] VERBOSE[20761] loader.c: Loading cdr_adaptive_odbc.so.
[2019-02-01 09:30:36] VERBOSE[20761] config.c: Parsing ‘/etc/asterisk/cdr_adaptive_odbc.conf’: Found
[2019-02-01 09:30:36] VERBOSE[20761] cdr_adaptive_odbc.c: Found adaptive CDR table cdr@asteriskcdrdb.
[2019-02-01 09:30:36] VERBOSE[20761] cdr_adaptive_odbc.c: Found alias start for column calldate in cdr@asteriskcdrdb
[2019-02-01 09:30:36] VERBOSE[20761] loader.c: cdr_adaptive_odbc.so => (Adaptive ODBC CDR backend)
[2019-02-01 09:30:37] VERBOSE[20761] loader.c: Loading res_odbc_transaction.so.
[2019-02-01 09:30:37] VERBOSE[20761] pbx_app.c: Registered application ‘ODBC_Commit’
[2019-02-01 09:30:37] VERBOSE[20761] pbx_app.c: Registered application ‘ODBC_Rollback’
[2019-02-01 09:30:37] VERBOSE[20761] pbx_functions.c: Registered custom function ‘ODBC’
[2019-02-01 09:30:37] VERBOSE[20761] loader.c: res_odbc_transaction.so => (ODBC transaction resource)
[2019-02-01 09:30:42] VERBOSE[20761] loader.c: Loading cel_odbc.so.
[2019-02-01 09:30:42] VERBOSE[20761] config.c: Parsing ‘/etc/asterisk/cel_odbc.conf’: Found
[2019-02-01 09:30:42] VERBOSE[20761] config.c: Parsing ‘/etc/asterisk/cel_odbc_custom.conf’: Found
[2019-02-01 09:30:42] VERBOSE[20761] cel_odbc.c: Found CEL table cel@asteriskcdrdb.
[2019-02-01 09:30:42] VERBOSE[20761] loader.c: cel_odbc.so => (ODBC CEL backend)
[2019-02-01 09:30:42] VERBOSE[20761] loader.c: Loading cdr_odbc.so.
[2019-02-01 09:30:42] WARNING[20761] cdr_odbc.c: cdr_odbc: Unable to load config for ODBC CDR’s: cdr_odbc.conf
[2019-02-01 09:30:43] VERBOSE[20761] loader.c: Loading func_odbc.so.
[2019-02-01 09:30:43] VERBOSE[20761] pbx_functions.c: Registered custom function ‘ODBC_FETCH’
[2019-02-01 09:30:43] VERBOSE[20761] pbx_app.c: Registered application ‘ODBCFinish’
[2019-02-01 09:30:43] NOTICE[20761] func_odbc.c: Unable to load config for func_odbc: func_odbc.conf


(Dave Burgess) #9

You spotted that as it went by, right? What does your cdr_odbc.conf file look like?


(FAK) #10

don’t have any files with cdr_odbc.conf.


(FAK) #11

If I check the Database I do have CDRs coming there.
But the issue is e.g on 29 jan 19 we have 900 plus calls on cdrs but in Database only 279 records found.

Why all the CDRs are not properly replicated to database


(FAK) #12

Hi,
I am able to get the database populated with the CDRs but I am figuring out some strange thing.

it’s placing two entries for the same call in the database.


(system) closed #13

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