I have this idea where I want to allow someone to call a phone number from their c开发者_StackOverflowell phone, and then a website would display their caller ID. I want to do this in php, but I'm really not sure how. I'm pretty good with PHP and I'm assuming you need some kind of GSM modem attached to the web server to accept the incoming phone calls, but that's really as far as I can get. If anyone can point me in the right direction that would be great.
There are a couple of services that launched recently which allow you to accept phone calls using an API:
- http://cloudvox.com/
- http://www.twilio.com/
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
精彩评论