Asternic Reports API needed for Scheduled Reports

freepbx
Tags: #<Tag:0x00007f7025acad68>

(United Kingdom) #1

Hi guys

Appreciate this isn’t ‘supported’ for FreePBX, but we installed Asternic CDR reports and Asternic CCstats so we can schedule some reports.

CCStats report schedule works fine, however the CDR reports errors with the following error:
Problem accessing API. Check your config.php file for API credential configuration

I cannot see in FPBX where to create the API for the the config.php file. I tried Asterisk Rest User but still get the same error unless a service needs to be restarted along with this.

Default creds in the config.php file are admin/admin.

Any help appreciated.


(Aaron) #2

I’m assuming you did this part? Obviously don’t use amp111 but yeah. Are you sure it says API and not AMI?

Manager Credentials

For the realtime page to work, you must supply valid Asterisk Manager Interface (AMI) credentials to Asternic setup.

Look at your /etc/asterisk/manager.conf file and search for a valid user and secret, it will look something similar to this:

[admin]
secret=amp111
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read=all
write=all

In the above case, the user is ‘admin’ and the secret is ‘amp111’.

From Asternic CCStats PRO version 2.3.0 and upwards, you can setup those credentails going to Setup/AMI Servers menu.

For older Asternic versions, edit the config file located in /var/www/html/stats/config.php file:

// Manager details (for realtime tab)
$MANAGER_HOST   = "127.0.0.1";
$MANAGER_USER   = "admin";
$MANAGER_SECRET = "amp111";

Without those credentials being set, the realtime view won’t display any agents or queue activity, while reports will run normally.

NOTE

It is also very important that the manager user has the originate (or all) permission in the write line if you want to use the realtime actions for spy, coach and steal calls. Without it, those actions will misserably fail without notice.


(United Kingdom) #3

Hi

Thanks for the reply. In the config.php file as it mentioned in the error, the following is shown:

// API Details - Used by Scheduled reports
$API_USER = “admin”;
$API_PASS = “admin”;
$API_HOST = “http://localhost/cdrstats”;

I have no idea what they expect, but I will try an AMI as you said.

Thanks


(United Kingdom) #4

Also the above article is for CCstats but I am looking to use it for CDRreports - it will probably be the same thing though so thanks for the heads up