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

前端 未结 2 2071
不知归路
不知归路 2021-01-06 18:18

While putting a tel link as Dial and clicking it from a mobile browser, only initial number gets transferred t

相关标签:
2条回答
  • 2021-01-06 18:40

    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.

    0 讨论(0)
  • 2021-01-06 19:01

    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

    0 讨论(0)
提交回复
热议问题