I'm trying to send DTMF tones during outgoing call this way in my
PhoneStateListener.
Is this the right way to send DTMF - using the STREAM_VOICE_CALL.
Also i want to send the DTMF sequence after the call is answered, so
CALL_STATE_OFFHOOK doesn't seem to be right, what should be the
appropriate state for sending?

        public void onCallStateChanged(int state, String incomingNumber) {
                // TODO Auto-generated method stub
                super.onCallStateChanged(state, incomingNumber);

                switch (state)
                {
                        case TelephonyManager.CALL_STATE_OFFHOOK:

                        ToneGenerator toneGenerator = new
ToneGenerator(AudioManager.STREAM_VOICE_CALL,
ToneGenerator.MAX_VOLUME>>1);
                        toneGenerator.startTone(ToneGenerator.TONE_DTMF_1);
                        toneGenerator.stopTone();
                        toneGenerator.startTone(ToneGenerator.TONE_DTMF_2);
                        toneGenerator.stopTone();
                                break;
                }

        }


On Oct 2, 11:02 am, legerb <[EMAIL PROTECTED]> wrote:
> Is it possible to make a call and then send DTMF sequence in android
> sdk 1.0?
> I've seen the ToneGenerator and PhoneNumberUtils classes, but couldn't
> find an option of sending DTMF...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to