How to send DTMF tones in active call in android?

后端 未结 2 448
心在旅途
心在旅途 2021-01-29 05:28

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条回答
  • 2021-01-29 06:00

    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 讨论(0)
  • 2021-01-29 06:07

    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)));      
        }
    
    0 讨论(0)
提交回复
热议问题