Integrated Normalisation

Introduction

The JSLEE provides a normalisation interface common to all applications that support normalisation. This interface is a utility for modifying numbers based on information provided by the network, both for incoming (“normalisation”) and outgoing (“denormalisation”) scenarios.

To configure a JSLEE service to have normalisation support, add the number-rules configuration section to the application’s JSLEE configuration, e.g.:

{
  "applications": {
    "app1": {
      "configuration": {      
        "number-rules": {
          "enabled": true

The number-rules section can also be inserted into the global configuration, e.g.:

{
  "number-rules": {
    "normalisation": {
      <normalisation rules>
    },
    "denormalisation": [
      <denormalisation rules>
    ]
  },
  "applications": {
    "app1": {
      "configuration": {
        "number-rules": {
          "enabled": true,

Global normalisation configuration will apply to all services, but parameters specified at the service level will override those defined at the global level.

If no number-rules configuration is provided at all or if the enabled flag is either not present or set to false, normalisation will not be active.

Number Rule Types

There are two rule types supported for normalisation:

Either or both rule types may be defined.

Address Natures

All rule types support the following address natures:

Address Plans

All rule types support the following address plans:

Normalisation Rules

Normalisation rules are used to translate numbers recieved from the network into a normalised form, enabling other JSLEE applications to work with a known data format.

Normalisation rules are specified per address nature, and applied for the network-provided nature the in the order that the rules are defined. Once a match is made, no further rules are processed. If no rule is matched, or no rules are defined, the number is unchanged.

Example normalisation rules might be:

    "normalisation": {
      "unknown": [
        { "max-length": 6, "prefix": "64", "remove": 2 }
      ],
      "national": [
        { "prefix": "00", "remove": 2 },
        { "prefix": "0", "remove": 1, "prepend": "64" },
        { "max-length": 6, "prefix": "64", "remove": 2 }
      ],
      "international": [
        { "prefix": "00", "remove": 2 }
      ]
    }

These rules say:

Note that mapping of the protocol-specific address nature to the generalised form is done by the receiving JSLEE application, as set out below. The natures presented and the formats expected are highly network-specific and will differ from site to site.

The following configuration options are available when defining normalisation rules:

Field Type Required? Default Description
prefix String No (empty string) The prefix to match to the received digits. If the prefix does not match, the rule does not apply.
min-length Integer No 0 The minimum length of the received digits. If the received digit string length is shorter, the rule does not apply.
max-length Integer No 0 The maximum length of the received digits. If the received digit string length is longer, the rule does not apply.
alphanumeric Boolean No (not used) Whether the address string contains non-numeric characters. If the outcome does not match, the rule does not apply.
plan String No (not used) The address plan of the received digits. If the received plan does not match, the rule does not apply.
remove Integer No 0 The number of digits to remove from the front of the received digits if the rule applies.
prepend String No (empty string) The digit string to place in front of the received digits if the rule applies.

Rule parameters are processed in the following order:

  1. nature (as part of ruleset selection)
  2. prefix, min-length, max-length, alphanumeric, and plan
  3. remove (if matched)
  4. prepend (if matched)

Denormalisation Rules

Denormalisation rules are used to translate numbers sent from the JSLEE to the network into a network-specific format.

As normalised numbers no longer have an address nature, denormalisation rules are simply applied in order. Once a match is made, no further rules are processed. If no rule is matched, or no rules are defined, the number is unchanged.

Example denormalisation rules might be:

    "denormalisation": [
      { "alphanumeric": true, "nature": "alphanumeric", "plan": "unknown" },
      { "max-length": 6, "nature": "unknown" },
      { "nature": "international" }
    ]

These rules say:

Note that mapping of the generalised address nature to the protocol-specific form is done by the sending JSLEE application, as set out below. The natures presented and the formats sent are highly network-specific and will differ from site to site.

The following configuration options are available when defining denormalisation rules:

Field Type Required? Default Description
prefix String No (empty string) The prefix to match to the outgoing digits. If the prefix does not match, the rule does not apply.
min-length Integer No 0 The minimum length of the outgoing digits. If the outgoing digit string length is shorter, the rule does not apply.
max-length Integer No 0 The maximum length of the outgoing digits. If the outgoing digit string length is longer, the rule does not apply.
remove Integer No 0 The number of digits to remove from the front of the outgoing digits if the rule applies.
alphanumeric Boolean No (not used) Whether the address string contains non-numeric characters. If the outcome does not match, the rule does not apply.
prepend String No (empty string) The digit string to place in front of the outgoing digits if the rule applies.
nature String No international The address nature to use when sending the the outgoing digits if the rule applies.
plan String No e164 The address plan to use when sending the the outgoing digits if the rule applies.

Rule parameters are processed in the following order:

  1. prefix, min-length, and max-length
  2. remove (if matched)
  3. prepend (if matched)
  4. nature and plan (if matched)

Protocol-Specific Mappings

SMPP Mappings

SMPP Type Of Number

The following mappings are made between SMPP TON and generic [address natures](#address-natures:

SMPP TON Generic Nature
Unknown (0) unknown
International (1) international
National (2) national
Network Specific (3) network
Subscriber Number (4) subscriber
Alphanumeric (5) alphanumeric
Abbreviated (6) abbreviated

SMPP Number Plan Indicator

The following mappings are made between SMPP NPI and generic address plans:

SMPP NPI Generic Nature
Unknown (0) unknown
ISDN (E163/E164) (1) e164
Data (X.121 (3) data
Telex (F.69) (4) telex
Land Mobile (E.212) (6) e212
National (8) national
Private (9) private
ERMES (10) ermes
Internet (IP) (14) internet
WAP (18) wap