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 called00 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. |