简体   繁体   English

在PCI调制解调器上打入电话时如何获取电话号码

[英]How to get phone number when have an incoming call on PCI modem

I want to build the java application like callerID application. 我想建立像callerID应用程序的Java应用程序。
When having an incoming call then this application will show phone number in the textbox. 当有来电时,此应用程序将在文本框中显示电话号码。
I use serialEvent function and detected when have incoming. 我使用serialEvent函数,并在收到消息时进行检测。 But I just got RING text. 但是我刚收到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());
        }
    }
}

How can we get the phone number? 我们如何获得电话号码?

ps: I use PCI modem ps:我使用PCI调制解调器

You may have to send the modem a serial command and wait for it to reply. 您可能必须向调制解调器发送串行命令,然后等待其回复。 Looking around the web I found this: 环顾网络,我发现了这一点:

   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.

And then these specific commands (that seem to need that "AT" thing): 然后是这些特定的命令(似乎需要“ AT”东西):

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

So it seems if you send the modem "ATI10" or "ATI11" it'll tell you it's status, which may include the phone number it's connected to. 因此,如果您发送调制解调器“ ATI10”或“ ATI11”,它会告诉您其状态,其中可能包括其连接的电话号码。

There's also these commands which might enable printing the incoming number to the serial port: 还有以下命令可以启用将输入号码打印到串行端口:

+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.

Again, I think it needs the AT prefix. 同样,我认为它需要AT前缀。

I have no way to test any of these, but this guide seems to give a good description of a lot of the serial commands and is where I pull my info from: 我没有办法测试其中的任何一个,但是本指南似乎很好地描述了许多串行命令,并且在这里我可以从中获取信息:

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

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

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