数着没有。远程电话中发生的铃声
我创建了一个可以拨打电话的 C# 程序。现在我要做的是计算远程电话设备中发生的响铃次数。
我的 C# 程序使用命令 ATDT [phoneno] 拨打号码。如果远程电话响铃超过 5 次,我就必须执行一些其他活动。
我有什么办法可以实现这个目标吗?
I have created a C# program that can dial a phone. Now what I have to do is count the number of rings occuring in the remote phone device.
My C# program uses the command ATDT [phoneno] to dial the number. If remote phone rings more than 5 times, I have to perform some other activites.
Is there any way I can achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法通过标准调制解调器和串行端口实现这一点。你能做的最好的事情就是暂停。在响铃时,调制解调器只是在启动任何通信之前查找载波信号。它不计算戒指。
如果您绝对必须这样做,则需要从调制解调器获取音频并对其进行处理以获得振铃计数(这并不简单,因为取决于电话网络等,振铃变化很大,并且可能与保持音相混淆)。
You cannot achieve that over a standar modem and serial port. The best you can do is have a timeout. Whilst ringing, the modem just looks out for the carrier signal before initiating any communications. It doesn't count rings.
If you absolutely must do that, it would involve taking the audio from the modem and processing it to get the ring count (not trivial as depending on the telephone network etc, ringing varies considerably and can be confused with hold tones).
据我所知,你无法计算出实际的戒指数量。想象一下一个不响铃但播放歌曲的手持设备。因此,您所能做的就是运行计时器并在达到超时(例如 20 秒)后挂断。
As far as i know you can't count the real number of rings. Just think about a handy that doesn't ring but plays a song. So all you can do is running a timer and hang up after the timeout is reached (e.g. 20 seconds).
根据调制解调器的不同,您应该能够收到响铃通知。打开串行端口进行输入,并在调用线路时观察诸如
RING
之类的单词。您应该能够启动某种计数器并观察线路状态。您可能需要查看设备的高级 AT 命令,以确保其配置为报告这些通知。AT
命令看起来您可能想查看寄存器
S0
和S1
。Depending on the modem you should be able to get a ring notification. Open the serial port for input and watch for a word such as
RING
while the line is called. You should be able to start a counter of some sort and watch the line status. You may need to look at the advanced AT commands for your device to ensure that it is configured to report these notifications.AT
commandsIt looks like you might want to look at registers
S0
andS1
.