Cory
Cory

Reputation: 259

Is there an API to send calls to voicemail in Android?

I was looking for an API to send incoming calls to voicemail.

I know this can be done using the Contact app that comes with any Android phones. But is there an API for this?

Upvotes: 4

Views: 2383

Answers (2)

siddhusingh
siddhusingh

Reputation: 1868

ContactsContract.RawContacts has got a flag to indicate that call should be forwarded to voice mail

SEND_TO_VOICEMAIL read/write An indicator of whether calls from this raw contact should be forwarded directly to voice mail ('1') or not ('0'). To have an effect on the corresponding value of the aggregate contact, this field should be set at the time the raw contact is inserted.

Upvotes: 2

Ryan Hayes
Ryan Hayes

Reputation: 5310

You can use the PhoneStateListener to see when a call is coming in, but there's no way to connect and control phone calls themselves. Placing a phone call is a core and critical feature of a phone. I'm very sure this reason alone warrants no API for direct manipulation of phone calls.

Upvotes: 1

Related Questions