Asterisk Resources Overview

This help file is for the old version of SAM Reports. New version brings more reports and a lot of new features.

There are new help files for Asterisk Resources for the new version -> SAM Reports2 :

Asterisk Resources (SAM Reports 2)

Anything that is being  analyzed, viewed at, by the application is considered a resource. So extensions (channels) local to your PBX are the resources. Trunks that connect your PBX to the outside world are also resources. Agents in your call center, together with queues are the resources. All the people that called your PBX are the resources as well. So we might put it this way:

There are three groups of resources:

  1. Extensions (channels) and trunks.
  2. Agents and queues
  3. Contacts and the unknown caller ids.

Channels are the extensions of your Asterisk PBX. All the extensions registered at your local PBX. IAX, SIP, ZAP, etc. They let you “dial from“. Extensions, channels, are what your phone devices are connected to.

Trunks are what traditional telephony considers phones lines to be. They connect your Asterisk PBX to the world, let you “dial out“. So some SIP or IAX VoIP provider is a trunk for our Asterisk PBX. The same goes for a telephony card plugged into our Asterisk’s machine.


Asterisk Channels And Trunks by SAM Reports

Channels And Trunks Window


After you install SAM Reports, and download the log files you have to decide which of your channels are trunks, and which are extensions (plain channels). The application asks you that just once upon first parsing of your CDR data. SAM Reports tries to guess which of the channels are actually trunks, and displays a list of all channels/trunks found in your CDRs. You can then make changes, but you can do the same from this window as well.

It is useful to give your extensions a name. You can do that by assigning a contact to a channel. If you don’t have any contacts, you can create one by clicking on the “New Contact For Channel” button.  For example Mary who always uses the extension 101 may be associated with SIP/101 channel (if that’s a SIP device in deed). And the phone that sits in you office’s kitchen may be given a contact named “The Kitchen”.

You can print channels and trunks. When you do The Print Preview Window appears, which looks the same for all the data across the application.

Here you can see all your agents and queues as well as their relations. Like in what queues does agent Keila Bortle participate, or which agents are in a queue “Sales”… SAM Reports does not ask YOU those questions, but informs you of what it found out while parsing a queue log.


Asterisk Agents And Queues - Resources in SAM Reports

Agents And Queues - Resources


You cannot add new agents or delete them, you can just assign a contact to an agent to make the reports more meaningful. Reports are more readable if you add a description for your queues.


Asterisk Agents And Queues - Resources by SAM Reports

Agents And Queues - Resources - Agents


Yo can see all the relationships between queues and agents. Which agents are in which queues, and vice versa.

Distribution Of  Queues By Agent


Asterisk Reports Distribution Of Queues By Agent by SAM Reports

Distribution Of Queues By Agent


Distribution Of Agents By Queue


Asterisk Reports - Resources - Distribution Of Agents By Queue by SAM Reports

Distribution Of Agents By Queue


Contact resources are made from the caller-id information found in the CDR and queue log files. This window lets you match those phone numbers with real names.


Asterisk Reports - Resources - Contacts by SAM Reports

Resources - Contacts


As you can see on the image above, company names are just gibberish. I needed to protect the real company names from appearing on this image.

The caller-id data in question is called by the application “The Unknown Phone Numbers”. To match the unknown phone numbers with the appropriate contact names you have to do one of the things mentioned below:

  • Assign the unknown number to one of the existing contacts.
  • Create a new contact and do the same.
  • Assign multiple unknown numbers to contacts.

Just choose an unknown number and assign it to the currently selected contact by clicking on a tool button.


Asterisk reports - Resources - Contacts - Assign The Unknown Number by SAM Reports

Resources - Contacts - Assign The Unknown Number


To be able to automate the process you first have to export the caller-ids. Then generate a text file of a specific structure that SAM Reports understands. At the end you just choose the “Import Unknown Numbers” command from the ribbon.

The process:

  1. Export unknown numbers
  2. Generate a  text file with contact information
  3. Import that text file into SAM Reports

To do that you just choose “Export Unknown numbers” command.


Asterisk Reports - Resources - Contacts - Export The Unknown Caller IDs by SAM Reports

Resources - Contacts - Export The Unknown Caller IDs


You have to generate this file yourself, SAM Reports just processes it.The text file has to be a CSV (Comma Separated Values). It is advisable for it to be an UTF8 unicode document, if you do have a need for special characters. For each unknown number (caller-id) that was exported (above), the file has to contain the following five values: country code,  local prefix, phone number, contact name and the original caller-id (the unknown number). All values have to be double-quoted and separated with commas “,”. Individual lines (contacts) have to be separated by CR-LF combo, which is a standard Windows-style line breaking.

Here’s the structure of one line:

  • “Country Code”,
  • “Local Prefix”,
  • “Just the phone part”,
  • “Name”,
  • “caller-ID”


SAM Reports - The Structure Of The Import Contacts File

The Structure Of The Import Contacts File


Now that you have a text file with contact information matched to the unknown numbers, you can import it into SAM Contacts. Just click on that command in the ribbon.


Import Unknown Phone Numbers Into SAM Reports

Import Unknown Phone Numbers Into SAM Reports


One possible scenario:

  • Export the unknown numbers into “Numbers.txt”.
  • Open your CRM  application and feed it the file “Numbers.txt”.
  • Generate “NewNumbers.csv” that matches the form expected by SAM Reports.
  • Import “NewNumbers.csv” into SAM reports.
Clicky Web Analytics