There are a couple of services that launched recently which allow you to accept phone calls using an API:
These are probably easier than trying to physically receive the phone calls yourself.
If you went for using a modem then you'd obviously need drivers for it and to program against whatever API those drivers exposed.
Either way, you're going to need a way to link the phone call to the session on the website - maybe generating a unique number for each visitor, or by getting them to input a sequence of digits when they call. The workflow would then look something like
- User visits website
- Website generates session ID, provides user phone number
- User rings number
- Call-handling software/script/etc executed by cloudvox/twilio API or modem drivers
- Call is mapped to a session (by inputted number, phone number, etc)
- Caller ID is associated with website session
- User refreshes website or website auto-refreshes
- Website displays Caller ID to user