TON and NPI Settings for SMPP and UCP/EMI

Posted by on Jan 22, 2009 in Support Blog

Topic Keywords: , ,

One of the most confusing issues involved in setting up an SMSC connection is when your SMS service provider requires specific TON (type of number) and NPI (numbering plan identification) values.

In the majority of cases, you can ignore any requirements that your provider has for these settings, because NowSMS uses intelligent default values.

For SMPP environments, these are the rules that NowSMS follows for setting the source_addr_ton and source_addr_npi values (e.g., TON and NPI for the sender address):

If the sender address is alphanumeric (contains both letters and numbers) or non-numeric, TON is set to 5 and NPI to 0.

If the sender address is a short code, TON is set to 3, and NPI is set to 0. (By default, a number is considered to be a short code if the length of the number is 5 digts or less. You can change this length setting by editing SMSGW.INI, and under the [SMSGW] header specifying MaxSMPPShortCodeLen=#, where # is the max length of a short code.)

If the sender starts with a “+”, TON is set to 1, and NPI is set to 1.

If none of the above conditions is met, TON is set to 0 and NPI is set to 1 (unless the sender is blank, in which case both are set to 0).

For setting the destination TON and NPI (dest_addr_ton and dest_addr_npi), only the condition of whether or not the recipient phone number starts with the international prefix of “+” is considered.

If the recipient starts with a “+”, TON is set to 1, and NPI is set to 1.

Otherwise, TON is set to 0 and NPI is set to 1.

What do these values mean anyway, and why are they important?

Basically, they tell the SMSC how to interpret the address. The SMPP specification defines the following TON values:

Unknown = 0
International = 1
National = 2
Network Specific = 3
Subscriber Number = 4
Alphanumeric = 5
Abbreviated = 6

These definitions are derived from the ETSI GSM 03.40 specification, which defines the SMS protocol.

The only unusual observation that might be made regarding NowSMS defaults is that if a number is expressed without a “+” sign, NowSMS defaults to using a TON value of 0, or unknown. While this may seem unusual, it actually makes sense because NowSMS is telling the SMSC that the SMSC should use its own internal rules for making a determination of the number type.

Possible NPI values are defines as follows:

Unknown = 0
ISDN/telephone numbering plan (E163/E164) = 1
Data numbering plan (X.121) = 3
Telex numbering plan (F.69) = 4
Land Mobile (E.212) =6
National numbering plan = 8
Private numbering plan = 9
ERMES numbering plan (ETSI DE/PS 3 01-3) = 10
Internet (IP) = 13
WAP Client Id (to be defined by WAP Forum) = 18

So, generally speaking, 1 is the correct value. If the sender address is alphanumeric or shortcode, NowSMS uses 0 (it might also be argued that a short code could be considered part of a private numbering plan, but convention seems to expect a value of 0).

If the default TON and NPI settings for NowSMS are not appropriate for your environment, it is is possible to configure these settings under the “Advanced Settings” option in the “Properties” for an SMPP connection.

NowSMS allows the Source and Destination TON and NPI values to be hardcoded via these settings.

Additionally, SMPP has a concept of a Bind TON and NPI, which is addr_ton and addr_npi values that are sent as part of the bind operation during which NowSMS initially binds/connects to the SMS service provider. These values would normally only be used if the provider requires an address_range parameter for specifying the numbers for which you are receiving messages. If your provider requires specific bind addr_ton, addr_npi and/or address_range parameters, then they should be configured in the “Properties” of the SMPP connection definition within NowSMS.

What about UCP/EMI environments?

Well, the UCP/EMI protocol also defines TON and NPI parameters.

However, while SMPP uses the same TON and NPI parameter values as used in the actual SMS specifications, UCP/EMI uses different values.

In the UCP bind (e.g., connect or login), there are OTON and ONPI (originator TON and NPI) values that are specified. NowSMS is hard coded to use values of OTON=6 and ONPI=5. (We’ve yet to see a situation that required these values to be configurable.)

TON and NPI values are not specified for sender (source/originator) and recipient (destination) addresses, like they are in SMPP environments. Instead, UCP/EMI has a concept of a OTOA (orignator type of address) parameter which has a similar purpose. When setting the OTOA value, NowSMS sets the value appropriately to indicate whether the sender address is alphanumeric, international (starts with “+”), or numeric.

For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...

2 Responses to “TON and NPI Settings for SMPP and UCP/EMI”

  1. I see you have a number 18 listing for NPI
    NPI has only 4 bits, so 15 if counting from 0 and 16 if counting from 1

    –rio
    riodice@computer.org

  2. Brett Warthen says:

    That's an interesting observation.

    The 18 value was extracted from the SMPP v3.4 specification.

    But you are correct, in the actual GSM 03.40 specification, the NPI field is only 16 bits.

    Of course, why anyone would need to use most of these strange NPI values remains a mystery.