2012-06-23 28 views
2

我正在通過此代碼發送dtmf音。android DTmf tone

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

它發送完美dtmf爲此。 2+ (2秒延遲) + 3+ (2秒延遲) +3。

但我想刪除那2秒的延遲或我想控制該延遲。如何控制(2秒延遲)? 還是其他方法在通話過程中發送dtmf音?

回答

2

要刪除延遲,請刪除逗號。

+0

和猜想,如果我想補充的300延遲或小於1秒,我怎麼能任何延遲? – user861973

+0

對不起,我不知道這是否可能。 –

+0

加入更多逗號 –

0

試試這個方法()。

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

試試這個:

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