PBX Information

Uniloader is able to read and display PBX information; this is useful both for debugging/inspecting a remote system, and pushing a ready-made configuration to a QueueMetrics instance, so that you can automatically keep it in sync with the underlying PBX.

FreePBX

If you connect to the MySQL database of a FreePBX instance with:

uniloader pbxinfo freepbx --dburi 10.10.5.27/asterisk --login myuser --pwd mypass

You get a screen print-out of the status of the system, with an added queue "00 All".

=  Tenant # 1:

-- Queues found: 6
   #            Code            Name                       Ext.Ref.
   1           00all          00 All
   2             300         Support
   3             301           Sales
   4             307      Some queue
   5             400          Recall
   6             401   Queue timeout

-- Agents found: 15

   #            Code            Name                       Ext.Ref.
   1       Agent/200             200
   2       Agent/201             201
   3       Agent/202             Joe
   4       Agent/203            Mick
   5       Agent/204             Gru
   6       Agent/205             205
   7       Agent/210             210
   8       Agent/211             211
   9       Agent/220             220
  10       Agent/221             221
  11       Agent/240             240
  12       Agent/241             241
  13       Agent/242             242
  14       Agent/250             250
  15       Agent/251             251

This configuration can be uploaded to QueueMetrics in one go - see Uploading configuration to a QueueMetrics instance

Issabel

If you connect to the MySQL database of an Issabel PBX with:

uniloader pbxinfo issabel --dburi 10.10.5.27/asterisk --login myuser --pwd mypass

You get a screen print-out of the status of the system, with an added queue "00 All".

=  Tenant # 1:

-- Queues found: 2
| # | CODE  |   NAME    | EXT REF  |
+---+-------+-----------+----------+
| 1 | 00all | 00 All    |          |
| 2 |   301 | Queue 301 |          |

-- Agents found: 1

| # |   CODE    | NAME | EXT REF  |
+---+-----------+------+----------+
| 1 | Agent/400 |  400 |          |

This configuration can be uploaded to QueueMetrics in one go - see Uploading configuration to a QueueMetrics instance.

As agents do not have a specific role, in order to upload agents we create an agent for each SIP extension.

FusionPBX

It is possible to get a list of agents and queues configured in 'mod_callcenter' on a FusionPBX instance, by accessing the database directly.

By running:

uniloader pbxinfo fusionpbx --ps-uri 10.10.5.182/fusionpbx

You get a list of all agents and queues, divided by tenant:

=  Tenant # 1: mycustomer1.mypbx

-- Queues found: 1
   #          Code           Name                       Ext.Ref.
   1          300            q300    75082016-6394-4738-b896-b9121c060612

-- Agents found: 1

   #    Code                 Name                       Ext.Ref.
   1    Agent/200             200    739a4112-d755-4977-bf2b-d2b9037babd0

The complete syntax is:

# uniloader pbxinfo fusionpbx -?

NAME:
   uniloader pbxinfo fusionpbx - Gets information on a FusionPBX instance

USAGE:
   uniloader pbxinfo fusionpbx [command options] [arguments...]

DESCRIPTION:
   Downloads FusionPBX settings.

It connects to the Postgres database and downloads
agents and queues as currently defined.

OPTIONS:
   --ps-uri value         A Postgres database to connect to (default: "localhost/fusionpbx")
   --ps-login value       A database user (default: "fusionpbx")
   --ps-pwd value         A database password [$FUSIONPWD]
   --single-tenant value  If you specify a domain (tenant), only that tenant will be read.
   --as-tenant value      In single-tenant mode, the ID for this tenant. Can be set as ''.

The flag single-tenant is useful when you have a multi-tenant system that feeds different QueueMetrics system, and you want the configuration of only one tenant to be sent to one specific system for autoconfiguration (see below). It can be useful to use it together with the flag --as-tenant '' so that when pushing a single tenant’s data to a QueueMetrics instance, the tenant’s code is not sent and QueueMetrics behaves as-if it was a totally separate system.

Uploading configuration to a QueueMetrics instance

It is possible to upload the configuration just read to a QueueMetrics instance in one go.

If you enable the user `robot`in QueueMetrics (that always exists, but is disabled by default), you can run:

uniloader pbxinfo --mode syncqm \
                  --uri http://127.0.0.1:8080/queuemetrics --login robot --pass robot --with-password 123 \
          freepbx --dburi 10.10.5.27/asterisk --login  --pwd pippo

Will print out:

2019/04/02 09:16:53 Connecting to QueueMetrics at http://127.0.0.1:8080/queuemetrics (user: robot pass: *****)
2019/04/02 09:16:53 Transaction Results: okay - Entries: 35 created / 0 deleted / 1 updated

And send the current configuration to QueueMetrics.

Useful flags are:

  • --with-password: users are created with a default password you specify. If not, they will be created with a random password, so in order to use them the QueueMetrics administrator will have to change their password manually

  • --all-queues: if set to 1, a queue called 00 All, of which all agents are known members, will be created. This is the default. Set to 0 to disable.

Integrics Enswitch

You can connect to an Integrics Enswitch system (v3.14+) through its HTTP APIs, in order to:

  • verify that your credentials are valid

  • generate the correct KNumber to create QueueMetrics-Live instance over its APIs

  • generate or inspectt an automatic configuration for a tenant

You can run with or without a Customer ID; if you run without, it tries determining it on its own.

uniloader pbxinfo enswitch
          --uri https://www.my.pbx --login qm@cli --pwd ab1234

or

uniloader pbxinfo enswitch
          --uri https://www.my.pbx --login qm@cli --pwd ab1234
          --single-tenant 123

You get a screen print-out of the status of the system, with an added queue "00 All". The Tenant field is the numeric value of your Enswitch customer-id.

2021/03/31 18:19:40 ** API configuration: esw/https://www.my.pbx qm ab1234 123 **

=  Tenant # 1: 123

-- Queues found: 2
| # |      CODE       |      NAME       | EXT REF  |
+---+-----------------+-----------------+----------+
| 1 | 00all           | 00 All          |          |
| 2 | myqueue         | My Super Queue  |          |

-- Agents found: 1

| #  |     CODE      |              NAME              | EXT REF  |
+----+---------------+--------------------------------+----------+
|  1 | Agent/18408   | John Doe (18408)               |          |

This configuration can be uploaded to QueueMetrics in one go - see Uploading configuration to a QueueMetrics instance

Once you know that your credentials are correct, you can test that they are valid to download data through the sub-command test enswitch.

3CX

3CX support is experimental.

You can read queues, ring groups and agents from a 3CX PBX through its API, as uniloader 3cx does. It uses the same credentials: the client ID and the client secret of an API application - see 3CX support for how to create one.

uniloader pbxinfo 3cx \
          --url https://pbx.example.com --client-id uniloader --client-secret ab1234

The client secret can also be supplied through the PBX3CX_PWD environment variable, to keep it out of your shell history.

You get a screen print-out of the status of the system, with an added queue "00 All":

2026/09/22 19:56:22 Reading 3CX at https://pbx.example.com (client: 'uniloader' secret: '******')

=  Tenant # 1:

-- Queues found: 10
| #  |    CODE    |         NAME         | EXT . REF . |
+----+------------+----------------------+-------------+
| 1  | 00all      | 00 All               |             |
| 2  | 800        | Sales                |             |
| 3  | 800-QCB    | Callback for Sales   |             |
| 4  | 801        | Support              |             |
| 5  | 801-QCB    | Callback for Support |             |
| 6  | 850        | Front desk (R/G)     |             |
| 7  | _IVR       | IVR                  |             |
| 8  | _DIRECT    | Direct calls         |             |
| 9  | _OUTBOUND  | Outbound calls       |             |
| 10 | _VOICEMAIL | Voicemail            |             |

-- Agents found: 3

| # |   CODE    |     NAME     | EXT . REF . |
+---+-----------+--------------+-------------+
| 1 | Agent/103 | Rino Bianchi |             |
| 2 | Agent/104 | Luca Rossi   |             |
| 3 | Agent/105 | Lenz Verdi   |             |

What is read from the PBX:

  • every user becomes an agent, whether it is a member of a queue or not. Its code is Agent/ plus its extension - the same code that uniloader 3cx writes in the queue_log - its name is the first and last name of the user, and its e-mail address is taken from the user’s own, so that QueueMetrics can send reports to it;

  • every queue becomes a queue, named as on the PBX, and the agents that are members of it are set as its known agents;

  • every queue also gets its callback queue, e.g. 800-QCB, described as Callback for <name> and with no known agents: it is where uniloader 3cx writes the search for an agent to serve a callback;

  • every ring group becomes a queue too, with its members as known agents: uniloader 3cx tracks ring groups as queues, named after their number. Its description is its name followed by (R/G), e.g. Front desk (R/G), so that it can be told from a queue;

  • when the queue 00 All is created (--all-queues, on by default), the queues on which uniloader 3cx writes calls that are not in any 3CX queue are created as well, with no known agents: _IVR, _DIRECT, _OUTBOUND and _VOICEMAIL.

As 3CX has one tenant only, the Tenant field stays empty.

This configuration can be uploaded to QueueMetrics in one go - see Uploading configuration to a QueueMetrics instance

If the connection fails, or queues and agents come up empty, check the credentials and the permissions of the API application with the sub-command test 3cx.