【问题标题】:How to get phone number when have an incoming call on PCI modemPCI调制解调器有来电时如何获取电话号码
【发布时间】:2014-05-01 04:30:58
【问题描述】:

我想构建类似 callerID 应用程序的 java 应用程序。
当有来电时,此应用程序将在文本框中显示电话号码。
我使用 serialEvent 功能并检测到何时有传入。 但我刚刚收到 RING 文本。

public synchronized void serialEvent(SerialPortEvent oEvent) {
    if (oEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
        try {
            String inputLine=input.readLine();
            System.out.println(inputLine);
        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }
}

我们怎样才能得到电话号码?

ps:我用的是 PCI 调制解调器

【问题讨论】:

  • 是否有设备或协议调用的数据表或其他内容?也许有一个串行命令来询问它。
  • @DeadChex 你有例子吗?
  • 很遗憾,没有,我快速查看,只能找到要求调制解调器拨打号码的命令,而不是当前状态。也许在网络上进行一些挖掘会发现一些事情
  • 环顾四周,并在答案中发布了信息和来源。让我知道这是否有效,我对此很好奇。

标签: java telephony rxtx


【解决方案1】:

您可能必须向调制解调器发送串行命令并等待它回复。环顾网络,我发现了这个:

   AT commands are issued to the modem to control the modems operation
and software configuration. The basic command syntax is as follows:

<command><parameter>

The <command> is a combination of the attention prefix (AT) followed by
the AT command.

然后是这些特定的命令(似乎需要那个“AT”的东西):

I10, I11 Displays connection information. If the modem has not
connected with a remote DCE the ATI 11 commands returns -
No Previous Call.

因此,如果您发送调制解调器“ATI10”或“ATI11”,它似乎会告诉您它的状态,其中可能包括它所连接的电话号码。

还有这些命令可以将传入的号码打印到串口:

+VCID=<value> Caller ID
Use this command to enable or disable caller ID.
+VCID=0 Disable caller ID.
+VCID=1 Enable caller ID with formatted presentation.
+VCID=2 Enable caller ID with out formatting.

同样,我认为它需要 AT 前缀。

我无法测试其中任何一个,但本指南似乎很好地描述了许多串行命令,并且是我从中提取信息的地方:

http://www.airlinkplus.com/manuals/m-aml001.pdf

【讨论】:

    猜你喜欢
    • 2011-11-04
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-13
    • 2020-01-04
    • 1970-01-01
    相关资源
    最近更新 更多