by Fran T
An updated version of David Pullen's original version here, which doesn't require root access for later versions of Android:
When an incoming call starts ringing, look up the phone number in your contacts. If not found, end the call, which should be the same as tapping or swiping the reject button. This should send them to voicemail.