[Fixed] Can't access CDR Reports after upgrade

Hello. I have an installation based on PiaF v1.1-2. The only upgrade I had done until yesterday was to upgrade to FreePBX 2.4

Yesterday, I bit the bullet and upgraded PiaF to the latest and then did an upgrade of FreePBX to 2.5 .

Everything is working well with regards telephone operation, thanks to some help from the IRC, but I have 2 small problems:

  1. When I click on the Reports tab in FreePBX, I get the report screen with no data and a message “No data Found” where the call logs would be. Also there is a message in red just above the select form which says 'YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL!" If I access the database manually (from the command line), I can see all the records - so nothing seems to be missing. It would just be handy to get them from the Reports Tab.

  2. In the main FreePBX screen ‘System Status’, the Networks data rate is always 0 for receive and transmit - weird. It used to work.

If anyone has any suggestions to fix these issues, they would be most welcome.

In addition to the above, I have just found that Feature Code 411 (Phonebook dial-by-name directory) does not work. It in fact, continuously repeats the message “No directory entries match your search”.

Seems like nothing is accessing the database (yet it seems to be adding entries). The 411 feature obviously doesn’t test for proper connection to the database!

Does anyone have any ideas?


Yes, reinstall FreePBX as something was not updated correctly. I have had the same issue with Feature Code 411, reinstall solved the issue.

Oh, how do I re-install FreePBX? Having installed from PiaF, I have no clue.


I suggest that you do a full backup of your FreePBX, then follow this instructions to upgrade to the latest version of FreePBX:

Followed the instructions and upgraded to the latest FreePBX, but it changed nothing. Still can’t access the CDR or 411.

To me this looks like a FreePBX issue, but I don’t know enough about it to be sure.

Any other suggestions?

The CDR, does your url look like this:

http://<your ip address>/admin/reports.php

when you click on Reports?
As for the 411, I am investigating the issue as I have duplicated it on another machine.

Yes, it does.

The only other thing I have noticed that changed as part of the upgrade - is that when I login to FreePBX from the PiaF menu page, the login changed. i.e. it used to be admin/admin and is now the same as FOP - maint/password .

Could it be a database permissions thing, having changed users??

OK, for the 411 problem:

Go to /var/www/html/admin/modules/pbdirectory/ and check the sounds directory so that it looks like this:

drwxrwxr-x 3 asterisk asterisk 4096 Oct  2  2007 sounds

and then go down to sounds directory and check that the pbdirectory looks like this:

drwxrwxr-x 2 asterisk asterisk 4096 Oct  2  2007 pbdirectory

In my case it was that the directory pbdirectory had the wrong permissions. It needs 775, mine was 755.
chmod 775 pbdirectory fixed that.

For your other problem, check your /etc/amportal.conf for this:

# AUTHTYPE: authentication type to use for web admin
# If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above
# valid: none, database

OK, That had an effect.

You were spot on about the permissions for 411. My pbdirectory was set to 644. Setting it to 775 set it on its way! Thankyou.

I checked the amportal.conf and found AUTHTYPE=none, so I changed it. It immediately asked to login again. I tried admin/admin - no success, I tried maint/password (which I was already logged in as) - no success.

So I looked in amportal.conf and that seems to indicate the admin pair is admin/amp111. I tried that and it accepted the login, but won’t display the management page. The status bar on the bottom of the browser keeps saying 'waiting for ’ and goes no further.

Same happends if I try to go directly to http:///admin/reports.php

I’m confused. But progress has been made!

I meant to mention that the side effect of the above fix was to fix the System Recodings, which were failing on a permissions error. System Recordings now work.

I still can’t access the CDR from the Reports tab.

Not ever having played with this code before, I took a look at the HTML and came across admin/cdr/cdr.php which as it’s first test does:
if (!isset($AMP_CLAUSE)) {
$AMP_CLAUSE = " AND src = ‘NeverReturnAnything’";

This is the error I am getting!

I don’t know enough about this to know what the session variable, that is not set, means.

Does anybody know the significance of $_SESSION[‘AMP_SQL’]


What’s the next step here?

Unfortunately, I can’t live without the CDR reports.

Should I re-install from scratch? If I do, can I restore the configuration from a backup - given that something is broken in the current installation?

I am a little reluctant to re-install the system, as most things are working - particularly calls.

What is the best way to resolve this?

Does the url for the reports something like this:

What files do you have in /var/www/html/admin/cdr?

Yes, the url is exactly that.

Here is directory /var/www/html/admin/cdr

-rw-rw-r-- 1 asterisk asterisk  8531 Oct 18 11:38 about.php
-rw-rw-r-- 1 asterisk asterisk 22944 Oct 18 11:38 call-comp.php
-rw-rw-r-- 1 asterisk asterisk 24939 Oct 18 11:38 call-daily-load.php
-rw-rw-r-- 1 asterisk asterisk 21950 Oct 18 11:38 call-last-month.php
-rw-rw-r-- 1 asterisk asterisk 42522 Oct 18 11:38 call-log.php
-rw-rw-r-- 1 asterisk asterisk  6627 Oct 18 11:38 cdr.php
-rw-rw-r-- 1 asterisk asterisk   131 Oct 18 11:38 CHANGELOG.txt
-rw-rw-r-- 1 asterisk asterisk     1 Oct 18 11:38 counter.txt
-rw-rw-r-- 1 asterisk asterisk  1041 Oct 18 11:38 export_csv.php
-rw-rw-r-- 1 asterisk asterisk 13801 Oct 18 11:38 export_pdf.php
drwxrwx--- 2 asterisk asterisk  4096 Oct 15 12:15 images
-rw-rw-r-- 1 asterisk asterisk   210 Oct 18 11:38 info.txt
drwxrwx--- 2 asterisk asterisk  4096 Feb 29  2008 jpgraph_lib
drwxrwx--- 4 asterisk asterisk  4096 Feb 29  2008 lib

Your /var/www/html/admin/reports.php;

-rw-rw-r--  1 asterisk asterisk   2177 Oct 12 07:39 reports.php

Same size?


-rw-rw-r--  1 asterisk asterisk   2177 Oct 18 11:38 reports.php

I had the same issue when I upgraded CentOS, and from the terminal, I had to run chown asterisk /var/lib/php/session/ , but I think mickecarlsson has already covered that with you.

Original ticket details here:


This also magically fixed the network receive/transmit rates on the system status page!

Thank you magpye for your pointer on this. I knew it had to be something relatively simple!

Also, thanks to mickecarlsson for your help and perseverance.

Thank you for the feedback and thank you magpye for your input.

Hi. I’d like to reopen this topic. I confirmed all of the above suggestions, but I’m still seeing “No data found !!!”. Just below that, I see the bar graphs showing 893 calls totalling over 1000 minutes for today alone. Additionally, if I export to a PDF or CSV, the call records are all present. If I filter by Destination begins with “9”, I still see “No data found”, but if I filter by Destination begins with “91978”, I see “Number of calls” jump from 0 to 1607 followed by a complete list of those calls instead of the “No data found” error.

This server was a clean install of TrixBox v2.6.1.1. I then replaced the “pbxconfig” with a clean FreePBX v2.5 and updated all of the modules online from the module admin GUI and removed the TrixBox style sheets to return to the FreePBX look/feel.

Since this is running in a call center, the call volumes are very high and the customer is demanding CDR’s.

Any help I can get here is greatly appreciated.