OK, I'll give it a go.
Here's the basic syntax(Python):
import android
droid = android.Android()
Phonenum = droid.queryContent('content://com.android.contacts/data/phones', ['data1', 'data2', 'data3'], 'data2 == 0 and data3 = "Google Voice" and display_name = "' + strSender +'"', None, None).result
var = droid.queryContent(URI of the contact database to query,
[Columns to return],
db query,
query attributes(I've never used this),
sort(haven't used this either))
There are 3 main databases in contacts: Contacts, RawContacts, and Data. There's also a phone db for caller ID lookup.
I don't remember all the URI's but here's a couple: Data - 'content://com.android.contacts/data'
Phone - 'content://com.android.contacts/data/phones'
I was looking for Nicknames and display pic URI's but there's alot in there, do some queries with differnt conditions and see what's there.