user861973
user861973

Reputation: 777

android DTmf tone

I am sending dtmf tone via this code.

String number="tel:+962791212121,2,3,3";
Intent c1= new Intent(android.content.Intent.ACTION_CALL, Uri.parse(number));
startActivity(c1);

It send perfect dtmf as this. 2+(2 sec delay)+3+(2 sec delay)+3.

but I want to remove that 2 sec delay or I want to control that delay.

How can I control (2 sec delay)? Or any other method to send dtmf tone during call?

Upvotes: 2

Views: 1679

Answers (3)

user2892682
user2892682

Reputation: 1

Try this:

Intent signalIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:12334566778"+","+","+"1"));
startActivity(signalIntent);

Upvotes: 0

user2841300
user2841300

Reputation: 353

Try this method().

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

Hope this helps you .

Upvotes: 0

Tech Agent
Tech Agent

Reputation: 657

To remove the delay remove the comma.

Upvotes: 2

Related Questions