Chapter 5. QmPushCfgService

This service allows the user to push an existing QueueMetrics configuration on to the current QM configuration.

A QueueMetrics configuration can be easily represented using a JSON file, by posting the file to the service (i.e. by using a curl request), QM will apply the configuration to the system.

This service makes use of the Synchronizer service of QueueMetrics. From the "Explore System Parameters" page in queuemetrics, various modes can be selected for the Synchronizer service.

By selecting the default mode in the "Explore System Parameters" page, the QmPushCfgService service’s behaviour will change.

The different selectable modes are a list of combinations of the following four permissions:

When creating users, the user’s passwords will be dictated by the "user_password" field of the agents object in the JSON configuration file. This is because the user creation function will create matching users for each created agent, if the correct permissions are given by selecting the appropriate mode.

If an agent definition in the configuration file has an empty or missing user_password field, the given password will be dicatated by the synchronizer.default_password parameter. If this parameter is not set, thew password will be generated randomly as a string of 40 characters.

This is an example of a valid curl request:

curl  --user robot:robot -i -H  -X POST
      "http://localhost:8080/QueueMetrics/QmPushCfgService/jsonStatsApi.do?"
      --data-urlencode data@newcfg.json

This is an example of a valid JSON configuration file:

{
       "version":"1.0.0",

       "requestor":"FreePbx",

       "requestor_version":"13.xx.yy",

        "tenants": [{

                "tenant_id":"",

                "agents": [{

                                "agent_id":"Agent/101",

                                "agent_name":"Mike Boom",

                                "agent_aliases": [],

                                "agent_extension":"",

                                "user_password":"999"

                        },
                        {

                                "agent_id":"Agent/102",

                                "agent_name":"John Doe",

                                "agent_aliases": [
                                        "xyx",
                                        "nuovo"
                                ],

                                "agent_extension":"103",

                                "user_password":"999"

                        }

                ],

                "queues": [{

                                "queue_id":"300",

                                "queue_name":"Sales (300)",

                                "queue_composition":"300",

                                "queue_wrapup": 0,

                                "queue_inbound": true,

                                "known_agents": [{

                                                "agent_id":"Agent/101",

                                                "agent_penalty": 1,

                                                "agent_dynamic": false
                                        },
                                        {

                                                "agent_id":"Agent/102",

                                                "agent_penalty": 0,

                                                "agent_dynamic": false
                                        }

                                ]

                        },
                        {

                                "queue_id":"3000",

                                "queue_name":"Sales (3000)",

                             "queue_composition":"3000",

                                "queue_wrapup": 0,

                                "queue_inbound": true,

                                "known_agents": [{

                                                "agent_id":"Agent/101",

                                                "agent_penalty": 1,

                                                "agent_dynamic": false
                                        },
                                        {

                                                "agent_id":"Agent/102",

                                                "agent_penalty": 0,

                                                "agent_dynamic": false
                                        }

                                ]

                        }

                ]

        }

        ]
}