Truths about telephone numbers

Inspired by someone else's list of falsehoods that programmers believe about telephone numbers, here is a list of corrections to falsehoods programmers believe about telephone numbers.

Geographic numbers are not necessarily geographic.

The days where a "geographic" number actually specified by its area code what part of a country it is in are long gone. Number portability has long since done away with this, and subscribers regularly carry numbers with them to completely different parts of their countries.

You cannot geolocate people by their telephone numbers.

The area+subscriber portion is not the last 10 digits.

You cannot do number matching by comparing the last 10 digits and vaguely hoping that this skips dialling prefixes. There is no uniform length for a telephone number across countries.

There is no uniform length even within some countries. This is true of the U.K., for example, where some numbers (excluding long distance prefix) are 9 digits, and some 10 digits.

Convert to E.164, then compare.

123456789 is not a good number for test calls.

Let's just say that one can rack up quite a bill calling the speaking clock, especially if one's carriers charge premium rates for calls to the speaking clock.

The leading 1- in NANP long distance form is not the country code.

It is the conventional long distance dialling prefix. It just happens that the NANP is country code 1.

Emergency numbers are non-trivial to filter.

In some countries the emergency number is 999, in others 112, in others 911. In many countries, two out of the three or even all three work. In some countries, there are further emergency numbers still.

And then there's the fact that some emergency services require that any number that begins with an emergency number should be routed as an emergency call. (This is the case in the U.K., for example.) Just to make it even more fun, other emergency services require the opposite. (Some U.S. emergency service providers require as part of interop testing that numbers such as 9112 are checked to see that they are not routed to them.)

A simple dumb filter does not catch all emergency numbers.

STD is not like NPA-NXX.

STD codes are not a single uniform length. The STD code for Coventry is 024, for example, whereas the code for Rugby is 01788. And the part following the STD code does not subdivide into exchange codes.

You cannot format/process U.K. STD numbers like NANP area and exchange codes.

Users use E.164 themselves.

It's not a telephony secret. It's not even arcane. Users can and do use E.164 form themselves.

They can certainly use them on their mobile telephones, and will look at you askance if your system cannot accept E.164 like their mobile telephones can.

Not everyone uses a numbering plan like yours.

The numbering plans used in North America, the U.K., and various E.U. countries all differ. The rules that you know for your numbering plan are not necessarily the case for other countries.

Not everyone uses a numbering plan like the NANP, U.K., or E.U..

It's even parochial to assume that the NANP, the U.K., and E.U. countries cover all of the variants that there are.

Other number forms still exist.

It is not the case that there are only national and international forms for numbers nowadays. People still use local forms, without long distance prefixes and area/STD codes (or equivalents), for example.


© Copyright 2019,2020 Jonathan de Boyne Pollard. "Moral" rights asserted.
Permission is hereby granted to copy and to distribute this web page in its original, unmodified form as long as its last modification datestamp is preserved.