How to get Caller ID in C#?(如何在 C# 中获取来电显示?)
问题描述
我想使用 56K 调制解调器来获取拨打家庭电话的电话号码.有没有办法用 C# 实现这一点?
I want to use 56K modem for getting telephone number of who calls the home phone. Is there a way to achieve this with C# ?
推荐答案
并非所有调制解调器都支持来电显示.对于那些这样做的人来说,不同制造商的实施方式各不相同.
Not all modems support caller ID. And for those that do, the implementation varies between manufacturers.
来电显示通过串行数据传递,因此您必须使用 TAPI 库(或 Windows 的超级终端来测试它).来电显示号码通常出现在第一次和第二次响铃之间.
There caller ID is passed through the serial data so you will have to use the TAPI library (or Windows' HyperTerminal to test it). The caller ID number typically appears between the first and the second ring.
您需要向调制解调器发出命令以激活来电显示.通常:
You will need to issue a command to the modem to activate caller ID. Typically:
AT#CID=1(或AT+VCID=1)
好的
检查您的调制解调器的文档.
Check the documentation for your modem.
当有来电时,调制解调器会收到一个呼叫字符串.通常:
When a call comes in, the modem will receive the a call string. Typically:
戒指
然后来电显示文本会进来.如果我没记错的话,它的形式是:
Then the caller ID text will come in. If I am remembering correctly, it will be in the form:
NMBR=XXXXXXXXXX
[我正在寻找参考资料.当我找到它时,我会发布一个链接]
更新:啊,找到了.查看此页面,了解各种调制解调器的命令和连接字符串:
UPDATE: Ah, found one. Check out this page for the commands and connection strings for for various modems:
如何测试调制解调器以支持来电显示
这篇关于如何在 C# 中获取来电显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 C# 中获取来电显示?
基础教程推荐
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
