PDA

Click to See Complete Forum and Search --> : Check to see if phone is busy.


UrinatinventuM
Nov 16th, 2001, 05:01 AM
Hi There,

I want to check if a phone (modem, ISDN) connected to my computer is available or not, so I can see if I can make a call or not.
It doesn't have to be connected to the internet, but it could also be that I am calling to another person with this device (now why would I do that? :)).

Greetz,
Bart

PS: I tried it this way, but I heard this doesn't work with ISDN:

Public Function ModemBusy(iComPortNo As Integer) As Boolean

Dim iFreeFile As Integer

On Error GoTo ErrorHandling

iFreeFile = FreeFile()

' Open the communications port.
Open "COM" & iComPortNo & ":" For Output As #iFreeFile
' Send attention (AT).
Print #iFreeFile, "AT"
ModemBusy = False

ExitGracefully:
On Error Resume Next

' Close the port.
Close #iFreeFile

Exit Function

ErrorHandling:
ModemBusy = True
Resume ExitGracefully

End Function