Description

This guide will review the configuration aspects and prefernece you will find in Asternic Call Center Stats PRO. The software is very configurable and works accross several versions of Asterisk and web frontends, thus the number of settings is quite large. We are currently working on this guide and adding sections every day. It is a work in progress.

Although there is inline help in the software itself, we will try to describe here every configuration setting and its meaning in this guide, together with a review of the user and authentication system provided and the report desinger.


Login in

Once Asternic CCStats PRO is installed and activated with either a trial or purchased code, you should point your browser to http://your.server/stats in order to log into the system. You will be presented with a login form similar to this:

Asternic Login

The default administrator user is admin with password admin

NOTE

You should change the administrator password the first time you login to prevent unauthorized use of the software. Read the section Managing Users to see how to do that.

Once logged in, you will have access to the main dashboard, and at the top of it access to the Setup menu, where you will reach all the administrator management pages.


Setup Menu

The Setup menu at the top will display all available options for setting up system preferences.

Preferences

The preference page will let you add, modify or delete configuration parameters. The setting system in Asternic CCStats PRO is setup in a way you can define some configuration parameters as global or individualized to some particular element, by means of using a system similar to named arrays in programming, where the main option name is set in the keyword field, the optional modificator in the paramter field, and the actual setting of that preference on the value field. Read the next section to understand basic usage of the setting system.


Language

As an example for basic configuration, you have the 'language' keyword to change the interface translation to a different language. So, to change the language globally (for all of the users in the system), you have to edit the 'language' keyword and set it like this:

Asternic Login

From now on, configuration paramters are going to be listed in text instead of images to make the guide more concise, like this:

keyword: language
paramter:
value: en

As the parameter is empty, in this case the language will be set to english for all users in the system. It is a global parameter. In the case of individualized settings, if there is no individual setting, the global will be used instead by default.

Supose you have created a new user named Fran├žois, and you want him to see the reports in french instead. In that case, you will have to add a new language keyword and use the name of the user in the parameter field, like this:

keyword: language
paramter: Fran├žois
value: fr

So now you have a global parameter language set to English, and a particular user language set to French. You can have any number of individual settings, like having a different language for every user in your system.

NOTE

Many configuration keywords can be set globally or to an individual entity by using the parameter field.


Time Zone

Some times your server is in one location and you are on another part of the world, with a different time zone than the server itself. In those cases you might want to change date/time fields to reflect your local time zone instead of the server one.

You can set a global or individual timezone for a user by setting the 'timezone' parameter, example:

keyword: timezone
parameter: admin
value: +02:00

This setting will change datetime entries for the admin user to be 2 hours ahead of the server date/time. If the parameter is left empty, then the setting will apply to all users (it will be global).

The format for the parameter is:

[+-]HH:MM

So you can add or substract any number of hours or minutes for date time fields.


Date Format

You can change the format of date fields for drill down data or detailed reports data by using the date_format parameter. This is a global fields, so parameter must be left empty. Example:

keyword: date_format
parameter:
value: %m-%d-%Y %H:%i:%s

The format string can be set using the MySQL date formatting options

To change date formats for other reports you will have to use the Report Designer instead.


Time Formats

There are several fields in the drill down or detailed reports that display a duration entry. Those formats can be customzied with their appropiate setting. You can change the following fields in those reports:

wait_time_format
To set the time format for wait times in reports. A wait time is the amount of time a caller waited in the queue
avg_time_format
Time format for average call duration on reports
call_time_format
Time format for the actual call duration on reports
session_time_format
Time format for the session time column on Agent reports.

The value on this formats uses the following syntax:

Format Value
HHhours with a leading zero
MMminutes with a leading zero
SSseconds with a leading zero
mmfull minutes
ssfull seconds

So a valid value could be:

HH:MM:SS

Given the duration of 1 hour, 10 minutes and 5 seconds, the above format will display: 01:10:05

If the format is set instead to:

mm

The same duration of 1 hour, 10 minutes and 5 seconds will display: 70

If the format is set to:

ss

Then the display will be: 4205


Week Mode

Some distribution reports include a week column. Depending on your needs, you might need to count weeks on a year in different ways, like starting a week on a Sunday, or perhaps on a Monday, etc. Asternic CCStats PRO lets you decide how to treat weeks by setting the week_mode keyword. Set the value for week_mode to any of this options to change the way it will count weeks:

Mode    First day of week       Range   Week 1 is the first week ...
0       Sunday                  0-53    with a Sunday in this year
1       Monday                  0-53    with more than 3 days this year
2       Sunday                  1-53    with a Sunday in this year
3       Monday                  1-53    with more than 3 days this year
4       Sunday                  0-53    with more than 3 days this year
5       Monday                  0-53    with a Monday in this year
6       Sunday                  1-53    with more than 3 days this year
7       Monday                  1-53    with a Monday in this year

So, if you wish weeks to be counted as per ISO 8601, where Monday is the first week of the day, weeks are counted from offset 1 and the first week is the one where january 1st has at least 4 days, then set the value to 3:

keyword: week_mode
parameter:
value: 3

Decimal Places

Whenever a float number is displayed on reports, you might want to decide how many decimal places to show. You can set that with the decimal_places keyword:

keyword: decimal_places
parameter:
value: 2

This setting is global, parameter field must be left empty.


CSV Separator

Separator character to use in CSV export files. The default value is a comma , so CSV export files will open correctly on Excel and friends.

If you use LibreOffice/OpenOffice you might need to change it to a semicolon ; instead:

keyword: csv_separator
parameter:
value: ;

This setting is global, parameter field must be left empty.


Agent Dictionary

Some times your agent names are logged in the queue_log file with their device or number, instead of they real name. Something like Agent/1000, or SIP/300. Asternic CCStats PRO lets you add dictionary entries to rename them to whatever you like. For example:

keyword: dict_agent
parameter: Agent/100
value: John Doe

You can add as many entries as you like, the parameter is mandatory and should match the agent name you want to change in the reports.

NOTE

You should not use an existing agent name for a dictionary entry, otherwise you will end up with TWO selections for that agent on reports. And data will not be grouped. This feature is not for grouping data, but just chaging a display name.


Queue Dictionary

The same as the agent dictionary, you can rename queues using dictionary entries for them. For example:

keyword: dict_queue
parameter: 100
value: Support

The above entry will rename all appeareances of queue 100 to Support on the reports.


Call Flow

If you setup outbound call tracking using the builtin dialplan provided or a variation of it, you might want to separate inbound from outbound reports as some of the terminology, like an ABANDON, does not make sense when dealing with outbound calls.

To do so, you can use the call_flow setting, where you indicate which queues should be treated as outbound ones. Once this is setup, the Distribution reports will be separated between regular (inbound) and outbound queues:

keyword: call_flow
parameter: queue_name
value: outbound

NOTE

The parameter field is mandatory, and must match the queue name you want to set as an outbound queue.


Report Time Frames

Some times a Call Center runs on shifts or turns, or in specific time intervals. It is possible to define in the Home tab the start and end hours for a report so you can get statistics for that particular time frame. If you always run reports with a specific start and end hours, you can configure it so it always shows those times instead of the beginning and end of the day. The parameters are:

keyword: default_start_hour
parameter: 
value: 10:00
keyword: default_end_hour
parameter: 
value: 20:00

The above example will select the initial time frame automatically whenever you launch a report:

Time Frame


Distribution Interval

The distribution by hour report shows call distribution every 60 minutes. Some times you need a smaller break down on that report, like showing calls every 15 minutes instead of 60. In order to achieve that you have to user the distribution_interval setting:

keyword: distribution_interval
parameter: 
value: 15

This setting accept an integer value in minutes to use for the break down of Distribution by Hour report.


Initial shown report

When you select a set of agents, queues and days to run a report in the Home tab, you are directed automaticaly to the Distribution reports. That behaviour can be changed by using the first_page setting. You can assign a different initial page per user by filling the parameter value with the user name, or leave it as global when parameter is empty. For example, to set the user 'alfonso' to load the real time view directly, you can set it like this:

keyword: first_page
parameter: alfonso
value: realtime.php

The main Tabs in Asternic that can be used as first pages are:

  • distribution.php
  • answered.php
  • unanswered.php
  • realtime.php
  • agent.php
  • search.php

SLA Thresholds

SLA means 'Service Level Agreement'. It is a metric used to measure the efficiency of your call center based on how much time callers have to wait to be connected to a representative. Distribution reports in Asternic includes by default an SLA column. That column uses a formula (that can be changed in the Report Designer) to compute that metric. That formula also needs to know what is the waiting threshold to consider a call inside or outside SLA.

In Asternic you can configure that threshold for all calls depending on their final disposition: answered, abadnoned, unanswered and transferred. You can define a separate waiting threshold for each disposition. In general, the most important one is the answered one:

keyword: sla_answered
parameter: 
value: 10

In the above example, we are setting the global answered service level threshold to 10 seconds. Any answered call that is connected to an agent within 10 seconds will meet the SLA.

It is possible to define individual sla thresholds per queue, by using the parameter field:

keyword: sla_answered
parameter: 100
value: 20

In this case, queue 100 will have 20 seconds defined for the SLA threshold.

As mentioned before, you can define also SLA for other disposition by using: sla_abandoned, sla_unanswered and sla_transferred

NOTE

The default formula used for the SLA column in distribution reports is:

(ANSWERED_SLA / RECEIVED)*100

Where ANSWERED_SLA are all the calls answered within the sla_answered setting and RECEIVED is the total number of calls offered no matter their disposition (including abandoned calls)

You can change that formula using the Report Designer

There are also 2 reports in Asternic that will break down calls based on their waiting time, one in the Answered tab and the other in the Unanswered tab. This report can also be modified to break those calls into any interval (in seconds), and for any number of steps. To change the interval and steps, in Setup / Preferences you should use something like this:

keyword: sla_interval
parameter:
value: 10
keyword: sla_steps
parameter:
value: 15

The above setup will create a SLA report breaking calls every 10 seconds, and in 15 steps.


Report Designer

Under construction...


Users

Asternic CCStats PRO includes a powerful user authentication and authorization system in place. Authentication is done using a username and a password, while authorization is managed using access tokens and an ACL system. Users can also be limited to see certain queue or agents in their reports, so you can separate deparments or different tenants quite easily.

The first this you will see when editing users is the administration screen:

Asternic User Administration

By default there are 3 users on the system, you can change them or remove them if you do not plan to use them. They are there as a sample.

NOTE

It is very important for you to change the admin password as soon as the software is installed.

You can click the edit action icon on any entry to modify it:

Asternic Edit User

As you can see, modifying a user password, or the allowed agents or queues is quite simple.

The Level field lets you assign Access Tokens. To give full access to a system, you usually need to assign all available tokens to a given user. A token grants access to resources based on the Access Control definitios.


Access Control

Under construction...


Translations

Under construction...


Schedules/Alerts

Asternic Call Center Stats PRO can be programmed to send CSV reports via email. There are several components that must be configured right for this feature to work.


REST User

First of all, you must define a correct REST application interface user in /var/www/html/stats/config.php. That user must exist in the User section of Asternic, and it must have access to all the queues and agents and permissions in order to get all the data. If the user has limits, your reports might come empty or partial. Here is the snippet on config.php:

// Asternic user & pass for getting Scheduled reports and alerts
$REST_USER = "restUser";
$REST_PASS = "restPassX";
$REST_URL  = "http://localhost";

With that user, you must be sure that in the Preferences / Users you have defined a matching user, like this (password is not shown in forms, but it must match the one you set in config.php):

Asternic Rest User

NOTE

If the Rest user is not correctly defined, you will see on the Schedule page that you won't be able to select any report or queues on the corresponding fields. If you experience that issue, then check that the rest user and password are set correctly.


Cron Job Entry

Appart from the correct REST user being defined and set, you also need to set up a Cron Job on your operating system. The exact line to use and command to add is shown on the very same Scheduled Reports page. It will vary from system to system as the software will use your very own hostname or IP address when shoing that command, so it is best to look at the bottom of the page in your setup to get the exact command to use, it will be similar to this:

* * * * * wget --quiet --no-check-certificate --spider --user=restUser --password=restPassx http://localhost/stats/sched_check.php

Notice that you have to indicate the user and password, and the URL for the Asternic application on that line. In order to add that line, you have to open the Cron editor. Logged as root into your server command line type:

crontab -d

To bring the editor up so you can add the above line. Saving the file will set the cron job entry.


Add/Edit Schedule Report

The Schedule Report page is divided vertically in two sections. The left most section is the one where you can add/edit a scheduled report or alert, it looks like this:

Add/Edit Scheduled Report

  • (1) Email Address
    Email address to send the report to. If you want to send to multiple addresses, then use a comma to enumarate, without leaving any spaces between them, for example: me@example.com,him@example.com
  • (2) Reports to Send
    This field will present you with a drop down list of available reports to send. If the drop down is empty, check your REST user configuration (described in the previous section)
  • (3) Queus
    This field will present you with a drop down list of available queues. If you want to limit the report to a specific queue, select one here. Or leave it as 'all' to get data for all available queues. If the drop down is empty, check your REST user configuration (described in the previous section).
  • (4) From the last (X) days
    You can select the number of days to include in the report. If you want to receive daily reports, then you should select ONE day. For weekly reports chose SEVEN, etc.
  • (5) Month days
    You can select the month day in which the report should be sent, like the 1st of each month, the 15th, etc. You can use a comma separated list of days to send the report on specific days. If you use an asterisk (*) then the report will be send using other time/date conditions, and not checking for the day of the month.
  • (6) Week days
    Same as month days, you can select a week day, like Monday, Tuesday, etc. You can select multiple days also. If you want a report to be sent daily except for saturdays and sundays, then select days from Monday to Friday.
  • (7) Hours
    At which hour you want the report to be sent. It must be set together with the Minutes entry besides it. For example, if you want the report to be sent at 4:15PM, set hours to 16 and Minutes to 15
  • (8) Minutes
    At which minute you want the report to be sent. It must be set together with the Hours entry besides it. For example, if you want the report to be sent at 4:15PM, set hours to 16 and Minutes to 15

NOTE

The minimum time frame to send reports is on a daily basis. It is not possible to send hourly reports using just the web interface (but it can be done programming custom cron jobs on the underlying OS).

Finally, you have a check box to make the report active or not. An activated report will be run if the cron job entry was setup, an unactivated report can be kept for reference but won't be run when the time comes.


Log Parsing Service

Asternic CCStats PRO gets activity data from the asterisk /var/log/asterisk/queue_log file. In order to populate the database with actual data, the log parser daemon must be running at all times.

NOTE

If you notice that your reports show no activity (zero calls when running reports for today, for example), that most probably means that the log parser daemon is not running. In order to get the data, you will have to start it.

Since Asternic version 2.0.8, the log parser daemon is named 'asterniclog'. For previous versions, the log daemon is named 'tailqueuelog'. They are similar but not quite the same. So we will refer to both implementations here.

The log parser is installed by default in the /usr/local/parselog directory. If the software was installed manually without following our guides, then it might be located somewhere else in your hard disk. For the sake of simplicity, this guide will always refer to standard locations.


Version 2.0.8 log parser

Since version 2.0.8 the log parser is named 'asterniclog'. This is a service that can be launched using your system service handling scripts.

Starting the service

In Centos/RedHat based systems you can do it with the command:

service asterniclog start

In Debian or Ubuntu the correct command is:

/etc/init.d/asterniclog start

Stopping the service

In Centos/RedHat based systems you can do it with the command:

service asterniclog stop

In Debian or Ubuntu the correct command is:

/etc/init.d/asterniclog stop

Checking if the service is runnning

In Centos/RedHat based systems you can do it with the command:

service asterniclog status

In Debian or Ubuntu the correct command is:

/etc/init.d/asterniclog status

Service startup options

In order to run correctly, you have to pass several options to the service daemon.

Mandatory parameters to pass are the MySQL credentials and database host and names, and the log file to process. The rest are optional:

       -u <name>     - Connect to mysql as username <name> [root]
       -p <pw>       - Connect to mysql with password <pw>
       -h <host>     - Connect to mysql host <host> [localhost]
       -d <dbname>   - Connect to mysql database <dbname> [qstats]
       -l <queuelog> - Path and name for queue_log [/var/log/asterisk/queue_log]
       -c            - Convert Local/xxx@from-queue/n to agent name in FreePBX
       -r            - Reparse the full log with no date check
       -s            - Skip events with SIP/IAX in queue member
       --daemon      - Daemonize process and detach from console
       -w            - Write configuration to disk
       --purge       - Purge all data from tables

You must pass parameters for the init script by editing the OPTIONS file.

The file is named /etc/sysconfig/asterniclog and the default content for a FreePBX based distro is:

OPTIONS="-u qstatsUser -p qstatsPassw0rd -d qstats -h localhost -l /var/log/asterisk/queue_log -c --daemon"

If you do not use FreePBX, then the parameters are a little bit shorter:

OPTIONS="-u qstatsUser -p qstatsPassw0rd -d qstats -h localhost -l /var/log/asterisk/queue_log --daemon"

In the above example, the FreePBX line has the -c option to convert Local/xx entries in queue_log to the FreePBX agent name, that parameter is exclusive for FreePBX based systems and you should not use it in non FreePBX setups.


Purging Data

Some times you want to start new with the data. Either because you do not need historic data, or because you had some test calls and information you no longer need.

WARNING

Purging the tables will remove all activity and every queue and agent that is filled in the database. If you do not have the source queue_log files there is no way to recover that information after purging takes place.

In order to purgue the database, be sure the asterniclog service is not running first, so you should stop it:

service asterniclog stop

And then run the asterniclog command with the --purge parameter, like this:

/usr/local/parselog/asterniclog -u qstatsUser -p qstatsPassw0rd -d qstats -h localhost --purge

You will have to answer 'yes' to actually purgue the information. Also, be sure to set the corret MySQL credentials if you have changed it from defaults.


Reparsing old logs

Some times the log parser stops for some reason for any number of days, and you might notice a gap in your data when running reports, due to some rotated queue_log files not being processed. In those cases, you can use the -r command line option to asterniclog in order to reparse the file and insert entries even if they are older than the most current one in the database.

For example:

/usr/local/parselog/asterniclog -u qstatsUser -p qstatsPassw0rd -d qstats -h localhost -l /var/log/asterisk/queue_log-20150101 -c -r

The above command will reparse (-r) the queue_log-20150101 file, converting (-c) Local device to queue member names for FreePBX based systems.

NOTE

Some distributions, like the latest FreePBX one, have a policy of daily rotation for the queue_log file.

We strongly advise to change the rotation policy to a monthly basis. That will make system administration much simpler, and you will also keep a log file backup of critical data in the case the MySQL datbase becomes corrupt.

The queue_log file is not huge, and there is absolutely no point in rotating it daily and keeping just 7 or 10 days worth of log data.

So if your log files are rotated daily, look for the file in /etc/logrotate.d that has the queue_log section and change daily to monthly


Version 2.0.7 or older log parser


Common Administration Tasks

Here is a brief list of common administration taks you might need to perform:

Enabling Spy/Coatch/Steal options in Realtime

Before enabling this features, there is one important consideration to take into account: Asternic does not perform any audio processing. It is not a phone or webphone. It will launch a call that you will have to answer with your phone (being soft or hard phone, it does not matter).

So, in order to launch a call, Asternic needs to know what device to use. And for stealing a call (pick a call from an agent to take it yourself, usually a supervisor), you need to know your dialplan extension and context. Both the device and extension@context are assigned per user. That means that if you have multiple supervisors, you will have to create one separate user for each under Setup / Users.

Assuming you have a user named 'john', that uses the device SIP/200 and his extension is 200@from-internal, here is what you need to do: go to Setup / Preferences menu and add/modify:

keyword: realtime_spy_device
parameter: john
value: SIP/200

That bit will indicate Asternic to originate a call with SIP/200 anytype john attempts to spy or coach on a given call. Notice the parameter header that has the username, this way you can assign different devices to different users, just by adding a new 'realtime_spy_device' entry with a different parameter indicating every user you might want to give the ability to.

keyword: realtime_spy_extension
parameter: john
value: 200@from-internal

This one will enable call stealing, and will redirect any active call to extension 200 and context from-internal.

Optionally, you can tweak behaviour for Spy and Coach options by passing parameters to it. Asternic will use ChanSpy for both, and ChanSpy has lots of modifiers you can use to alter the behaviour, like 'q' to disable the initial beep, etc. You can see all of chanspy options for your current Asterisk version by running:

asterisk -rx 'core show application chanspy'

For passing particular options for call spy, you must add (or modify) in Setup/Preferences

keyword: realtime_spy_options
parameter: john
value: q

Same for coach, that is chanspy with the 'whisper' options being passed, so the supervisor can talk to the agent without the caller to listen to what he says:

keyword: realtime_coach_options
parameter: john
value: w

NOTE

Here is a screencast we made showing you how to do it:

https://www.youtube.com/watch?v=pNbV-nlwsE8


Setting Real Time visual Alarms

The Real Time view in Asternic lets you highlight entries when they reach certain condition. Those are called 'alarms', that can be used to show whenever an agent as paused for too long, or a waiting call is sitting there for ages, etc.

Here is a list of setting you can enter into Setup / Preferences to configure these alarms:


realtime_alarm_call_duration

Alarm in seconds for call duration in the realtime view. Can be set per queue by setting the parameter to the queue name. Suppose you want to highlight agents that are in a call for more than 10 minutes on queue Support, in that case you should add:

keyword: realtime_alarm_call_duration
parameter: Support
value: 600

realtime_alarm_last_call

Alarm in seconds for the last call information in the realtime view. Can be set per queue by setting the parameter to the queue name. The last call column shows the last time that agent took a call, so you can see how long that agent has been idle. If you want to trigger a visual alarm for that, you can add it into Setup/Preferences like the rest of alarm settings. The following example will highlight the last call cell for any agent that had not received a call in the last 20 minutes or more:

keyword: realtime_alarm_last_call
parameter: Support
value: 1200

realtime_alarm_pause_duration

Alarm in seconds for pause/break duration in the realtime view. Can be set per queue by setting the parameter to the queue name. This one lets you highlight agents that are paused for long times. As all other alarms, the value is expressed in seconds:

keyword: realtime_alarm_pause_duration
parameter:
value: 300

In the above example, if an agent is paused for more than 5 minutes (300 seconds), on any queue (empty parameter), it will be highlihgted.


realtime_alarm_pause_duration_type

Alarm in seconds for pause/break duration in the realtime view. Can be set per reason by setting the parameter to the type/reason of the pause. This one is really similar to the above pause alarm, but with the addition that you can set the pause reason/type in the parameter field, instead of the queue. So you can set up a visual alarm if pause reason is 'Bathroom' for example:

keyword: realtime_alarm_pause_duration_type
parameter: Bathroom
value: 300

realtime_alarm_wait_count

Alarm (in number of calls) for calls waiting in a queue in the realtime view. This particular one is not based on duration, but on number of calls waiting on a queue. If you want to show it for a particular queue, fill the parameter header with the queue name, if parameter is left empty, it will be a global value applied to all queues. For example, to show an alarm whenever there are more than 4 calls waiting:

keyword: realtime_alarm_wait_count
parameter:
value: 5

realtime_alarm_wait_duration

Alarm in seconds for call waiting duration in the realtime view. Can be set per queue by setting the parameter to the queue name.


realtime_alarm_row_color

Background row color when a value is in alarm in the realtime view.


realtime_alarm_threshold

Threshold (in percentage) from which to start coloring in alarm calls in the realtime view.

REST Web Service

Overview

Call Center Stats PRO includes a web service using the REST technology, simple ad powerfull. You can get all the available reports and functions available in the CCStats PRO User interface but in JSON format.

Calling as REST function is just opening an URL as the following:

http://your-server/stats/rest/index.php?entity=EEEEEEEE

Note: your-server is the ip or domain where you have Asternic Call Center PRO installed, stats is the web directory. EEEEEE means the entity or rest function available.

The following are the available list of functions:

  • Reports

  • Realtime

  • Queues

  • Agents

  • Call

  • Search

Now we know the different entities we can use with Call Center Stats PRO, we will explain each one and how to take advantage of this powerfull tool.

It is importan to know that you can test all your REST connections and functions explained with a regular web browser. You will see results returned as a web page in JSON format.

NOTE

Asternic Call Center Stats PRO will prompt for username and password defined in SETUP - USERS and will restrict the information returned as you configured the username.

ENTITY : REPORTS

You can call the entity this way:

http://server/stats/rest/index.php?entity=reports

the URL above will show available reports you can ask for. You will see something like:


{
    "data": [
        {
            "report" :    "answered_calls_detail"

        },
        {
            "report" :    "answered_calls_by_queue"

        },
        {
            "report" :    "answered_calls_by_agent"

        },
        {
            "report" :    "answered_calls_by_url"

        },
        {
            "report" :    "answered_calls_by_did"

        },
        {
            "report" :    "answered_calls_by_holdtime"

        },
        {
            "report" :    "answered_calls_by_event"

You may choose any report and use it this way:

http://server/qstats/rest/index.php?entity=reports/answered_calls_detail

or any other report as the image shows. This access will show you data from TODAY as it has not been defined any date variable or date range variables. If there is no data to show, you would see something like:

{
"page":"1",
"total":"0",
"records":"0",
    "rows": [
    ]
}

There are different variables that you can use with the GET method to show conditional results for the entity:

  1. start: start date in the format yyyy-mm-dd. Start date in a range. Example: ?entity=reports/answered_calls_detail&start=2012-08-01

  2. end: end date in the format yyyy-mm-dd. End date in range. Ex.: ?entity=reports/qnswered_calls_detail&start=2012-08-01&end=2012-08-02

  3. secondstart: hour of day in seconds to show the start hour in a range. Ex.: ?entity=reports/answered_calls_detail&secondsstart=2016551

  4. secondsend: hour of day in seconds to show the end hour in a range. Ex.: ?entity=reports/answered_calls_detail&secondsend=2019999

  5. agent: for reports '_by_agent', you can filter by agent.

  6. queue: for reports '_by_queue', you can filter by queue.

You can use all of these variables together for an accurate report query. Here is an example:

http://server/stats/rest/index.php?entity=reports/answered_calls_by_queue&start=2016-08-01&end=2016-08-10

Result:


{
"page":"1",
"total":"1",
"records":"6",
    "rows": [
        {
            "Queue" :    "2000",
            "Received" :    "165",
            "% Calls" :    "71.12"
        },
        {
            "Queue" :    "2001",
            "Received" :    "3",
            "% Calls" :    "1.29"
        },
        {
            "Queue" :    "2002",
            "Received" :    "60",
            "% Calls" :    "25.86"
        },
        {
            "Queue" :    "2003",
            "Received" :    "2",
            "% Calls" :    "0.86"
        },
        {
            "Queue" :    "2006",
            "Received" :    "1",
            "% Calls" :    "0.43"
        },
        {
            "Queue" :    "2007",
            "Received" :    "1",
            "% Calls" :    "0.43"
        }
    ]
}

Another example of answered_calls _detail that shows the detailed calls:

http://server/stats/rest/index.php?entity=reports/answered_calls_detail&start=2012-08-01&end=2012-08-10

Result:

{
"page":"1",
"total":"1",
"records":"232",
    "rows": [
        {
            "datetime" :    "01-08-2016 10:31:21",
            "queue" :    "2002",
            "agent" :    "Travis Spencer",
            "callerid" :    "4787574818",
            "event" :    "COMPLETEAGENT",
            "waitTime" :    "10",
            "ringTime" :    "10",
            "callTime" :    "94",
            "agentName" :    "Travis Spencer",
            "queueName" :    "2002",
            "recording" :    "test.wav",
            "uniqueid" :    "1327498260.2637",
            "callflow" :    "/asternicjquery/rest/index.php?entity=call/1327498260.2637",
            "url" :    "www.lala.com",
            "did" :    ""
        },
        {
            "datetime" :    "01-08-2016 10:53:45",
            "queue" :    "2002",
            "agent" :    "Travis Spencer",
            "callerid" :    "2568314606",
            "event" :    "COMPLETEAGENT",
            "waitTime" :    "13",
            "ringTime" :    "13",
            "callTime" :    "63",
            "agentName" :    "Travis Spencer",
            "queueName" :    "2002",
            "recording" :    "test.wav",
            "uniqueid" :    "1327499602.2681",
            "callflow" :    "/asternicjquery/rest/index.php?entity=call/1327499602.2681",
            "url" :    "www.lala.com",
            "did" :    ""
        },
        {
            "datetime" :    "01-08-2016 11:14:02",
            "queue" :    "2000",
            "agent" :    "Regina Spek",
            "callerid" :    "5082817600",

At the result above, note a line in the results named 'callflow' that shows a link to the 'call' entity that will be detail later in this documentation. The 'call' entity shows information detailed for a particular call.

ENTITY :QUEUES

Calling the entity this way:

http://server/stats/rest/index.php?entity=queues

will show the available queues populated in Call Center Stats PRO. You will see something like this:

{
    "data": [
        { 
            "queue_id" :    "2",
            "queue" :    "2000",
            "queue_name" :    "2000"

        },
        { 
            "queue_id" :    "8",
            "queue" :    "2001",
            "queue_name" :    "2001"

        },
        { 
            "queue_id" :    "4",
            "queue" :    "2002",
            "queue_name" :    "2002"

        },
        { 
            "queue_id" :    "5",
            "queue" :    "2003",
            "queue_name" :    "2003"

        },
        { 
            "queue_id" :    "1",
            "queue" :    "2005",
            "queue_name" :    "2005"

        },
        { 
            "queue_id" :    "3",
            "queue" :    "2006",
            "queue_name" :    "2006"

        },
        { 
            "queue_id" :    "6",
            "queue" :    "2007",
            "queue_name" :    "2007"

        },
        { 
            "queue_id" :    "9",
            "queue" :    "2009",
            "queue_name" :    "2009"

        },
        { 
            "queue_id" :    "-1",
            "queue" :    "ALL",
            "queue_name" :    "ALL"

        },
        { 
            "queue_id" :    "7",
            "queue" :    "NONE",
            "queue_name" :    "NONE"

        }
    ]
}

You can choose an specific queue calling the entity this way:

http://server/stats/rest/index.php?entity=queues/XX

being XX the field id from queue_id that you can see at last image.

{
    "data": [
        { 
            "queue_id" :    "6",
            "queue" :    "2007",
            "queue_name" :    "2007"

        }
    ]
}

ENTITY : AGENTS

Calling the entity this way:

http://server/stats/rest/index.php?entity=agents

will show total agents populated in Call Center Stats PRO. You will see something like this:

{
    "data": [
        {
            "agent_id" :    "-1",
            "agent" :    "ALL",
            "agent_name" :    "ALL"

        },
        {
            "agent_id" :    "6",
            "agent" :    "Andy Fisher",
            "agent_name" :    "Andy Fisher"

        },
        {
            "agent_id" :    "16",
            "agent" :    "B.Obama",
            "agent_name" :    "B.Obama"

        },
        {
            "agent_id" :    "14",
            "agent" :    "Boris G.",
            "agent_name" :    "Boris G."

        },
        {
            "agent_id" :    "7",
            "agent" :    "Daniel L.",
            "agent_name" :    "Daniel L."

        },
        {
            "agent_id" :    "11",
            "agent" :    "David Haseholf",

        ......data continues......

You can choose a specific agent calling the entity this way:

http://server/stats/rest/index.php?entity=agents/XX

being XX the field id of agent_id that you can see in latest figure.

ENTITY : CALL

The call entity shows detailed information regarding a call identified by the unique_id variable from the call itself.

Use the entity this way:

http://server/stats/rest/index.php?entity=call/13448674833.5314

This call may return something like this:


{
    "totalpages": "1",
    "currpage": "1",
    "totalrecords": "3",
    "data": [
        {
            "id" :    "1",
            "uniqueid" :    "1327498260.2637",
            "datetime" :    "2016-08-01 10:31:11",
            "queue" :    "2002",
            "agent" :    "NONE",
            "event" :    "ENTERQUEUE",
            "info1" :    "www.lala.com",
            "info2" :    "4787574818",
            "info3" :    "",
            "info4" :    "",
            "info5" :    "Sale",
            "agentName" :    "NONE",
            "queueName" :    "2002"

        },
        {
            "id" :    "2",
            "uniqueid" :    "1327498260.2637",
            "datetime" :    "2016-08-01 10:31:21",
            "queue" :    "2002",
            "agent" :    "Travis Spencer",
            "event" :    "CONNECT",
            "info1" :    "10",
            "info2" :    "1327498271.2638",
            "info3" :    "7",
            "info4" :    "",
            "info5" :    "",
            "agentName" :    "Travis Spencer",
            "queueName" :    "2002"

        },
        {
            "id" :    "3",
            "uniqueid" :    "1327498260.2637",
            "datetime" :    "2016-08-01 10:32:55",
            "queue" :    "2002",
            "agent" :    "Travis Spencer",
            "event" :    "COMPLETEAGENT",
            "info1" :    "10",
            "info2" :    "94",
            "info3" :    "1",
            "info4" :    "",
            "info5" :    "",
            "agentName" :    "Travis Spencer",
            "queueName" :    "2002"

        }
    ]
}

In this image you can see detailed events for the call identified with the unique_id field. Forst row shows the ENTERQUEUE event, the next shows CONNECT event and finally the COMPLETECALLER event.

NOTE

The asterisk queue application generates a log with several events that indicates statuses and actions during all the queue calls received. Our inline help on each report explains every event and the fields related.

ENTITY : REALTIME

The realtime entity takes an instant picture of your asterisk queue status, agent status, stats for today and more. Calling the entity is simple as:

http://server/stats/rest/index.php?entity=realtime

You may see something like the following picture:

{
"waiting calls": {
    "OUTBOUND": {
    }
,
    "Test": {
    }
,
    "saliente": {
    }
,
    "100": {
        "1": {
            "calleridNum": "asterisk",
            "calleridName": "asterisk",
            "waitTime": "2"
        }
    }
,
    "101": {
    }
,
    "102": {
        "1": {
            "calleridNum": "32080805",
            "calleridName": "32080805",
            "waitTime": "17"
        }
    }
,
    "103": {
    }
    }
,
"summary": {
    "queue": {
        "OUTBOUND": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "Test": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "saliente": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "100": {
            "Waiting": "1",
            "Agents": "1",
            "Penalty": "0",
            "Logged Off": "1",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "2"
        },
        "101": {
            "Waiting": "0",
            "Agents": "1",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "102": {
            "Waiting": "1",
            "Agents": "1",
            "Penalty": "1",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "17"
        },
        "103": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "1",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        }

    }
}
,{
"waiting calls": {
    "OUTBOUND": {
    }
,
    "Test": {
    }
,
    "saliente": {
    }
,
    "100": {
        "1": {
            "calleridNum": "asterisk",
            "calleridName": "asterisk",
            "waitTime": "2"
        }
    }
,
    "101": {
    }
,
    "102": {
        "1": {
            "calleridNum": "32080805",
            "calleridName": "32080805",
            "waitTime": "17"
        }
    }
,
    "103": {
    }
    }
,
"summary": {
    "queue": {
        "OUTBOUND": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "Test": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "saliente": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "100": {
            "Waiting": "1",
            "Agents": "1",
            "Penalty": "0",
            "Logged Off": "1",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "2"
        },
        "101": {
            "Waiting": "0",
            "Agents": "1",
            "Penalty": "0",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        },
        "102": {
            "Waiting": "1",
            "Agents": "1",
            "Penalty": "1",
            "Logged Off": "0",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "17"
        },
        "103": {
            "Waiting": "0",
            "Agents": "0",
            "Penalty": "0",
            "Logged Off": "1",
            "Busy": "0",
            "Paused": "0",
            "Answered": "0",
            "Unanswered": "0",
            "Abandoned": "0",
            "Abandon Rate": "0",
            "Avg Wait": "0",
            "Avg Duration": "0",
            "Max. wait time": "0"
        }

    }
}
,
"agents": {
    "OUTBOUND": {
    },
    "Test": {
    },
    "saliente": {
    },
    "100": {
    },
    "101": {
    },
    "102": {
    },
    "103": {
    }
    }
}

You will mostly see in a JSON format the updated queues and agents status in that moment. You may want to refresh it every 5 or 10 seconds in order to update the data.

ENTITY : SEARCH

This entity allows you to search the entire database for rows that match using the available variables.

http://server/stats/rest/index.php?entity=search&start=2016-08-01&end=2016-08-02&agent=Travis%20Spencer

This address may return information like the following:

{
"page":"1",
"total":"1",
"records":"6",
    "rows": [
        {
            "firstEvent" :    "ENTERQUEUE",
            "overflow" :    "1",
            "uniqueid" :    "1327498260.2637",
            "callerid" :    "4787574818",
            "dateStart" :    "2016-08-01 10:31:11",
            "dateEnd" :    "2016-08-01 10:32:55",
            "event" :    "COMPLETEAGENT",
            "agent" :    "Travis Spencer",
            "queue" :    "2002",
            "waitTime" :    "10",
            "talkTime" :    "0",
            "combinedWaitTime" :    "104",
            "totalDuration" :    "104",
            "recordingFilename" :    "test.wav",
            "agent_name" :    "Travis Spencer",
            "queue_name" :    "2002",
            "callflow" :      "/asternicjquery/rest/index.php?entity=call/1327498260.2637"

        },
        {
            "firstEvent" :    "ENTERQUEUE",
            "overflow" :    "1",
            "uniqueid" :    "1327499602.2681",
            "callerid" :    "2568314606",
            "dateStart" :    "2016-08-01 10:53:32",
            "dateEnd" :    "2016-08-01 10:54:48",
            "event" :    "COMPLETEAGENT",
            "agent" :    "Travis Spencer",
            "queue" :    "2002",
            "waitTime" :    "13",
            "talkTime" :    "0",
            "combinedWaitTime" :    "76",
            "totalDuration" :    "76",
            "recordingFilename" :    "test.wav",
            "agent_name" :    "Travis Spencer",
            "queue_name" :    "2002",
            "callflow" :      "/asternicjquery/rest/index.php?entity=call/1327499602.2681"

        },
        {
            "firstEvent" :    "ENTERQUEUE",
            "overflow" :    "1",
            "uniqueid" :    "1327504603.2835",
            "callerid" :    "4234324839",
            "dateStart" :    "2016-08-01 12:16:53",
            "dateEnd" :    "2016-08-01 12:17:39",
            "event" :    "COMPLETEAGENT",
            "agent" :    "Travis Spencer",

            ......data continues......