Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Call On Hold

I wanted to know if there is any definitive way to know if the call is put on hold by the receiver on the receiver side only.

Now I checked the Telephony documentation, and this shows that there are three states for a call :

  1. CALL_STATE_IDLE: When no call activity is there
  2. CALL_STATE_RINGING: When a new call is ringing and waiting to be taken up.
  3. CALL_STATE_OFFHOOK: At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting.

Here lies the problem, OFFHOOK takes the active and hold state as one. There seems to be no way to distinguish between them. But an interesting observation I made was that dialler recieves a notification when the call is retrieved from hold, that means there exists some way to know the difference. Hence, I would be obliged if you assist me in finding that way.

like image 405
DevangM Avatar asked Nov 10 '22 09:11

DevangM


1 Answers

It looks like the current Telephony APIs doen't let you read the precise call state.

In this commit, however https://github.com/android/platform_frameworks_base/commit/c5ac15a3e11c03951e269b243674858411204b67 You can see a proposal for a precise call state monitoring.

https://android-review.googlesource.com/#/c/60660/ Here you can see that at Feb 13 5:26 AM this "Change has been successfully merged into the git repository."

This means that sooner or later we'll see it in a future Android release.

like image 129
araks Avatar answered Nov 14 '22 23:11

araks