0

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...

Varand Pezeshkian
  • 520
  • 2
  • 11
  • 22
  • Hey varand, had u get the solution for the above ? i am also want to implement the same functionality , can u help me for the same ? – Ramesh Solanki Jul 23 '12 at 11:01

2 Answers2

1

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

Paulo Taylor
  • 716
  • 8
  • 18
0

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

Varand Pezeshkian
  • 520
  • 2
  • 11
  • 22
  • 2
    That's not necessarily what you asked - I thought you were going to evaluate an incoming call and forward it **at call time** based on some (potentially arbitrary) criteria. What you're doing is simply programmatically declaring some *contacts* to have all future calls send to voicemail (ahead of receiving those calls). – Andrzej Doyle Jan 19 '11 at 18:43
  • Actually I'm evaluating the criteria beforehand, that means once a call is coming, I have already some factors that based on them the incoming call takes the right action. What do you mean by evaluating a call on ringing status(at call time)? bring an example if possible – Varand Pezeshkian Jan 20 '11 at 20:46