Sending pause to dialer

吃可爱长大的小学妹 提交于 2019-11-28 21:10:49

Short answer: Doesn't look like it's possible using the native dialer.

Long answer:

The native dialer in Android uses the following code to extract the number you pass in to the dialer using an Intent

if ("tel".equals(uri.getScheme())) {
  // Put the requested number into the input area
  String data = uri.getSchemeSpecificPart();
  setFormattedDigits(data, null);
  return true;
} 

Within the setFormattedDigits method the number gets transformed thusly:

  String dialString = PhoneNumberUtils.extractNetworkPortion(data);

Looking at the docs for extractNetworkPortion you'll notice that it, "Extracts the network address portion [where the] Network address portion is everything up to DTMF control digit separators (pause or wait).

So the code is intentionally striping out the pause character and anything that comes after it. The only alternative I can think of is to replace the dialer or use the ACTION_CALL action instead of ACTION_DIAL. That'll bypass the dialer, so it should be used with caution.

dialing pause has been comma for 30 years

If the android phone is compatible with ITUT V.250 ATS8=2 should set the delay caused by comma to 2 seconds. (it's possible that it has somehow been set to 0s)

ITUT is a great standards orgnisation, you can download their standards for free.

From the android's latin ime source code:

<!-- Pause is a comma. Check PhoneNumberUtils.java to see if this has changed. -->
<Key 
    android:codes="44"
    android:keyLabel="Pause" />

I am not 100% sure if it's public, but you might be able to use:

PhoneNumberUtils.PAUSE

',' is the standard but HTC used 'p' in rogers magic,, have you tried with 'p'? HTC Magic is using p

Joe

This is horrible and dangerous. Business people getting conference call emails on their phone have to constantly switch back and forth to get the number.

Just make it work like it should:

tel://+1-877-555-1212,,,2345678#

Should dial the 877 number pause then dial in the participant conference code and 'enter' (#) when selected anywhere on the phone.

It's that simple. The fact this doesn't work in Android is a iPhone sales pitch.

For future reference RFC-2806 specifies storing telephone numbers in the format:

tel:number;postd=post-dial

Where number can start with + for intentional dialling and can include - or . as a visual separator and post-dial can include numbers, upper case letters A-D, #, *, p for pause and w for wait.

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