Updated my modules last night, now CDR table doesn't populate new records

bug
freepbx
configuration
Tags: #<Tag:0x00007f7027a1f740> #<Tag:0x00007f70282fbeb8> #<Tag:0x00007f70282fbd28>

(Medic1) #1

Hey all,

I updated my FreePBX 14 box last night. I installed the system updated (yum update). And then started the task of updating my FreePBX modules after that. I did core update, folllowed by framework, then i did all the remaining modules about 3 at a time until they were done.

Restarted asterisk and freepbx.

Today I noticed my CDR records are not populating with new calls. I went into Asterisk CLI, did ‘cdr show status’ and it has normal stuff:

Call Detail Record (CDR) settings

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

  • Registered Backends

    Adaptive ODBC

I checked that cdr_odbc.conf extisted and it didn’t. Not sure if it was there to begin with. But this forum said to go ahead and add “#include cdr_adaptive_odbc.conf” into the cdr_odbc.conf file. Reloaded Freepbx but still no joy.

I checked the odbc.ini file in /etc and it shows the [MySql-asteriskcdrdb] section.

I go into mysql and do a “show processlist;” over and over again… and i see records being added into the cel table, but not the cdr table.

I dunno what to do now. I’m out of ideas. I need CDR table to work becuase it was working up until 10pm last night when i did the updates. My PowerBI reports depend on this database for business operations.

How can I get it to write to CDR database again?


(Lorne Gaetz) #2

If cel records are being written, but cdr is not, I suspect you have some sql table corruption. You can check by running:

mysqlcheck --repair --all-databases

(Medic1) #3

for everything, it keeps saying “The storage engine for the table doesn’t support repair” to all asterisk tables and asteriskcdrdb tables.


(Medic1) #4

Found some errors in the verbose logs:
Note, i did have Asternic CDR reports installed and i uninstalled it yesterday as well.

[2020-07-09 19:06:51] WARNING[123139] res_odbc.c: SQL Execute returned an error: 42S02: [MySQL][ODBC 5.2(w) Driver][mysqld-5.5.60-MariaDB]Table ‘asteriskcdrdb.acdrunichan’ doesn’t exist

[2020-07-09 19:06:51] WARNING[123139] res_odbc.c: SQL Execute error -1!

[2020-07-09 19:06:51] WARNING[123139] cdr_adaptive_odbc.c: cdr_adaptive_odbc: Insert failed on ‘asteriskcdrdb:cdr’. CDR failed: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,uniqueid,did,recordingfile,cnum,cnam,linkedid,sequence) VALUES ({ ts ‘2020-07-09 18:58:05’ },’“SPOC: ADMIN” <5597366756>’,‘5597366756’,‘105’,‘ext-queues’,‘SIP/SPOC-PBX-00000bdf’,‘Local/1324@from-queue-00006c16;1’,‘Queue’,‘105,t,’,0,0,‘BUSY’,3,‘1594338827.61203’,‘1803’,‘q-105-5597366756-20200709-185347-1594338827.61203.wav’,‘5597366756’,‘SPOC: ADMIN’,‘1594338827.61203’,87729)

[2020-07-09 19:06:51] WARNING[123139] res_odbc.c: SQL Execute returned an error: 42S02: [MySQL][ODBC 5.2(w) Driver][mysqld-5.5.60-MariaDB]Table ‘asteriskcdrdb.acdrunichan’ doesn’t exist

[2020-07-09 19:06:51] WARNING[123139] res_odbc.c: SQL Execute error -1!

[2020-07-09 19:06:51] WARNING[123139] cdr_adaptive_odbc.c: cdr_adaptive_odbc: Insert failed on ‘asteriskcdrdb:cdr’. CDR failed: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,uniqueid,did,recordingfile,cnum,cnam,linkedid,sequence) VALUES ({ ts ‘2020-07-09 18:58:06’ },’“SPOC: ADMIN” <xx56>’,‘xxxxxxx’,‘105’,‘ext-queues’,‘SIP/SPOC-PBX-00000bdf’,‘Local/1332@from-queue-00006c17;1’,‘Queue’,‘105,t,’,0,0,‘BUSY’,3,‘1594338827.61203’,‘1803’,‘q-105-5597366756-20200709-185347-1594338827.61203.wav’,‘5597366756’,‘SPOC: ADMIN’,‘1594338827.61203’,87732)
[


(Lorne Gaetz) #5

This is not a table used by FreePBX. Do you have some other CDR / reporting package installed?


(Medic1) #6

Yeah, I had Asternic CDR Reports installed and I forgot that I had uninstalled it last night during my update process. It keeps referencing it however. Basically I just want my machine to go back to normal with inserting into the CDR database, but it keeps saying “Insert Failed on asteriskcdrdb:cdr”


(Lorne Gaetz) #7

Running on old memories, but I recall that Asternic has some mysql triggers that might be staying behind. They should be able to tell you how to resolve this.


(Medic1) #8

I think i fixed it by using this website:

https://mangolassi.it/topic/19040/cdr-reports-not-working-freepbx-14

Basically there was a trigger in mysql for INSERT into the CDR table. I dropped the trigger like it said and now records are populating again. THANK YOU!