开发者

forward calls to voicemail in android?

I was searching and googleing this topic for more than 2 hours but maybe there's something wrong with my search, cuz i didnt find anything.

can somebody help me in this? any topic, tutorial, piece of code?

I want to monitor incoming calls (I think I'll 开发者_高级运维be able to do this part) and send some of them to voice mail. I'm using Android Level 8 platform 2.2

thanks...


You can send some codes to activate call forwarding to any number at the network operator level, but might not work with ALL operators around the world.

Check here http://en.wikipedia.org/wiki/Call_forwarding

void sendCommand(String command){
    Intent intentCallForward = new Intent(Intent.ACTION_CALL);
    intentCallForward.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Uri uri = Uri.fromParts("tel", command, "#");
    intentCallForward.setData(uri);                                
    startActivity(intentCallForward);
}

Then to forward calls

sendCommand("*21*001234567890#")

And remove call forwarding

sendCommand("##21#")

You can play around with different codes that might suit your needs better


There is an option in Android contact list, it has column in contact's database with int value. in order to do what I asked in my question, you need to change that value in DB.

1 = forward to voicemail

0 = do nothing

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜