Location Routing

Location Routing

The LocationRouting operation selects an exit according to the best-matching geography set entry for the contents of a specified source buffer.

The LocationRouting operation is similar to the Calling Party operation, with the difference being that LocationRouting operation prefixes are externally-defined (i.e. in a geography set) and hierarchical. Also, the LocationRouting operation can use different matching sources.

A geography set often represents a hierarchical tree of geographic regions, with each level of the tree defining a smaller region than the higher node in the tree. The leaves in the tree may represent any data including telephone number prefixes, postcodes, mobile locations etc.

For example:

New Zealand
  -> North Island
    -> 04
    -> 06
    -> 07
    -> 09
  -> South Island
    -> 03

The above example represents New Zealand (denormalised) landline telephone numbers.

When configuring a LocationRouting operation, only the entries that are of interest need to be explicitly mapped. These entries may be at any level within the geography set hierarchy.

To continue the above example, to route calls based on whether the caller is calling from Auckland or the rest of the North Island, a LocationRouting operation would be configured with the “Calling Party Number” as source buffer, and need only map the 09 (Auckland) and North Island entries. A caller from Auckland would best-match the 09 entry rather than the North Island entry and be routed accordingly. A caller from any other part of the North Island would best-match either the 04, 06, or 07 entries. Because none of those entries are mapped, the call would be routed according to the closest mapped North Island entry. Callers from any other locations would be routed via the default exit.

The LocationRouting operation must have at least one exit. The LocationRouting operation is only useful when it has more than one exit, although this is not enforced by the operation definition.

Config Parameters

The LocationRouting operation config attributes are as follows.

Parameter Type Description
source_buffer User Buffer [Required] The identifier for a User Buffer configured in the platform configuration (e.g. Calling Party Number).
The contents of this buffer will be used to best-match the contents of the geography set.
geography_set String [Required] The name of a geography set owned by (or accessible to) the same customer that owns the service and flow.
This set must contain all of the geographic entries referenced within the operation rules.
geography_set_customer_name String [Required] The name of the customer that owns geography_set.
rules Array of
Object
The rules Array must contain zero or more Objects.
default_exit_idx Integer [Required] The zero-based index number of the exit to use as the default exit.

Config Rules

The attributes for each LocationRouting operation rules Object are as follows.

Parameter Type Description
geographic_entry String [Required] The name of a geographic entry at any level of the geography_set hierarchy.
exit_idx Integer [Required] The zero-based index number of the exit to select when the source buffer best-matches the prefix associated with geography_entry, or geography_entry is the closest mapped ancestor for the best-matched geography entry prefix.

Example Operation

Here is an example LocationRouting operation in JSON representation.

    {
        "id": 2,
        "type": "LocationRouting",
        "config": {
            "source_buffer": "Calling Party Number",
            "geography_set": "Telephone Numbers",
            "geography_set_customer_name": "Main Customer",
            "default_exit_idx": 1,
            "rules": [
                {
                    "geography_entry": "Bay Of Plenty",
                    "exit_idx": 0,
                }
            ]
        },
        "exits": [ 3, 4 ]
    }

In this example, calls for which the Calling Party Number best-matches a prefix anywhere below the Bay Of Plenty entry in the Telephone Numbers geography set (i.e. calls from the Bay Of Plenty area) will be routed via exit index 0 to the operation with ID 3. All other calls will be routed via the default exit index 1 to the operation with ID 4.

Exits

The default exit is explicitly specified using the default_exit_idx configuration field.

Exit Index Name Description
0 Exit #1 [Required] All LocationRouting operations must have at least one exit.
1 Exit #2 + Additional exits may be present.