How do I include extensions in the tel: URI?
Asked Answered
M

8

59

I currently have a webpage serving up phone numbers, some of these phone numbers have extensions so I have written the HTML like this:

<a href="tel:+44-1234-567;ext=88">+44-1234-56788</a> / <a href="tel:+44-1234-567;ext=99">+44-1234-56799</a

When I hit this page in my Android browser and tap one of the phone numbers, it loads up in my phone dialer (UK Samsung Galaxy s2 stock) as:

+44-1234-567;ext=88

which I don't think is correct. Surely it should omit the ;ext= word.

Have I misread the RFC for implementing tel?

Morman answered 28/2, 2012 at 13:17 Comment(2)
Just because you’ve read the spec correctly doesn’t mean the phone dialer has implemented it correctly. ☹Englishman
Has anyone tested all of these answers on iPhone and Android? I would guess 90%+ click to call calls would come from fairly recent iOS and Android devices. Sure you might have 50%+ desktop visitors on your site, but those people are probably dialing by hand.Prelatism
P
43

Seems the proper way to do it is use a comma:

<a href="tel:441234567,88">+44-1234-567 ext.88</a>

Just tested with iPhone and Android OS 2.1. Using ;ext=88 converts the ext bit into a number that is dialed with the extension (so it dials something like 35888 instead of 88).

Photoluminescence answered 29/5, 2012 at 16:9 Comment(1)
This answer is definitely wrong as you removed the "+" completely. I don't understand why so many users upvoted this, see my answer below for the correct version.Callisto
K
26

Comment for How do I include extensions in the tel: URI?

As of June 2021 the RFC3966 ;ext= syntax still isn't implemented by Android, and it's inelegantly implemented by iOS.

Using ;ext=123 as an example:

  • Android: after the call connects a modal window appears asking Send the following tones? 396123 with No and Yes buttons. "Send the following tones?" is a precise technical description of what will happen if the user taps Yes, but it is probably not the best wording for the average user.
  • Android converts ;ext=123 into 396123 because it treats the letters the same way as if you were dialing something like 1-800-FLOWERS, and this is a broken implementation of the syntax.
  • iOS provides an option to the left of the Disconnect button that says Dial “ext=…”. When you tap on this "button" it will dial the extension number. This is inelegant and has bad usability because the "button" doesn't look like a button — it's just plain text — and because you can't see the extension number.
  • In addition, when you first tap on a phone link in iOS it presents a button at the bottom of the screen which partially rewrites the phone number into a local format, but which also preserves most of the ;ext= syntax, e.g. Call +1 (555) 555-5555;ext123. This is also inelegant, and it's ugly besides.

If you instead use just a ; which is supposed to mean "wait," as in "wait until the auto attendant message ends and then automatically dial the extension":

  • iOS: tapping the link displays a button stating Call +1 (555) 555-5555;123 which is slightly less ugly than the button described above.
  • iOs provides the same extension-dialing "button" described above except the extension number is visible, e.g. Dial “123”. It still has the other usability problems.
  • iOS does not automatically dial the extension after the message ends.
  • Android: after the call connects a modal window appears asking Send the following tones? 123 with No and Yes buttons.
  • Android does not automatically dial the extension after the message ends.

So for now, as of June 2021 it seems that the only way to include extensions in tel: links that will actually work is to use either ; for "wait" or , for "pause":

  • <a href="tel:+1-555-555-5555;123">555-555-5555 ext. 123</a> — this will provide a UI component which the user can invoke to dial the extension. The usability of the UI component depends on the OS; neither are great, but Android's is arguably better.
  • <a href="tel:+1-555-555-5555,123">555-555-5555 ext. 123</a> — this will automatically dial the extension a couple seconds after the call connects. Note: This mechanism will not work with voicemail systems that don't accept user input until the auto attendant message ends.
Kris answered 2/6, 2021 at 18:38 Comment(1)
Sounds like this would be worth reporting a issuetracker.google.com/issues/… for. Can anyone verify that the issues stated in stackoverflow.com/revisions/67810744/3 remain reproducible in 2024?Minardi
A
12

According to the documentation, you can add what you want like so 12345678;ext=123

See RFC 3966

Andradite answered 14/10, 2016 at 18:11 Comment(2)
Why was this downvoted? It's from 2012 but is a valid source.Gromwell
W3.Org relates above mentioned RFC 3966 as the most broadly supported scheme w3.org/TR/mwabp/#bp-interaction-uri-schemesGromwell
P
5

In all the examples I saw, the value of ext is contained in the full number. So try including 88 in the href value:

<a href="tel:+44-1234-56788;ext=88">+44-1234-56788</a>
Poulter answered 28/2, 2012 at 18:53 Comment(1)
It still tells you which part of the whole number corresponds to the extension. Don't know how would browsers handle that, though. I'd have to check the RFC.Poulter
G
5

For those still wondering about this problem: I've found it best to use this format:

<a href="tel:+13235798328;22">
Gratifying answered 3/6, 2019 at 16:30 Comment(1)
I love how every answer to this question is completely different lolPhenol
G
4

Standards at thenewcode from 3 months ago suggest using a microdata pause.

<a href="tel:+13235798328p22">

Related: Different standards persist across different external platforms and may change the processing of URIs. Click to call features on Google Developers docs do not specify

Example: Office's Skype uses x to represent extension within skype.

Gromwell answered 2/3, 2017 at 21:54 Comment(2)
apple dev also does not appear to have a standard for URI extensionGromwell
Nice addition @systemaddict. Unfortunately, 'p' auto-converted to a number on Android v7 on my Samsung in US.Shammer
C
3

I don't get the answers to this question - I think the're wrong. The correct link would look like this:

<a href="tel:+441234567,88">+44-1234-567 ext. 88</a>
Callisto answered 11/6, 2020 at 14:36 Comment(1)
it is the only format that works on both Android and iOSApocarpous
P
3

I feel like this is kind of a cop-out answer, but if this is not implemented consistently across devices yet, probably best to just not include the extension and let people dial it by hand:

<a href="tel:+441234567">+44-1234-567 ext. 88</a>

or

<a href="tel:+441234567">+44-1234-567</a> ext. 88

Better to make the user do more work than to send 1/2 your users to the wrong extension.

Prelatism answered 1/12, 2020 at 23:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.