Android: Detect the time when an outgoing call starts ringing on the other phone

8

I need to know if there is any way (although I am almost convinced that there is no way) to detect when an outgoing call starts to ring on the destination phone.

What I need to know specifically is just THE INSTANT where the phone call starts on the other person's phone, and then, if possible, the duration of the phone call before it is attended or hung. The latter does not matter since I only need the time it is being stamped regardless of whether it is hung or hangs up.

I have been searching for google for a long time and the solutions they give are 0. I have also searched for SO in English, such as here and here , where I'm practically the only one who has given them answers saying it's impossible to do it (based on my experience and my research all over the internet ), but I would like to know if anyone from this community knows any way to do this.

This is another similar question, from SOes, and also without answers. What is asked in a more specific way, using the class Visualizer and I ask from a more general point of view, that is by any way that exists.

Concluding, all the questions I have found on other sites on this subject are absolutely unanswered and I have not managed to find a way to achieve it. Please, if someone knows a way to do this, I would greatly appreciate it, since I have been dealing with this problem for a long time. Thanks for your attention. Greetings

    
asked by Adriana Hernández 24.08.2017 в 19:40
source

2 answers

1

I think it is not possible, when you make a call from a mobile that call is picked up by the antenna that gives service to the mobile operator and arrives at its switching center, if the mobile you are calling is from the same operator It already sends the call from the central station to the antenna that serves the mobile destination and if it is from another operator, it sends it to the central office of the other operator and it is she who sends the call to the antenna. Counting the time since the call is issued, I think it is not very precise because if there is saturation in the operators' lines or if there is a problem in the call routing or the link between the different operators is down, the if in fact the call is not being made correctly or later than the account in arriving at the destination mobile.

    
answered by 12.09.2018 в 15:25
0

Well I think that there is a way, in Android there is a Action Intent that can be useful to you:

  

Broadcast intent action indicating that the call state on the device has changed.

     

The EXTRA_STATE extra indicates the new call state. If the new state is RINGING, a second extra EXTRA_INCOMING_NUMBER provides the incoming phone number as a String.

The idea is to use ACTION_PHONE_STATE_CHANGED to know the instant when a new call comes in. Here's an example of how to do it . The system gives you the number of the person who is calling, so you can use it to filter the calls that interest you.

If you're not familiar with BroadcastReceivers I'll explain a little. By registering your app with the ACTION_PHONE_STATE_CHANGED intent, you are telling the system that you want to be notified when there is "A change in the phone's call status". When that action occurs, the system will notify your app and execute the code you have declared, regardless of whether your app is being used by the user or not.

    
answered by 27.08.2017 в 20:42