Showing posts with label telephony. Show all posts
Showing posts with label telephony. Show all posts

Monday, June 2, 2014

How to create PhoneStateReceiver get CLI and call events

During first 5 years of my career I luckily worked at software houses that created computer telephony related software, I had used Microsoft TAPI and Dialogic APIs to create IVR and Operator Console and Call Recorder software. When I first started Android programming in 2010, I was very curious about phone states and CLI. 





I later figured it out and came to know that a BroadcastReceiver will be the right thing to use in
this case. BroadcastReceiver is a specially designed component offered by Android OS, and
it is used to handle various broadcasts sent by apps or OS components.
The broadcasts related to telephone call states are sent by TelephonyManager which is a
component of Android OS.
The phone state receiver given below can be used in scenarios like call blocking, call tracking,
and sending information to http or cloud based servers.
This salient features of my phone state receiver are given below
  1. Get the CLI from an incoming call
  2. Get the dialled number from an outgoing call
  3. When an inbound call is connected, get informed
  4. When a call is disconnected, get notified

Monday, May 12, 2014

Disconnect Block Drop calls Android 4 and above

The internet is littered with forum posts and articles that tell you it is impossible to block, drop disconnect an incoming or outgoing call using code starting Android version 4 Jelly Bean because Google placed strict restrictions on MODIFY_PHONE_STATE permission. Only the manufacturer signing certificate can grant you MODIFY_PHONE_STATE permission.
block drop disconnect call android

Please check my Udemy course:

There are a lot of call blocker types scenarios in which we need to shield our user from a bad guy's or sour ex-girlfriend's telephone calls.
The good news is that you don't need MODIFY_PHONE_STATE permission to block, drop disconnect an incoming call on Google Android. The technique described here is available to drop block disconnect incoming calls without using the secretive infamous permission.

Time to disclose the secret sauce. A hint first:
Ever tried to dial a call using ADB(Android Debugger Bridge) shell?

If you've done that, it will be straightforward to disconnect or drop a call using a similar technique.
Time to spill the secret sauce on the internet.

Drop call on Android 4 Jelly Bean KitKat and above.