How do I give option to dial an extension in Tel: link?

♀尐吖头ヾ 提交于 2019-12-19 04:07:18

问题


While putting a tel link as <a href="tel:+91123456789,,123">Dial</a> and clicking it from a mobile browser, only initial number gets transferred to dialer and not the commas or extension. I've tried p, w and ;ext= as well but nothing is working. p and w change to '7' and '9' respectively.

Tested using Moto X 1st Gen.


回答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:+91123456789;ext=123.

UPDATE: Something you can consider since tel:+91123456789;ext=123 only works for less than 4.0 and tel:+91123456789,123 works for 4.0+ would be to check the user agent and put out the appropriate one.

<a href="tel:+91123456789;ext=123">Dial</a> //Less than 4.0
<a href="tel:+91123456789,123">Dial</a>     //Greater than 4.0

Source: Problems using extensions in tel: hyperlinks on Android 4




回答2:


The latest version of this is RFC 3966 which says you need to use ;ext= at the end:

extension = ";ext=" 1*phonedigit

Phone extensions identify stations behind a non-ISDN PBX and are functionally roughly equivalent to ISDN subaddresses. They are identified with the 'extension' parameter.

You say you have tried this tho, so it may be that your browser only supports the older obsolete RFC 2806, which RFC 3966 replaces.

For this older RFC, it looks like you need to set a post-dial sequence, using ;postd=:

post-dial = ";postd=" 1*(phonedigit / dtmf-digit / pause-character)

Phone numbers can also contain a post-dial sequence. This is what is often used with voice mailboxes and other services that are controlled by dialing numbers from your phone keypad while the call is in progress.



来源:https://stackoverflow.com/questions/35153574/how-do-i-give-option-to-dial-an-extension-in-tel-link

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!