Android: Answer phone call, play audio to caller, capture caller input

Viewed 1557

I've been looking for the better part of a day for the answers but can only find parts of what I'm looking to do, so throwing it out here to see if anyone can answer, I'm not looking for code examples, just the right direction to look so that I can determine the viability of an idea, so classed or methods that could be used are perfect.

Would like to be able to do the following using Android M (API Level 23/minSdkVersion 23)

  1. Automatically answer an inbound call on android (found multiple ways to do this)
  2. Play dynamic audio("Please enter the following numbers n n n n") to the caller as a background service, so the person being called doesn't know there is even a call yet.
  3. Capture the typed keys from the caller and validate(how do you capture inbound keys)
  4. Ring the phone similar to a normal call if the caller entered the same numbers as stated in the dynamic audio

Any help or pointers in the right direction are greatly appreciated!

1 Answers

2) this is the most important thing but cannot be achieved because it's not possible to "inject" Audio on the voicecall "channel", so the "solution" could be to play an audio file loudly that will be used from the Microphone, but in this way all Ambient Noise will be heard from the caller (privacy issue?).

3) keys use DTMF tones, so the solution is to record inbound Voice and analize the spectrum by searching right frequencies. Even this way is quite not-possible because Caller Ambient Noise could ruin the spectrum detector.

Related