How to send DTMF tones in active call in android?

偶尔善良 提交于 2019-12-02 11:34:43

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.

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)));      
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!