I need help from somebody that knows about modems. VB.Net too.

I’ve never worked with modems that much before, and I’m stuck. I’m trying to write an app that will call a modem every so often and then do something based on whether or not the modem answers/doesn’t answer/is busy, etc. I’ve got far enough where I can get to my modem and call the remote one, but I don’t know how to “ask” the modem what it’s doing. Here’s what I’ve got so far:


        Try
            ' Enable the timer.
            Me.tmrReadCommPort.Enabled = True
            ' Attempt to open the port.
            m_CommPort.Open(m_ModemPort, 115200, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 4096)

            ' Write an user specified Command to the Port.
           m_CommPort.Write(Encoding.ASCII.GetBytes("atd1234567" & Chr(13)))
            ' Sleep long enough for the modem to respond and the timer to fire.
            System.Threading.Thread.Sleep(200)
            Application.DoEvents()
            Stop
            m_CommPort.Close()

        Catch ex As Exception
            ' Warn the user.
            MessageBox.Show("Unable to communicate with Modem")
        Finally
             Me.tmrReadCommPort.Enabled = False
        End Try



Where the ‘stop’ is now is where I want to poll the modem; Is it ringing? Has it answered? Is it busy? Are there AT commands to do that? Is it a property or method of the port? :confused:

Thanks in advance.

I hate having to ask, but when Google and luck fail you. . .

I think you’ll need to read from the COM port to see what message comes back. You should get a “CONNECTED” message if there was an answer and “NO CARRIER” if there was some sort of problem. Depending on the modem I think you can tell it to give more details on the “NO CARRIER” message so you can tell if it was busy or not.

That’s what I’d try.