Skip to content

Use correct TON and NPI from Jasmin Interceptor #4

@cypherlou

Description

@cypherlou

Background

I've been compelled to add an mtinterceptor to Jasmin to support a sensitive SMPP gateway. The requirement is broadly to define a TON and NPI as follows;

  1. short code with a ton=2 and npi=1
  2. long code awith a ton=1 and npi=1
  3. text overwrite (alphanumeric source address) with a ton=5 and npi=0

In the last example I have;

    routable.pdu.params['source_addr_ton'] = AddrTon.ALPHANUMERIC
    routable.pdu.params['source_addr_npi'] = AddrNpi.UNKNOWN

The problem

As things stand the TON values defined in smpp/pdu/constants.py (using the NPI as the example), as seen from the Jasmin Interceptor - list(AddrNPI) are;

[
 <AddrNpi.UNKNOWN: 1>
 <AddrNpi.ISDN: 2>,
 <AddrNpi.DATA: 3>,
 <AddrNpi.TELEX: 4>,
 <AddrNpi.LAND_MOBILE: 5>,
 <AddrNpi.NATIONAL: 6>,
 <AddrNpi.PRIVATE: 7>,
 <AddrNpi.ERMES: 8>,
 <AddrNpi.INTERNET: 9>,
 <AddrNpi.WAP_CLIENT_ID: 10>
]

This obviously doesn't match the corresponding values defined in smpp/pdu/constants.py;

addr_npi_name_map = {
    'UNKNOWN': 0x00,
    'ISDN': 0x01,
    'DATA': 0x03,
    'TELEX': 0x04,
    'LAND_MOBILE': 0x06,
    'NATIONAL': 0x08,
    'PRIVATE': 0x09,
    'ERMES': 0x0a,
    'INTERNET': 0x0e,
    'WAP_CLIENT_ID': 0x12,
}

The values (as seen form the Jasmin Interceptor) as defined as the order of the entry in the dict and not the actual value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions