I use this script to gather caller id information from my colleagues.
This script is written to work with Snom phones but can be modified to suit any phone that can hit an http url when certain events happen on the phone. I use Snom's "Incoming Call/ On Connected" Action URL field to fire this...