I would like to know a way to get the phone number of a usb fax modem, using C#
.
Example: I have a computer with a fax modem usb connected to a phone line, when someone calls me my system picks up the number which is meligando and places in textbox
.
I am trying with SerialPort
as follows:
public void GetNumber() {
serialPort.PortName = cbPorta.Text;
serialPort.BaudRate = Convert.ToInt32(cbTxTransmissao.Text);
serialPort.Handshake = Handshake.None;
serialPort.Parity = Parity.None;
serialPort.Open();
var Comando= Encoding.ASCII.GetBytes("AT&Zn?");
serialPort.WriteLine(Comando);
System.Threading.Thread.Sleep(200);
lbStatus.Text = serialPort.ReadLine();
serialPort.Close();
}