简体   繁体   English

如何捕获电话号码

[英]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. 我正在寻找在vb.net或c#.net中创建一个Windows应用程序,它将捕获来电的电话号码。 This would be a land line. 这将是一条土地线。 What would the hardware requirements be? 硬件要求是什么? Which .Net libraries would be used? 将使用哪些.Net库?

You'll need a recent modem that supports Caller ID and is supported by Windows. 您需要一个支持来电显示的最新调制解调器,并且受Windows支持。 Windows provides an API for talking to the modem called Telephony Application Programming Interface, aka TAPI. Windows提供了一个用于与调制解调器通信的API,称为电话应用程序编程接口,即TAPI。 Unfortunately, this API cannot easily be accessed from managed code . 遗憾的是, 无法从托管代码轻松访问此API。

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. 在托管代码中访问来电显示的最佳选择是使用位于TAPI API之上的免费或共享软件TAPI OCX控件之一,其中大多数应该有一个简单的API,可以为您提供传入的号码。 Google for something like 'TAPI OCX' or 'TAPI Caller ID' to see what's available. Google可以使用“TAPI OCX”或“TAPI来电显示”来查看可用的内容。

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. 您将使用标准AT样式命令来控制调制解调器并监视传入数据。

For specific commands and events, check out the Wikipedia article on the Hayes AT command set 有关特定命令和事件,请查看Hayes AT命令集上的Wikipedia文章

If you have a VOIP system, your system provider may have an API available to do this. 如果您有VOIP系统,您的系统提供商可能有一个API可用于执行此操作。 Based on my experience, it will cost extra and be buggy. 根据我的经验,这将花费额外的成本和错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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