How to send DTMF tones in active call in android?

4.3k views Asked by At

Is it possible to send DTMF tones in active call in android ? I tried it with proxyphone.sendDtmf() but it was useless.

How can i achieve it ?

2

There are 2 answers

3
Karthi On BEST ANSWER

In VOIP only it is possible,Android applications have no access to the in-call audio stream. You can fake a it a bit in speakerphone mode.

0
user2841300 On

Try this method() .It is getting the number and delay from user.

private void call(int profileid) {//call procedure logic 
        ProfileDo profile = adapter.getProfile(profileid);
        if (profile.getStepCount() == 0) {
            Toast.makeText(getApplicationContext(), "Please edit the profile and add atleast one value to make a call", 10000).show();
            return;}
            String call = "tel:";
        for (StepDO step : profile.getSteps()) {
            String value = URLEncoder.encode(step.getValue());
            int delay = step.getDelay();
            String pausesStr = "";
            for (int i = 0; i < delay / 2; i++) {
                pausesStr += PhoneNumberUtils.PAUSE;
            }
            call += value + pausesStr;
        }
         startActivity(new Intent("android.intent.action.CALL", Uri.parse(call)));      
    }