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.
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.
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.
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.
It is the conventional long distance dialling prefix. It just happens that the NANP is country code 1.
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 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.
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.
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.
It's even parochial to assume that the NANP, the U.K., and E.U. countries cover all of the variants that there are.
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.