9

I'm making a call app with call a number and send dtmf tone after that by

String number = "tel:+1234567,890#";
Intent c1 = new Intent(android.content.Intent.ACTION_CALL, Uri.parse(number));

Currently it can dial 1234567, wait about 3 sec, then dial 890. Functional okay but it send 890 with tone which kind of not very conformable, Is there any way to send 890 without tone response back?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Hardy
  • 1,499
  • 2
  • 26
  • 39

1 Answers1

1

There is no way for developers to do this via public APIs. Unfortunately, Android doesn't handle DTMF control very well. For example, there's a two year old feature request to allow a user to send DTMF controls at an arbitrary time during a call; it's been abandoned.

As you know, using ACTION_CALL or ACTION_DIAL and doing <number>|,;|<tones> will send DTMF tones directly after a call is connected, but that's where user control over the issue stops.

Any additional controls, such as sending additional tones or muting the tone response to the handset, are handled by internal APIs, notable com.android.internal.telephony. Of note is the stopDtmf() method, which would possibly do what you're looking for, except that it's internal and may not have consistent behavior.

Here's what the 2.x source looked like for the method. As stated, there's no guarantee this would work and using internal APIs is strongly discouraged.

Mike P.
  • 1,920
  • 1
  • 18
  • 20
  • I have seen the applications hiding the DTMF tones . – Deepak Oct 15 '13 at 05:21
  • Example? I haven't seen one that didn't require root. – Mike P. Oct 15 '13 at 21:52
  • The issue is much older than two years; it's approaching its fifth anniversary, and [these patches](https://groups.google.com/d/msg/android-contrib/4QqHgLOrBO8/h2DZ5IKXVVsJ) were submitted and abandoned 18 months ago. I have little hope anything will change on the short term, and bear in mind that even if they do, it won't be compatible with previous versions of Android. – Paul Lammertsma Oct 16 '13 at 21:29
  • @PaulLammertsma Agreed. Note that I said the feature request linked was 2 years old, not that the issue was 2 years old. It's just shy of 5, as you mentioned. – Mike P. Oct 17 '13 at 00:30
  • com.android.internal.telephony could be accessed using reflection pre Android 3.1, in later versions I believe Google's blocked access to this stuff; making it available for manufacturers only – Naeem A. Malik Oct 17 '13 at 10:20
  • https://play.google.com/store/apps/details?id=com.itsystemsyd.conferencecaller&hl=en – Deepak Nov 13 '13 at 04:32
  • this application can hide the DTMF tone ..how is it possible? – Deepak Nov 13 '13 at 04:33
  • @Deepak I tried out the application that you've linked & it didn't hide the DTMF tones. – timemanx Oct 28 '14 at 11:28