简体   繁体   中英

How to capture a Phone Number

I'm looking to create a windows application in vb.net or c#.net that will capture the phone number of incoming calls. This would be a land line. What would the hardware requirements be? Which .Net libraries would be used?

You'll need a recent modem that supports Caller ID and is supported by Windows. Windows provides an API for talking to the modem called Telephony Application Programming Interface, aka TAPI. Unfortunately, this API cannot easily be accessed from managed code .

Your best bet for getting access to Caller ID in managed code would be to use one of the free or shareware TAPI OCX controls that sit on top of the TAPI API, most of them should have a simple API that would give you the incoming number. Google for something like 'TAPI OCX' or 'TAPI Caller ID' to see what's available.

If it's a landline you're talking about, all you would need would be a standard analog modem and a serial port to connect it to. You'd use standard AT-style commands to control the modem and monitor incoming data.

For specific commands and events, check out the Wikipedia article on the Hayes AT command set

If you have a VOIP system, your system provider may have an API available to do this. Based on my experience, it will cost extra and be buggy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM