This document is intended for developers implementing an HTTP endpoint responding to SmartRouting requests, providing routing instructions for Enreach Core.

Example Smartrouting scenario

External CRM system holds information of VIP customers. When VIP customer calls to service, calls should be routed to a separate ‘VIP service queue’, which has higher priority than the normal service queue. If the caller is not recognized as a VIP, the call will be handled in a normal service queue.

Endpoint requirements

SmartRouting Request

POST /your-path
X-Benemen-APIKey: 1234
Content-Type: application/json

{ "anum": "+358501231234", "bnum": "+4612312345", "targetid": "SALES_QUEUE" }

SmartRouting Request Extra Data

It is possible to configure the core to send various extra data. The extra data will be sent in sub key “extradata” as JSON dictionary.

This example shows the default values (there is also an extended set for special cases) as well as two dynamically configured parameters (the key name starts with “DYN_”).

{
    "anum": "+358501231234", 
    "bnum": "+4612312345", 
    "targetid: "SALES_QUEUE"
    "extradata": {
        "CallId": "d59d7a2f-318a-469e-bdc0-b092a8fedbc1",
        "LegId": "66299cde606b3db6d413cd208f7e5cab@45.66.192.196_br1",
        "CurrQueueId": "1a89fc22-517a-e611-80c9-00505689257e",
        "CurrUserId": "",
        "IsInternalCaller": false,
        "DYN_PAR_Culture": "en-GB",
        "DYN_PAR_Something": "SOMETHING"
    }
}

SmartRouting Response

Response body properties

Key

Type

Values

Description

InitialTarget

string

<any-target>/DISCONNECT:

  • Forward the call to another location (queue, user) for handling or disconnet the call

  • To disconnect call, return “DISCONNECT:”

  • If empty, no direct forwarding is performed

FailTarget

string

<any-target>

  • If the call would overflow from the initial target, override the default target with this

  • For example, if initial target is user and they do not answer, redirect to some specific queue

RequiredTarget

string

<user-target>

  • Primary agent who is required to be present in the targeted queue to handle the call

  • If the agent is currently unavailable, but potentially becomes available within the timeout period (10 seconds default), the caller waits until the timeout expires

    • E.g. if the agent is currently in a call, they might just be able to take the next call

  • Only applies if InitialTarget is a queue

AllocationTargets

List<string>

List of <user-target>

  • Agents that should be preferred in allocation

  • Non-blocking - if the agents are not available, other agents are chosen instead

  • Only applies if InitialTarget is a queue

Priority

int

Integer from 0 to 10000

  • Priority for the call (e.g for VIP customers). Bigger value is better: makes the call that many seconds "older" in allocation processing.

  • Setting this value overrides the default priority configured for the queues. Only set this if you really want to override and do have the values coordinated with queue configurations.

ExtraPriority

int

Integer from -10000 to 10000

  • Extra priority for the call (e.g for VIP customers). Bigger value is better: makes the call that many seconds "older" in allocation processing.

  • This is the new preferred way of boosting (or reducing) call priority without overriding the priority set by the routing core, typically with service queue configuration. Both priorities are added for the composite priority value.

CustomTTS

string

TTS prompt definition.

  • Advanced. When this value is provided the TTS prompt is played forcibly as the next transfer or mandatory prompt. Must be orchestrated with the other configuration!

  • Language can be specified by .NET Culture code in bracets

CustomMSI

string

MSI (dynamic billing) configuration.

<MSI tag>,<validFor>[,<action>,<re-entrant>]

  • Advanced: This value must orchestraded with other MSI configuration. See separate documentation.

Example responses

Example response: Route to a specific queue

{
  "InitialTarget": "+3581012345"
}

Example response: Play text-to-speech message to caller in English and in Finnish, then route to specific queue by QueueId

{
  "InitialTarget": "cd1258fb-0aae-4159-ba9e-41c57c69c398"
  "CustomTTS": "[en-GB] Greetings caller. [fi-FI] Tervehdys soittaja"
}

Example response: Play Text-to-speech message to the caller, then disconnect the call

{
  "InitialTarget": "DISCONNECT:"
  "CustomTTS": "This call will be disconnected, sorry about that"
}

Example response: Route to a specific queue and require a specific agent to handle the call

{
  "InitialTarget":"+3581012345",
  "RequiredTarget":"john.smith@customer.com"
}

Example response: Route to a specific queue, have one of the preferred agents handle the call

{
  "InitialTarget": "+3336666666",
  "AllocationTargets": [
    "agent1@customer.com", 
    "agent2@customer.com"
  ]
}

Example response: Make the call high priority overriding priority set in Queue

{
  "Priority": 10000
}

Example response: Make the call high priority by setting call-specific ExtraPriority

Priority of the call is QueuePrioirty + ExtraPrioirty

{
  "ExtraPriority": 100
}