[Tagging] phone validity - phone "preset"

Tod Fitch tod at fitchdesign.com
Tue Sep 5 22:34:45 UTC 2017


I would not be too hard to make a validity checker for any phone:*=* field. By the wiki [1] we should be formatting the number per ITU E.123. That requires a leading “+” and a space delimiter between digits groups. [2]

More over, all international telephone numbers need to conform to ITU E.164 [3] in order to be called. That specification calls for the full number (including the country code, area/city code, exchange and local portion of the number) to be no more than 15 digits. In addition, country code starts after the “+” symbol. Looking at the assigned country codes, the first thing that is evident is that no country code starts with a “0”. [4]

So a simple validator that assures that the string starts with a “+” followed by a digit in the range 1..9, containing only the characters 0..9 and space with no more than 15 digits will catch a huge number of issues.

Given that the list of country codes is finite and the numbering plans for each country is fixed, one could get fancier and assure the correct number and format of digits for the jurisdiction. But that would require basically a small database that will need maintenance so I would avoid that until it is shown that level of error detection is needed.

Been a while since I worked in telephony, but what Wikipedia shows for E.123 and E.164 looks pretty unchanged from what I remember from back when ITU was CCITT.

Cheers!

[1] https://wiki.openstreetmap.org/wiki/Key:phone#Usage
[2] https://en.wikipedia.org/wiki/E.123
[3] https://en.wikipedia.org/wiki/E.164
[4] https://en.wikipedia.org/wiki/List_of_country_calling_codes

> On Sep 5, 2017, at 2:48 PM, Graeme Fitzpatrick <graemefitz1 at gmail.com> wrote:
> 
> On 6 September 2017 at 02:51, marc marc <marc_marc_irc at hotmail.com <mailto:marc_marc_irc at hotmail.com>> wrote:
> Hello,
> 
> on the french-speaking mailing, a contributor noticed a high rate
> of incorrect value for the tag "phone". the most common error is using
> the national format number instead of the international format.
> 
> I'll admit to being guilty here, in that I enter numbers in my part of Australia as 07xxxxxxxx, working on the basis that most people using this info to ring the establishment will be making local, or at most, inside-Australia calls. I know, sorry, I should be thinking internationally! :-)
>  
> But the best would be to avoid the mistake when a user fill
> in the data in iD, josm or whatever.
> 
> Is anyone aware of a kind of "preset" that can be used for phone ?
> 
> Would the easiest way be to format the telephone number box so that it has a non-erasable + as the beginning symbol? 
> 
> Thanks
> 
> Graeme
> _______________________________________________
> Tagging mailing list
> Tagging at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/tagging

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tagging/attachments/20170905/f0ab0bfe/attachment.html>


More information about the Tagging mailing list