Agents

Introduction

Any user in the system can be considered as an “agent”, which means that he/she can be assigned to incoming calls based on a assignment strategy and skills. In addition, agents can have “skills” as introduced below.

Agent setup

First of all, it is necessary to register a user in the WAC. Then, it is necessary to identify that user as an agent calling the ‘Create agent’ API request. In other words, agents are just regular users that have been granted with the “agent” feature. This is made via a POST call to the REST API endpoint https://your-wac-server/sapi/agentSkills/agents.

Skills

Skills are abilities or characteristics that may be of interest to define which reduced set of agents is a candidate to receive a call. An example of a skill could be identifying which languages each agent speaks. In this way, when the caller initiates the call, he can indicate in which language he speaks and the candidates to receive that call will only be agents who have the ability to speak the same language.

To manage the skills, there are a group of endpoints that allow us to create or delete a skill, consult the available skills, assign or unassign a skill to an agent. Please check the REST API reference for more information.

Agent assignation

The “Agent assigner” attends requests from any source and provides a valid agent as a response following some allocation method. Two different assignation mechanisms are currently supported:

  • system agent assignation: will assign the first available agent, that is, the first agent connected to the system whose presence is ‘unknown’ or ‘available’.

  • external agent assignation: will delegate the agent assignation to a third-party REST API. A POST request will be made against a previously configured endpoint.

One, and only one, of these mechanisms, could be used at a given time. The resolution method is specified by the administration in the configuration as described below.

The request made from the client to the backend needs to have the following format:

{
     channelId: string;
     channelType: string;
     context: object;
     skill?: string;
     token?: string;
}

with the following meaning:

  • channelId: unique identifier for the resource being assigned (roomId, conferenceId, etc);

  • channelType: one of the following chat,``voice``, c2c;

  • context: any arbitrary unknown object intended for usage by the third party assigner that manages the REST API.

  • skill (optional): string used to filter which agents can receive the call. Skills must be defined via ‘Create AgentSkill’ API request

  • token (optional): any arbitrary string used for the external agent assignation

There are an existance implementation in our c2c product.

Please note that, in order to be able to call an agent, she needs to be online (presence online: true and activity: available or activity: unknown).

Service Configuration

To enable the service the service, this initialization block needs to be added to``wac.ini`` file. .. code-block:: ruby

[agentassigner]

Note

It is required to activate the PresenceService as well, since it isn’t loaded by default as the core services.

External assignation

The mapping service type is configured in config/agentassigner.toml file:

[agentassigner]
externalAssignerUrl = "url of the external assigner endpoint"

The request to the externalAssignerUrl will receive a HTTP POST call with the following body:

{
     channelId: string;
     channelType: string;
     context: object;
     skill?: string;
     token?: string;
}

The response of the externalAssignerUrl must have the following body: {agentId: string}, where agentId will be the identifier of the assigned agent in the WAC. Please note that, for a user to be considered an agent with an external allocation method, it is enough that he/his is registered in the WAC.

Internal assignation

If the config/agentassigner.toml does not exist, is empty or contains an empty agentassigner section the internal agent assigner will be used. It is possible to define an agent assignment strategy in the mentioned file as follows:

[agentassigner]
strategy? = 'random' | 'linear'
  • strategy(optional) : By default it will be ‘linear’ in case the parameter has not been defined.

    • Linear: Gets the first agent among those available.

    • Random: Randomly obtains an agent among those available.

Logs: known log messages

Level

Message

Silly

Agents obtained: ${users}

Error

An error ocurred while resolving agent

Debug

Message received: ${message}

Debug

Trying to obtain agent

Debug

Trying to obtain agents

Debug

Available agent found: ${agents[0]}

Debug

Checking if ${agent.id} is available

Debug

Getting presence for user ${userId}

Info

Resolved agent ${agent}

Info

Agent assigner configured with external assigner at: ${externalAssignerUrl}

Info

Agent assigner will use system assigner

Troubleshooting & caveats

It is not possible to ensure that the response is deterministic. The assignable user offered as return depends on a bulk request, results are not ordered, so “the first user on the array” do not always correspond with the same user.