Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DTMF detection on receiving an incoming call on android

Tags:

android

I would like to know whether we could receive the DTMF tones in android.Suppose,i am getting a call,and once i accept the call,is it possible to detect the keys that the other person is pressing during our call.I have go through many stack overflow questions regarding this,but most of them were not providing a solution.

How about implementing it through java reflection or something like that.?All the earlier post were for 2.2 and 3.0 versions.Presently we are in the 4.0 and above,so is it possible in the 4 or above versions?

Thanks in advance

like image 928
DeepakAndroid Avatar asked Feb 15 '13 07:02

DeepakAndroid


1 Answers

There is no packages to do this in SDK.

FIRST, you need to listen the speaker voice, because you can not record voice call :

AudioManager mAudioManager = (AudioManager) Sos.getContext().getSystemService(Context.AUDIO_SERVICE);
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
mAudioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, maxVolume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
mAudioManager.setSpeakerphoneOn(true);

AND, this project may help you :

http://code.google.com/p/dtmf-decoder/source/checkout

I've done this, so i know it is possible this way.

Good luck

like image 127
Dany Pop Avatar answered Oct 26 '22 04:10

Dany Pop