Modem Pool Dialing Script

Steven F. Johnson (steve@net-link.net)
Fri, 27 Sep 1996 07:47:21 -0400

I do off-site tech support for an ISP in Michigan; I routinely dial our
phone numbers to verify that they're working properly. The script below
runs in Telemate for Windows on my computer; I grep the output file looking
for the ">>> No Answer" message, which includes the phone number.

============================================================================
=========
Telemate for Windows script NLSMODEM.TWS:
----------------------------------------------------------------------------
---------
STRING phonenumber, filename
INTEGER TimeoutDelay

TimeoutDelay = 30

OPEN "MODEMLST.TXT"

IF NOT SUCCESS
PRINT "File not found."
STOP ; stop if file not found
ENDIF

PUT "~ATZ"
WAITFOR "OK", 5
IF NOT FOUND
STOP
ENDIF
PUT "~ATL2M1W1"
WAITFOR "OK", 5
IF NOT FOUND
STOP
ENDIF

READ phonenumber ; read the phone number to dial
WHILE SUCCESS ; repeat until end of file
PUT "~~ATDT", phonenumber
WAITFOR "connect", "no carrier", "no dialtone", "busy", "no answer", Timeout
Delay
PRINT
PRINT phonenumber,
IF FOUND
SWITCH FOUND
CASE 1: PRINT ">>> ", phonenumber, " Connected."
CASE 2: PRINT ">>> ", phonenumber, " Answered, No Carrier"
CASE 3: PRINT ">>> ", phonenumber, " No Dialtone - Can't Dial"
CASE 4: PRINT ">>> ", phonenumber, " Busy."
CASE 5: PRINT ">>> ", phonenumber, " No Answer."
ENDSWITCH
ELSE
PRINT ">>> ", phonenumber, " No Answer."
ENDIF
PUT "~~~~+++~~~~",
PUT "ATH0~~~"
WAITFOR "OK", 5
IF NOT FOUND
PUT "ATH"
WAITFOR "OK", 5
IF NOT FOUND
STOP
ENDIF
ENDIF

READ phonenumber

ENDWHILE
----------------------------------------------------------------------------
---------
End of NLSMODEM.TWS
============================================================================
=========

The phone number list is an external file, which looks like:

============================================================================
=========
Phone number list file MODEMLST.TXT
----------------------------------------------------------------------------
---------
384-8824
384-8864
345-2822
384-8872
342-4854
342-4248
----------------------------------------------------------------------------
---------
End of MODEMLST.TXT
============================================================================
=========
Please let me know if we can be of any further assistance.

+------------------------+----------------------------------+
| Steven F. Johnson | Kalamazoo: (616) 345-5465 |
| NetLink Systems L.L.C. | Battle Creek: (616) 969-0200 |
| P. O. Box 541 | Fax: (616) 345-0763 |
| Kalamazoo, MI 49081 | e-mail: steve@net-link.net |
+------------------------+----------------------------------+