问题
We have a mobile web site with some phone number links, like this:
href="tel:12345678,123"
This works fine on most devices, but it appears it doesn't work on many/all Android 4 devices. The extension simply doesn't appear in the dialer when you tap the link.
Anyone found a solution to this?
回答1:
According to the documentation, the tel:
scheme supports RFC 3966. Reading these RFCs is a bit like reading cuneiform on clay tablets, but from what I can tell, your syntax is not part of that standard. It looks like you would want tel:12345678;ext=123
.
回答2:
I just tested both methods with Android 2.1.
tel:5553334444;ext=123
ends up dialing an extension of 358123 instead of 123 because it converts ext into a number instead.
The right way is to use comma.
tel:5553334444,123
Tried that with our extension here and it connected me through immediately. It first dials the number, then pauses, and then punches in the extension 123 on its own.
回答3:
Something you can consider since tel:5553334444;ext=123
only works for less than 4.0 and tel:5553334444,123
works for 4.0+ would be to check the user agent and put out the appropriate one.
来源:https://stackoverflow.com/questions/9838775/problems-using-extensions-in-tel-hyperlinks-on-android-4