Configuring workers for Voice Agent Tester

You can create a worker to manage tests. A worker contains the outline of which number to call to run test cases against.

A worker, which contains the following information, manages the tests:

Creating a worker

To create a worker, first create a JSON object and then do a POST request for the JSON object.

You can use the following example to create your JSON object:

Each test case in the following example represents a separate phone call. All test cases run sequentially.

{
    "name" : "payment worker",
    "description" : "This worker tests all flows related to making a payment",
    "namespace":"dev",
    "iterations" : 20,
    "failuresToIgnore": 2,
    "callDefinition": {
      "tenantId":"17873345644",
      "to": "sip:testee@someplace",
      "from": "sip:tester@someplace",
      "tenantConfig":{
        "config":{
          "tenantURI":"sip:someone@someplace.com"
        },
        "updateMethod":"merge"
      },
      "route":["sipSomewhere"]
    },
    "cases" : [
        {"caseId": "guid"},
        {"caseId": "guid"},
        {"caseId": "guid"}
    ]
}

The following table describes the properties for the JSON object:

Table 1. Properties for the JSON object
Property Description
name Specifies the name of the worker
description Optionally specifies a more detailed description of the worker
namespace Optionally specifies a group to which a test case is bound. If no namespace is specified, the namespace is default.
iterations Specifies the number of times that the worker runs all the test cases. When you set the value to 0, the worker runs a never ending job. When you run with a value of 0, modify the job to stop or pause the worker.
callDefinition Specifies the definition of how the outbound call is started. The "tenantId" URI is the URI of the tenant that starts the outbound call. The key-value pairs for the outbound call body require to and from values, but they also accept values of tenantConfig and route. For more information, see Making outbound calls using REST API.
failuresToIgnore Optionally specifies the number of failures to ignore before the job fails. If the property isn't defined, the job runs to completion no matter how many failures it has.
cases Specifies a list of test case IDs to run for a single iteration.

Next, create the worker by entering a POST request for the JSON object that you created in the previous sub-step.

Use the following example:

POST /voice-agent-tester/v1/worker

If the POST request is successful, a 201 CREATED response is returned. This response includes the GUID of the worker that you created. You use the GUID to manage the worker.

Additional requests to manage workers

The following table describes additional properties for the JSON object:

Table 4. Additional properties for the JSON object
Property Description
id Specifies the GUID for the worker
rev Specifies the current version of the worker
jobs Specifies an array of jobs started by the worker
batchjobs Specifies an arrray of batch jobs started by the worker