Conexao com o modem

fiz algumas alteracoes nesse programa. Bem o q queria q ele fizesse era q quando o telefone tocasse ele identificasse o numero q está ligando mas o modem manda apenas a resposta(Ring) q o telefone está tocando, alguem poderia me dizer como faço para identificar a chamada?

aí vai o código:


import java.io.*;
import javax.comm.*;
import java.util.*;
/**
* Read from multiple Serial ports, notifying when data arrives on any.
*/
public class SerialLogger {
	public static void main(String[] argv)
		throws IOException, NoSuchPortException, PortInUseException,
		UnsupportedCommOperationException {

		new SerialLogger();
}
/* Constructor */
public SerialLogger()
	throws IOException, NoSuchPortException, PortInUseException,
	UnsupportedCommOperationException {
	// get list of ports available on this particular computer,
	// by calling static method in CommPortIdentifier.
	Enumeration pList = CommPortIdentifier.getPortIdentifiers();
	// Process the list, putting serial and parallel into ComboBoxes
	while (pList.hasMoreElements()) {
		CommPortIdentifier cpi = (CommPortIdentifier)pList.nextElement();
		//String name = cpi.getName();
		//System.out.print("Port " + name + " ");
		if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) {
			String name = cpi.getName();
			if(name.equals("COM2")){
				System.out.println("Serial Port: " + name);
				//System.out.println("is a Serial Port: " + cpi);
				SerialPort thePort;
				try {
					thePort = (SerialPort)cpi.open("Logger", 1000);
				}
				catch (PortInUseException ev) {
					System.err.println("Port in use: " + name);
					continue;
				}
			// Tell the Comm API that we want serial events.
				//thePort.notifyOnDataAvailable(true);
				thePort.notifyOnDataAvailable(true);
				try {
					thePort.addEventListener(new Logger(cpi.getName(), thePort));
				}
				catch (TooManyListenersException ev) {
			// "CantHappen" error
					System.err.println("Too many listeners(!) " + ev);
					System.exit(0);
				}
			}
		}
	}
}

	/** Handle one port. */
	public class Logger implements SerialPortEventListener {
	
		String portName;
		SerialPort thePort;
		BufferedReader ifile;
	
		public Logger(String name, SerialPort port) throws IOException {
			portName = name;
			thePort = port;
			// Make a reader for the input file.
			ifile = new BufferedReader(
			new InputStreamReader(thePort.getInputStream()));
		}
	
		public void serialEvent(SerialPortEvent ev) {
			String line;
		
			try {
				line = ifile.readLine();

				if (line == null) {
					System.out.println("EOF on serial port.");
					System.exit(0);
				}
			
				System.out.println(portName + ": " + line);
				System.out.println("tamanho line " + line.length());
				System.out.println(line.getBytes().toString());
			}
			catch (IOException ex) {
				System.err.println("IO Error " + ex);
			}
		}
	}

}

E o seguinte cara! para que o modem possa captar os numeros do telefone que esta te ligando a sua linha telefonica teve possuir tons identificadores de chamada! e para se ter isso vc tem que pagar uma taxinha junto a sua operadora telefonica, isso se sua operadora telefonica fornece o servico!

Exato…sem suma uma BINA…mas tenque pagar!!!

Oi amigo,
certo é que com um identificador de chamada pode identificar as chamadas, mas cuidado porque se alguem liga ocultando o numero dele (o que acontece com algum celular quando aparece numero privado), eu acho que nem o identificador de chamada consegue identificar o numero.

sei q faz tempo q ninguem faz perguntas, mas o teu modem era externo?
ou onboard??? se for onboard como fez para funcionar a api comm