How to send DTMF tones in active call in android?

拜拜、爱过 提交于 2019-12-02 19:27:11

问题


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 ?


回答1:


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.




回答2:


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)));      
    }


来源:https://stackoverflow.com/questions/10748376/how-to-send-dtmf-tones-in-active-call-in-android

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