Cdr problems (SOLVED)

[b]NOTE : The responses to this post may bring you help that is normally NOT a freepbx issue. If you have any questions about them, I would suggest you NOT do like I (unknowingly) did and look for help on this site, but more on an asterisk help forum. Also, the final cause may make you realize that sometimes a problem that SEEMS to originate from a wrong config can be caused by a VERY MUCH DEEPER cause.


First of all, I’d like to take the time to thank all of you guys. I haven’t posted a problem yet before today, and that’s due to the fact that very often other people have had the same problems, and that I could fix them without posting. :smiley:

Now for this one… I found “part” of the fix on but my problem goes further than up to where this thread goes.

I use freepbx on asterisk 1.4.24.

My cdr’s record in a csv in /var/log/asterisk/cdr-csv but don’t show up in the “reports” tab nor do they record in the mysql database. The databse name is correct, but I noticed that instead of being in the /var/lib/mysql/asterisk folder, it’s in /var/lib/mysql/asteriskcdrdb. Does that matter? The field headers are there but there is no other data.

-1- I installed the “asterisk-addons-1.4.2”. Is that right or should I install the or the 1.4.9 since I’m on the 1.4.24?
-2- When I uploaded it through the module admin, it gave me an incorrect filename format error, so I started by renaming it asteriskaddons-1.4.2, but i gave me an invalid path error. Then I uploaded it through my webmin file manager, unzipped it in /var/www/html/admin/modules/asterisk-addons-1.4.2 and followed the instructions from saying to “make clean”, “make” (which gave a “[config.status] error 1”), and “make install” which gave me 3 errors :

  • /usr/bin/install: cannot stat ‘’ : No such file or directory
  • /usr/bin/install: cannot stat ‘’ : No such file or directory
  • /usr/bin/install: cannot stat ‘’ : No such file or directory

I did a lookup for those files and didn’t find them anywhere.

Then I thought to myself that there could be a permission issue, so I checked the permission of the folder (including files and folders) and switched them from root user and group to asterisk and to 775.

  • Anything I missed?
  • Need more infos I didn’t think of putting here?
  • I suppose there’s a missing module I need to install to get those missing sql files. What is it and where do I get it please?

Thanks in advance for your help,


P.S. : I hope I’m in the right place to post this :-S

Dont really know the true fix but i have had same situation and i have a cdr file you can replace yours with and it will fix your issue

let me know if you want me to email you the file

michael gravely
[email protected]

Hello Michael,

Thanks for the offer. No offense intended, but I think I’ll keep your offer “on the side” and see if someone comes up with an explanation as to why I have so many problems with this setting up of the cdr and how to fix it.

Since the problem seems to be more in the mysql dbase, it would surprise me that replacing the cdr file would fix the problem. But… we never know when we’re in for a surprise. :wink:

I’m at the last problem to fix before going into production (unless something else pops up (knock on wood nothing else pops up)). So if by Friday I don’t have an answer, I’ll contact you for the file.

I saw on your web site a phone number in SC. Is it ok for me to contact you directly?

Thanks again,



I am having problem to view cdr.
I have newly installed asterisk and made extension to extension calls.After that i reached to the directory /var/log/asterisk/cdr-csv.This directory doesn not show nay file on running “ls”.

How should i view CDR data now??


I think the object of this message is obvious… that it would be a good idea that any “well positioned” person who could submit solutions to problems, post a simple reply that they don’t have the answer, or are looking up on the problem when they read a post.

The advantages of such a practice :

  • Posters like me would not wonder if anyone has read it
  • You would not get bi**** at by short tempered people who think they are being ignored for whatever paranoid reason. :wink:
  • Other people who might be tempted not to answer, thinking that “YOU” might have the answer, will not send a ball to a “no catcher zone”.

In short, I think everyone would be happy if contributors would adopt such a short time consuming habit. :slight_smile:

Why do I suggest this?

  • In all the posts that I’ve read until now, when an answer is available, you see it appear within 24 hours, even less.
  • When an answer is not available, do the search yourself, there are posts still completely unanswered «MONTHS» after the problem has been posted :-S
  • Even if I’m not the person who has originally posted these problems, some of them would have fixed secondary problems I have. Any answer, positive or negative shows that at least the post has been read, and if no answer is available, it might incite someone who does have the answer to submit one. regardless if the original poster has found the answer or not.

What do you think?

Still waiting for an answer to my 48 hour old problem,


I LOVE that idea - (and now you know someone read it :slight_smile:

If I had to hazard a guess this question has been ignored by others for the same reason that I did not answer it.

First - It’s not a FreePBX question. At best it’s an Asterisk issue

Second - No mention of the FreePBX reports is made.

Third - FreePBX uses the SQL CDR’s - No mention was made if the records are in the database

Fourth - Turning on CSV CDR’s is a well documented Asterisk function.

Since FreePBX is the interface to the system it seems a common assumption of new users that it relieves them of the obligation of understanding how to administer the packagers that comprise a LAMPA based phone system.

Many of you are using ISO based distributions. If something in the integration is not forking use the support groups for that distribution.

Lastly impatient demanding users are usually looked at last if ever. It has been said a thousand times, the cure for instant service is found in your wallet. Click on the support options and the fine pool of qualified engineers will have your complete attention. As a bonus you are supporting the project and people that make FreePBX possible.

Hello SkykingOH,

Thanks for taking the time to answer.

In response to your points :

First - It’s not a FreePBX question. At best it’s an Asterisk issue

–>ok, but don’t you think it would be nice for people like me who thought it was a freepbx issue to let us know? Thanks for letting me know, I’ll try to find help on the asterisk forums.

Second - No mention of the FreePBX reports is made.

–>If I write “Now for this one… I found “part” of the fix on but my problem goes further than up to where this thread goes.” Am I too subtle to find that it says exactly that NO report is made?

Third - FreePBX uses the SQL CDR’s - No mention was made if the records are in the database

–>As mentionned in my post "My cdr’s record in a csv in /var/log/asterisk/cdr-csv but don’t show up in the “reports” tab nor do they record in the mysql database. I will add to this by saying that the headers are in the dbase. Nothing else. So we know asterisk has the rights correctly configured to write to the dbase.

Fourth - Turning on CSV CDR’s is a well documented Asterisk function.

–>Thanks for the info, I didn’t find anything on it, but I WILL push the search further than the first few pages of google results

As for the rest of your respponse, I TOTALLY agree, and respond to that, that, probably like many others, I’m aiming to at least have a little income from my hard labor before sending money to the project.

IF I sounded impatient, maybe you just read too fast like for some other points you brought up that you had the answer under your nose, and didn,t realize that I was simply suggesting to not let people be without a response, wether or not it is a freepbx issue.

To sum it all up, I again take the time to thank you for responding to this post. I know that nobody is obliged to respond to any of these posts, and just would like to add that if you are to be kind and helpful, why not also simplify your life by saying so when you can’t help.



I did miss the SQL comments, sorry about that.

Depending on how you installed Asterisk you need to build the Asterisk Add-ons against the same kernel-dev and header packages.

So you are trying to learn Asteris/FreePBX to install and/or support systems for clients?

If this is the case learning by googling is not the best course.

You need a strong foundation in Linux, MySQL, Apache (httpd), Asterisk, DAHDI/Zaptel etc. A little PHP would not hurt (something I need to learn)

The Asterisk sample configs are a treasure trove of configuration information.

I would pickup a copy of Asterisk, The future of Telephony. It is also available as an ebook at

Lastly, the Open Source Telephony Training is a wonderful experience. To be able to learn from and interact with the developers is a priceless experience. I thoroughly enjoyed the experience.

Good luck

First thing to look for is if you have loaded, type in Asterisk CLI:

module show like mysql

You should (at least) get:             MySQL CDR Backend                        0

If not, search for how to compile Asterisk addon and load the modules.

If your module is loaded then try this in a shell:

mysql -uasteriskuser -pamp109

then type:

use asteriskcdrdb;

If you don’t have any error so far try then to show some data from the table:

select * from cdr where calldate like '2009-09-12 %';

If you get some data (and if you have made some calls that date) the CDR works. If not, then add some bogus data:

(calldate, clid, src, dst, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield)
("2009-09-12 11:11:11", "Test User <1234>", 1234, 5678, "from-internal", "SIP/1234-08dd6a00", "SIP/5678-08e95908", "Dial", "SIP/5678|15|tr", 4, 0, "NO ANSWER", 3, "testing","" ,"" );

Then do the above select again

select * from cdr where calldate like '2009-09-12 %';

If that work, then test your CDR to see if you get this bogus data.
My guess it that you have some error on the way and you should be able to solve them by this help.

However, the above help is WAY out of helping FreePBX matter but I do dislike the turnout of this thread that is why I have stepped in.

Hi guys,

You won’t belive this one. As incredible as it may seem, suddenly this morning when I logged into my system to test mickecarlsson’s suggestions, TADAAAAAAAAAAA… the reports work!!!

At first I didn’t get it how suddenly out of nowhere things would start working without anything done. Then it crossed my mind that my webhost told me he was doing some changes to his installations on Friday afternoon causing the server to be temporarily out of service.

I asked him if he remembered doing anything particular around 3 PM since my reports started working at 2:50. That’s when he told me he had just finished moving another customer on the same server to another server. He’s using php 3!!!

Search me if there’s any logic in all this, but at the very moment he closed out his service from the server I’m on, everything came to life! :smiley:

I’m very happy about the outcome, but feel a bit ashamed to have disturbed you like this.

Thanks to all for your patience and for taking the time to explain to me things that normally I should have looked up elsewhere.

In all of my searching for solutions, I have seen that you guys are not necessarily only on this site, and input quite alot of typing to try to help us.

Thanks again for your time and help,