Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide dtmf tone while dialing

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?

like image 941
Hardy Avatar asked Aug 07 '13 01:08

Hardy


1 Answers

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.

like image 52
Mike P. Avatar answered Oct 10 '22 02:10

Mike P.