Search code examples
htmltel

What's a reliable method for setting up telephone links for mobile browsers?


I'm working on a quick page intended for mobile browsers. While there is little consistency between browsers on cell phones (the target audience), I have a phone number that I would like to be as easy as possible to dial from the users phone. A link seems the obvious choice; so I set up the following:

<a href="tel:+18881235467">1-888-123-5467</a>

This seems to work OK on more advanced browsers such as the Android & BlackBerry browsers, it's a lot less reliable on other phones. Any advice on making this link work consistently and or correctly will be greatly appreciated.

FYI, this is a toll free domestic US call, but I imagine that some devices may be looking for a more general format.


Solution

  • What I eventually came up with was a link that worked like this:

    <a href="wtai://wp/mc;18881235467">1-888-123-4567</a>
    

    This has worked on every phone tested so far, including Android, BlackBerry and some very clunky older phones. From what I gather, the structure of the link works like so:

    WTAI references the Wireless Telephony Application Interface. The wp/ refers to the WTAPublic functions. The mc; is the makeCall function, and then of course you have the phone number. Similarly, you can do a link like this:

    <a href="wtai://wp/ap;18881235467">Add to addressbook: 1-888-123-4567</a>
    

    This is the same except mc; has been replaced by ap;, which refers to the addPBEntry function. This adds the phone number to your address book or similar stash of phone numbers.

    These two sites were helpful in my research: