Routing
MT SMS routing in SMPP Router is determined by a combination of an ESME’s assigned target set and optional routing rules defined using routes-mt
. For SMPP Router operating details, refer to the Operation section.
ESME target set
Each ESME can be assigned a shared target set using the sharedtargetsetid
field. If no routing rules exist, all MT SMS submitted by that ESME are routed and load-balanced across the targets defined in that target set. This behaviour applies regardless of the destination address.
Routing rules: routes-mt
Where MT SMS should be routed to particular targets based on destination address, you can define routing rules using routes-mt
. These rules may be declared globally (affecting all ESMEs) or within a specific ESME’s configuration (overriding global rules).
Global routes-mt (applies to all ESMEs)
{
"base": ...,
"esme": ...,
"routes-mt": [
{
"criteria": {
"match": "destination", "type": "country", "value": "44"
},
"targetset": "0001"
},
{
"criteria": {
"match": "destination", "type": "regex", "value": "^4917"
},
"targetset": "0003"
}
],
"targetsets": ...
}
Above example shows:
Route all traffic for country prefix 44 (i.e. United Kingdom) to target set 0001.
Route all traffic for mobile numbers starting 4917 to target set 0003.
ESME-specific routes-mt (applies only to that ESME)
{
"base": ...,
"esme": [
{
"systemid": "esme001",
"password": "xyz",
"sharedtargetsetid": "0001",
"routes-mt": [
{
"criteria": {"match": "destination", "type": "ndc", "value": "447700"},
"targetset": "0001"
},
{
"criteria": {"match": "destination", "type": "country", "value": "33"},
"targetset": "0002"
},
{
"lcrmap": {
"match": "destination",
"type": "mnc",
"map": [
{
"targetset": "ts003",
"coverage": [
{
"key": "23434",
"cost": 0.03
},
{
"key": "23433",
"cost": 0.03
}
]
},
{
"targetset": "ts004",
"coverage": [
{
"key": "23434",
"cost": 0.04
},
{
"key": "23433",
"cost": 0.02
}
]
},
{
"targetset": "ts001",
"coverage": [
{
"key": "23434",
"cost": 0.04
},
{
"key": "23433",
"cost": 0.05,
"ignore": false
}
]
}
]
}
}
]
}
],
"routes-mt": ...,
"targetsets": ...
}
Above example shows:
If destination NDC is 447700, use target set 0001.
If destination country code is 33 (France), use target set 0002.
LCR Map - least-cost routing based on Mobile Network Code (MNC):
Route to ts003 for 23434 (0.03 cost)
Route to ts004 for 23433 (0.02 cost)
Matches destination keys like 23434, 23433.
Selects the target set (ts003, ts004, or ts001) with the lowest cost for each key.
An ESME’s sharedtargetsetid
entry will be where MT SMS are routed to unless there are routes-mt
rules with criteria that are true. The global routes-mt
will first be processed to determine a target set. The ESME’s routes-mt
will then be processed, even if a target set was found in the global routes-mt
.
How routing is evaluated
The following order of precedence is used for selecting a target set:
ESME
routes-mt
rulesGlobal
routes-mt
rulesESME
sharedtargetsetid
definition (default)
Anatomy of routes-mt rule
Each entry in routes-mt
is either:
a
criteria-targetset
to set a target set based on criteria, oran
lcrmap
(least-cost routing map) that selects a target set based on the cost associated with the target set and a key (e.g. MCC-MNC).
Criteria-targetset
Each criteria-targetset
entry in routes-mt
has a criteria
object and a target set (targetset
). The criteria
object contains the field on which to match
, the type
of match and the value
. If the result of the criteria is true, the message will be routed to the specified targetset
.
Example
{
"criteria": {
"match": "destination",
"type": "regex",
"value": "^4917"
},
"targetset": "0003"
}
In the above example, the match is done on the destination address field of the ESME’s SubmitSM. The type of match specifies using a regular expression (regex
). The value to match against is the regular expression ^4917
. The means that traffic will be routed to target set 0003
if the destination address of the SubmitSM begins with the digits 4917
.
Criteria matching reference
The type of match will depend on the field specified in match
.
Match | Type | Example value | Description |
---|---|---|---|
|
|
Destination address is | Exact match on full destination address. |
|
Country digits of destination address are | Match on country code portion of destination address. | |
|
Country and NDC of destination address are | Match on country code + NDC digits. | |
|
Destination address is in the range 447720300100-447720300199. | Regular expression match on destination digits. | |
|
Following a look-up, the destination address belongs to MNO with MCC | Match on MCC of destination following look-up. | |
|
Following a look-up, the destination address belongs to MNO with MCC-MNC | Match on MNC of destination following look-up. | |
|
|
Source address is | Exact match on source address. |
|
Source address ends with | Regular expression match on characters in source. |