Cisco Unified Communication Manager provides 2 CTI interfaces - Cisco JTAPI and Cisco TAPI. SDK for both can be downloaded from admin page of CUCM (Applications -> Plugins).
When you install Cisco JTAPI you will see jtrace sample application with source code in JTAPI64Tools directory. You should be able to use this sample app to observe calls to an extension and find the calling address.