Asking modem for Dial tone

  • Thread starter Thread starter Mota
  • Start date Start date
M

Mota

Hi;
Is there an API to query modem and if there is a free dial tone returns
something,and if the connected line is in- use,returns something
else(Checking the line connected to modem,no dialing needed).
Thank you in advance for ur help.
 
You need to pass a command string to the modem, to get it to reply. And you
can set various types of response, at least with Hayes type modems. Look up
the manual for the modem first, to see what you need to send. Or Google for
'Hayes commands'

Sending the string is easy. Open a port to Com1 ( or wherever the modem is
connected ). Print strings to the port. Get responses back with Line
Input.

eg
dim strResponse as string

Open "Com1,9600,n,8,1" for random as #1 'random allows both input and
output.

Print #1,"ATI" 'ATI is a standard Hayes command to return modem information

Line Input#1,strResponse

debug.print strResponse 'just to see what the modem returned.

Close #1 'always close a port you opened

Just from memory "ATO" should put the modem online, and you get a response
to tell you whether the command succeeded, eg "No Dialtone" "Connect xxxx"
etc, depending on how you set up the responses.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top