Turn android into a phone call manager

  Kiến thức lập trình

I need to develop an application that can:
1)Answer all incoming phone calls.
2)Play a kind of ‘audio message’ to the person calling, explaining that they will be contacted via WhatsApp or text message.
3)Save the caller’s number in a database
4) Contact them via whatsapp/sms

Now I can do the first, third and fourth points easily, but I don’t really know how to do the second, I found several answers in which they say yes/no/yes with root permissions bla bla.
I have no idea how to do it, I also tried to integrate with Twilio but it seems like an overkill to me in addition to the fact that my SIM doesn’t allow me to set American or foreign numbers for forwarding phone calls.
I’m thinking about whether I should opt for different solutions like FreePBX + additional Italian SIM, in which I forward the calls from mine and manage everything from there via API, but they are quite narrow and complex.

Let’s say that the perfect solution would also be able to intercept them and play audio to the caller.

Documentation I found:

Incoming calls:

How to Answer or reject incoming calls programmatically in Android 9+?

https://github.com/adnan-creator/java-custom-dialer

https://developer.android.com/reference/android/telecom/InCallService

Play audio:

Stream audio to a phone call Android

Answer a phone call with a custom record

I’m open to all kinds of advice and/or implementable solutions, even flashing a new OS on the device or buy some kind of hardware.

New contributor

Matteo Forzan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT