ENUM Integration Manual

In this article, you can learn more about how to use the Infobip ENUM interface for HLR lookups.

Connectivity

To enable connectivity between the Infobip ENUM interface and Client system, the client needs to provide a list of IP addresses which will be whitelisted in the Infobip ENUM system.

ENUM Query Packet

There are requirements that each ENUM query must fulfill, so QTYPE in the ENUM query must be NAPTR and there are additional restrictions to ENUM query parameters that must be compiled so that the query is not rejected by the ENUM server.

ENUM Query Packet Format

ENUM Integration Manual - ENUM query packet

The HEADER Section of ENUM Query Packet

The HEADER section of ENUM query packet

  1. QR bit must be set to 0 representing DNS query.
  2. Opcode must be 0 representing a standard DNS query.
  3. It is only possible to make one ENUM query per DNS packet. Therefore, QDCOUNT value must be 1.
  4. ANCOUNTNSCOUNT, and ARCOUNT must be 0.

QUESTION section of ENUM query packet

QUESTION section of ENUM query packet

  1. QNAME must be as specified in RFC 3761. It is a E.164 number on which first a well-known rule is applied with a mandatory appended Infobip ENUM root (e.g., +442079460148 after applying first a well-known rule and appending the Infobip ENUM root 8.4.1.0.6.4.9.7.0.2.4.4.infobip.net).
  2. QTYPE must be NAPTR specified in RFC 2168.
  3. QCLASS can be any defined in RFC 1035, a standard for this service should be the internet class (IN).

Example of Valid ENUM query using dig is:

      dig naptr 5.4.3.7.1.0.5.1.9.5.8.3.infobip.net @x.x.x.x

(where X.X.X.X represents IP address of ENUM server)

ENUM Server Responses

ENUM server response format is compliant to RFC 1035 and RFC 3761 which means that RR that are returned only contain NAPTR RDATA, also the ENUM error responses are returned in case of error while processing the ENUM query.

ENUM Response Packet Format

ENUM response packet format

HEADER Section of ENUM Response

  1. QR bit is set to 1, representing DNS response.
  2. RCODE value can be any value as per specification. 

QUESTION Section of ENUM Response Packet

It’s the same as Question in ENUM query that response is for. The ANSWER section is present in case there was no error while processing the ENUM query request.

ENUM Responses In Case of Error Processing ENUM Query

In case the ENUM query is successfully processed and the HLR query was successful (there was no timeout reached), an ENUM server sends a response which contains the Answer section. The Answer section contains the HLR query result in the RR for which RDATA type is NAPTR.

ENUM Error Response Packet Format

ENUM error response packet format

HEADER Section of ENUM Error Response

  1. QR bit is set to 1, representing DNS response.
  2. RCODE value representing an error, zero value in ENUM error response will never be returned.

RCODE values in case of specific error are shown in table:

RCODE value

ERROR CAUSE

Packet discarded

HEADER section parsing error

FORMERR

Any other ENUM query section parsing error.

SERVFAIL

Invalid Query

SERVFAIL

Failed sending HLR query

SERVFAIL

Timeout while for waiting HLR query response.

NXDOMAIN

Invalid E.164 number in ENUM query Validity of E.164. number is checked based on the prefix (Country Code and Identification Code of number). List of all valid number prefixes which are updated on daily basis is maintained. In case that number prefix which is submitted via ENUM is not in that list HLR query is not sent to SS7 network and ENUM server responds with NXDOMAIN error.

NOTIMPL

System failure

REFUSED

Unknown Error 

ENUM Responses In Case of Successfully Processed ENUM Query

In case the ENUM query is successfully processed and the HLR query was successful (there was no timeout reached), the ENUM server sends a response which contains the Answer section. The Answer section contains the HLR query result in the RR for which RDATA type is NAPTR.

ENUM Successful Response Packet Format

ENUM successful response packet format

PR Format

ENUM RR format

  1. NAME represents the RR name, it the same as the ENUM query QNAME.
  2. TYPE is the same as the ENUM query QTYPE which is NAPTR.
  3. CLASS default returning class is internet class (IN).
  4. TTL default value is 86400 seconds (24h).
  5. RDLENGTH represents the length in bytes of NAPTR.

RDATA

NAPTR RDATA values returned by ENUM server are:

Order

10

Preference

100

Flags

“u“

Services

“E2U+pstn:tel”

Regular Expression

"!^.*!tel:\\1\;hlr=xxxxxx\;imsi=xxxxxx\;msc=xxxxxx\;msisdn=xxxxxx\;status=xxxx"

Replacement

.

 

hlr=xxxxxx

HLR GT which is returned in the HLR response

imsi=xxxxxx

IMSI which is returned in the HLR response

msc=xxxxx

Serving MSC GT which is returned in the HLR response (last 4 digits of MSC are not returned because of the possibility of SMS Fraud/Spoof using obtained routing information)

status=xxxxxx

Status of HLR query (HLR error code)

Regular Expression

"!^.*!tel:\\1\;hlr=xxxxxx\;imsi=xxxxxx\;msc=xxxxxx\;msisdn=xxxxxx\;status=xxxx"

Example of ENUM query response using dig in case of successful HLR query:

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 195

;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION: ;5.4.3.7.1.0.5.1.9.5.8.3.infobip.net. IN NAPTR

;; ANSWER SECTION:

5.4.3.7.1.0.5.1.9.5.8.3.infobip.net. 86400 IN NAPTR 10 100 "u" "E2U+pstn:tel" "!^ .*!tel:\\1\;hlr=385915017345\;imsi=219101100165275\;msc=3859\;msisdn=38591501734 5\;status=00 00" .

;; Query time: 546 msec

Example of ENUM query response using dig in case of HLR query error:

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1696

;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION: ;7.0.0.0.0.6.8.9.5.8.3.infobip.net. IN NAPTR

;; ANSWER SECTION:

7.0.0.0.0.6.8.9.5.8.3.infobip.net. 86400 IN NAPTR 10 100 "u" "E2U+pstn:tel" "!^.* !tel:\\1\;msisdn=38598600007\;status=0006

;; Query time: 383 msec