Sending pause to dialer
Asked Answered
H

6

28

In a similar vein to Sending Pause and DTMF input in android, I'm trying to send the pause character "," to the dialer. This works on HTC Sense phones and even on the Xoom, but not on "stock experience" phones like the Nexus One or T-Mobile G2 (and I suspect the Motorola Droid).

These phones seem to have a dialer that tries to pretty-format the number (ie adding dashes) and stop upon hitting a comma character. Interestingly, it doesn't choke on a "p" character, though it will strip out "p"s and keep adding numbers.

Here is what the ActivityManager sees:

I/ActivityManager(   92): Starting activity: Intent { act=android.intent.action.DIAL dat=tel:8883333,444 cmp=com.android.contacts/.DialtactsActivity }

I've also tried the encoded form, "tel:8883333%2C444" with no difference in behavior on these phones. I've tried "p", as mentioned, but these characters are dropped resulting in the dialers having 888-333-3444 incorrectly populated, and I'm not sure that "p" is correct anyway.

So, the question: Is there a way to specify a pause that works across most or all android dialers?

Humfrid answered 21/4, 2011 at 23:13 Comment(0)
M
17

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.

Mowbray answered 1/2, 2012 at 1:6 Comment(1)
Thanks for looking into this.Humfrid
N
4

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.

Newmark answered 30/7, 2011 at 11:45 Comment(2)
Thanks for the info. I really think that it is the dialers themselves that are stripping out the commas from the string in the intent. If I recall correctly, these dialers let you insert pauses, as long as you do it from their UI.Humfrid
Android phones may well use this standard internally, but the interface allowing other applications to send requests to dial a number uses RFC3966 URIs to indicate the number, which does not support a pause character as an intentional choice (see tools.ietf.org/html/rfc3966#section-12)Micrometeorite
F
3

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
Flickertail answered 24/4, 2011 at 23:31 Comment(1)
Yep, that's how I determined I should be sending a comma. But the problem is that some dialers stop cold once they hits a comma.Humfrid
D
0

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

Deconsecrate answered 19/5, 2011 at 13:22 Comment(1)
Yes, I tried the p character, as I describe in my question. It was simply dropped, and all the numbers were strung together.Humfrid
L
0

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.

Lucky answered 3/10, 2014 at 15:35 Comment(1)
You probably want to file a bug with Android, I'm not sure they read over here.Humfrid
P
0

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.

Porringer answered 22/12, 2015 at 6:40 Comment(4)
Sadly, iOS (as of version 9) fails when given "postd=" in a tel: URI, so for now keep using only , and ; on iOSStringfellow
Thanks, but this works on emulators, but not some phones.Clunk
@Clunk maybe someone who knows which phone it doesn't work on should raise tickets on them for RFC-2806 compliance?Porringer
@SteveBarnes, well, a good idea. But even if any producer will fix this bug in future phones, old phones will continue use the old scheme.Clunk

© 2022 - 2024 — McMap. All rights reserved.