A quick look at ENUM mapping telephone numbers to DNS
With my talk about Lumicall at FOSDEM coming this Sunday, I'm going to have a quick look at some of the technologies used in Lumicall over this week. The first is ENUM
Introduction to ENUM
ENUM, as defined by the IETF, is a convenient and powerful way to map telephone numbers to the latest communications technologies such as SIP, XMPP (Jabber) and web sites.
ENUM resolution operates much like reverse DNS lookup:
- Take the number you want to call and normalize it into E.164 format - in other words, by removing any leading zero and punctuation and adding the country code. For example, for a British number "020 7123 4567", the country code is 44 and so the normalized form of the number is +442071234567
- Remove the leading plus symbol, reverse the digits and insert a dot between each digit. For our sample number +442071234567, it becomes 220.127.116.11.18.104.22.168.0.2.4.4
- Choose the ENUM suffix. The official ENUM tree defined by the IETF uses the e164.arpa ENUM suffix. There are several third-party suffixes as well, such as e164.org and for the sip5060.net service, use the suffix e164-addr.sip5060.net. For our example, the full string, with suffix, is 22.214.171.124.126.96.36.199.0.2.4.4.e164.arpa
- Perform a DNS lookup, typically looking for NAPTR records
Here is an example using dig. The subject number we are looking up is 01865 332244 from the Nominet contact page:
$ dig -t naptr 188.8.131.52.184.108.40.206.220.127.116.11.e164.arpa
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> -t naptr 18.104.22.168.22.214.171.124.126.96.36.199.e164.arpa
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49821
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 4
;; QUESTION SECTION:
;188.8.131.52.184.108.40.206.220.127.116.11.e164.arpa. IN NAPTR
;; ANSWER SECTION:
18.104.22.168.22.214.171.124.126.96.36.199.e164.arpa. 86400 IN NAPTR 100 20 "u" "E2U+pstn:tel" "!^(.*)$!tel:\\1!" .
188.8.131.52.184.108.40.206.220.127.116.11.e164.arpa. 86400 IN NAPTR 100 10 "u" "E2U+sip" "!^\\+441865332(.*)$!sip:\\firstname.lastname@example.org!" .
Ready to use today
dlz-ldap-enum is a plugin for bind9 nameservers that can read telephone numbers from LDAP and make them available in real time for DNS lookup
Most SIP proxies and related products like Asterisk also support ENUM lookups during the process of routing a call.
ENUM dialing from Lumicall
When dialing any number from your address book on Android, Lumicall can perform an ENUM lookup against the public ENUM tree and any private ENUM trees you configure.
This blog is based on a page I published at sip5060.net