This gist shows how to query the contact database using a phone number to retrieve the contact name related to it, if it exists.