I do not know how to forward the calls to voice mail programmatically in android ?
-
Does [this](http://stackoverflow.com/q/7298767/645270) help? (Editing a `SEND_TO_VOICEMAIL` value in a table) – keyser Sep 25 '12 at 12:52
-
If voice mail facility is active on device and after disconnecting the call, It will prompt calling user to leave voice mail. – Santhosh Sep 25 '12 at 12:53
-
how we can active voicemail programmatically – AndroidRaji Sep 25 '12 at 12:54
-
1@AndroidRaji : Keyser is suggesting this http://stackoverflow.com/questions/7298767/set-send-to-voicemail-on-android-contacts link – Santhosh Oct 08 '12 at 07:08
-
are you asking how to activate voice mail or developing an app that will send a phone call straight to voice mail? – Roy James Schumacher Oct 24 '12 at 10:33
-
developing an app that will send a phone call straight to voice mail – AndroidRaji Oct 25 '12 at 04:26
2 Answers
The selected answer is only correct if you want to limit your implementation to the Android public SDK.
It is possible to send a call to voice mail programmatically on Android.
While the phone is ringing, end the call. The call will be diverted to voice mail by the network. In GSM/WCDMA this is a feature called User Determined User Busy or UDUB, it also works on CDMA devices.
There are plenty of answers on SO on how to end a call on Android:
Using Java reflection and the iTelephony interface:
End call in android programmatically or end incoming call programmatically
== Update 2020 ==
Since Android P it is possible to hangup calls using the Android SDK - therefore forwarding to voicemail is now a supported feature of Android.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
TelecomManager tcm = context.getSystemService(TelecomManager.class);
if(tcm != null)
tcm.endCall();
}
Add the necessary permission to AndroidManifest.xml
<uses-permission android:name="android.permission. ANSWER_PHONE_CALLS" />

- 3,074
- 2
- 26
- 39
You can't.
Call forwarding is done by your carrier not by your phone, when the call reaches your phone its too late to forward it.

- 401
- 1
- 6
- 19
-
2Android has a setting in People app that does it, so it must be possible. – powder366 Feb 02 '14 at 11:03