How ENUM works

ENUM works with numbers written in the ITU E.164 notation. For example, a London phone number may be dialed 020 7123 4567 from within the UK but its E.164 representation is +442071234567. E.164 numbers are always designated with a leading plus (+) symbol. The digits following the plus symbol are the country prefix (44 in the example) and then any area code and finally the local number itself. Any other digits, such as the 0 used when dialing within the UK are not present. You may have noticed this notation is used for incoming phone calls and text messages on your mobile phone.

To perform an ENUM query, the first step is to take the number and normalize it into the ITU E.164 format. Google's libPhoneNumber, a free software project, is an ideal tool for normalizing phone numbers individually or en-masse.

Once you have the E.164 number, remove the leading plus symbol, reverse the order of the digits and insert periods between them. For the example number, it becomes 7.6.5.4.3.2.1.7.0.2.4.4.

The next step is to append the ENUM suffix. The public ENUM suffix is e164.arpa. To look up the example number in public ENUM, it would be written 7.6.5.4.3.2.1.7.0.2.4.4.e164.arpa. Private and in-house ENUM services simply use an alternative suffix. You may choose to perform multiple ENUM queries concurrently using different suffixes and then choose the best result.

A DNS query is sent using the query string that has been constructed. The query requests NAPTR records.

Finally, the ENUM algorithm must inspect the NAPTR records that have been returned and try to identify which, if any, are useful. For example, if the query only returns a HTTP URL, a SIP proxy may not be able to use it and will ignore the result and use some other mechanism to route the call.

Example 15.1, “Using dig to perform ENUM queries” demonstrates how to execute an ENUM query from the command line for the UK phone number 01865 332244 in the public ENUM suffix e164.arpa.

Example 15.1. Using dig to perform ENUM queries

$ dig -t naptr 4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa

; > DiG 9.8.4-rpz2+rl005.12-P1 > -t naptr 4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa
;; global options: +cmd
;; Got answer:
;; ->>HEADER ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 4

;; QUESTION SECTION:
;4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa. IN	NAPTR

;; ANSWER SECTION:
4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa. 86400 IN NAPTR 100 20 "u" "E2U+pstn:tel" "!^(.*)$!tel:\\1!" .
4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa. 86400 IN NAPTR 100 10 "u" "E2U+sip" "!^\\+441865332(.*)$!sip:\\1@nominet.org.uk!" .