How do I create a HTML <a href="tel:"></a>
link to an emergency number like 911
or 112
?
The RFC says
The phone number can be represented in either global or local notation. All phone numbers MUST use the global form unless they cannot be represented as such. [Emergency numbers ("911", "112")] cannot be represented in global form and need to be represented as a local number with a context.
From the local-context section I don't find it easy to understand what a "local-context" is, let alone what the correct one for this case is. It lists domain prefixes like houston.example.com
or a numeric prefix like +1
, and in one paragraph it says
A context consisting of the initial digits of a global number does not imply that adding these to the local number will generate a valid E.164 number. It might do so by coincidence, but this cannot be relied upon. (For example, "911" should be labeled with the context "+1", but "+1-911" is not a valid E.164 number.)
But the phrasing of this paragraph is again very confusing.
Is
<a href="tel:+49-112">112</a>
now the correct way of doing it, and the fact that it is not a valid E.164 number is irrelevant?
Or is the fact that it is not a valid E.164 number a problem?
In some other places I see people using
<a href="tel:112;phone-context=emergency.example.com">112</a>
And again other people recommend
<a href="tel:112;phone-context=+49">112</a>
But when I tap that link on Android, the dialer opens with the number
112;746632668398+49