Softphone with good API for use with external application

I need to be able to get events into an application from a softphone on the same computer whenever the softphone gets a call and goes off and on hook . I also need to be able to initiate a call from the same application. Anyone that can point me to the softphone/API I need?

Thanks for your help,
Martin Altemark