views:

990

answers:

6

Hi,

I want to mark up a phone number as callable link in an HTML document. I have read the microformats approach, and I know, that the tel: scheme would be standard, but is quite literally nowhere implemented.

Skype defines, as far as I know, skype: and callto:, the latter having gained some popularity. I assume, that other companies have either other schemes or jump on the callto: train.

What would be a best practice to mark-up a phone number, so that as many people as possible with VoIP software can just click on a link to get a call?

Bonus question: Does anyone know about complications with emergency numbers such as 911 in US or 110 in Germany?

Cheers,

Update: Microsoft NetMeeting takes callto: schemes under WinXP. This question suggests, that Microsoft Office Communicator will handle tel: schemes but not callto: ones. Great, Redmond!

+1  A: 
Traveling Tech Guy
+1  A: 

Mobile Safari (iPhone & iPod Touch) use the tel: scheme.

How do I dial a phone number from a webpage on iPhone?

Jan Aagaard
So if the main targetted users are iPhone or iPod Tough (and maybe other mobile devices, I don't know... ) , you should use tel: If the main users are normal web clients, (IE, Firefox etc..) using skype or some other VoIP software, I think callto: would be best.
awe
A: 

Since callto: is per default supported by skype (set up in Skype settings), and others do also support it, I would recommend using callto: rather than skype: .

awe
Here I agree. But all together it seems to boil down to tel: vs callto:, and that's not an easy one.
Boldewyn
+1  A: 

Since it looks like a draw between callto and tel guys, I want to throw in a possible solution in the hope, that your comments will bring me back on the way of light ;-)

Using callto:, since most desktop clients will handle it:

<a href="callto:0123456789">call me</a>

Then, if the client is an iPhone, replace the links:

window.onload = function () {
  if (navigator.userAgent.match (/iPhone/i)) {
    var a = document.getElementsByTagName ("a");
    for (var i = 0; i < a.length; i++) {
      if (a[i].getAttribute ('href').search (/callto:/i) === 0) {
        a[i].setAttribute ('href', a[i].getAttribute ('href').replace (/^callto:/, "tel:"));
      }
    }
  }
};

Any objections against this solution? Should I preferably start from tel:?

Boldewyn
It could be that the iPhone also supports the callto scheme, but that Apple prefers tel, so that's the one mentioned in the documentation.
Jan Aagaard
See my answer. `callto:` is a proprietary URI scheme, so I wouldn't start there.
Sidnicious
+7  A: 

The tel: scheme was used in the late 1990s and documented in early 2000 with RFC 2806 (which was obsoleted by the more-thorough RFC 3966 in 2004) and continues to be improved. Supporting tel: on the iPhone was not an arbitrary decision.

callto:, while supported by Skype, is not a standard and should be avoided unless specifically targeting Skype users.

Me? I'd just start including properly-formed tel: URIs on your pages (without sniffing the user agent) and wait for the rest of the world's phones to catch up :) .

Sidnicious
Thanks for the detailed answer! Since I asked the question, I was tempted to follow this approach, too. Use the standard and tell complaining people, that they use the bad app/tool. Although it gets hard, if this one is your client, I think, you're right. If nonetheless I have to consider Skype users, I'll go with my JavaScript solution the other way round.
Boldewyn
+2  A: 

As one would expect, WebKit's support of tel: extends to the Android mobile browser as well - FYI

rymo