home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / callwait.zip / CALLWAIT.BAS next >
BASIC Source File  |  1986-12-03  |  2KB  |  43 lines

  1. 10 'This short program may solve the problem of call waiting interrupting
  2. 20 'a communications session. Just run this before your communcations
  3. 30 'program. It remains in effect until you reset your Hayes compatible
  4. 40 'modem.  If your communication program resets the modem as it starts,
  5. 50 'you may have to start your communication program first and then
  6. 60 'exit to DOS to run this program before dialing a number.  You may
  7. 70 'be able to call the phone company to get a procedure to temporarily
  8. 80 'disable call waiting.  This service is available in some areas.
  9. 90 '
  10. 100 '   Modified 12/3/86 by Mike Todd, SysOp, IBMSIG, The Source
  11. 110 '
  12. 120 CLS:LOCATE 8,15
  13. 130 PRINT CHR$(7);"Setting Hayes compatible modem for Call Waiting"
  14. 140 OUT 1020,4:GOSUB 220:OUT 1020,3:GOSUB 220
  15. 150 OPEN "COM1:1200,N,8,1,RS,CD,DS" AS #1:GOSUB 220
  16. 160 MSG$="ATS10=200"+CHR$(13):GOSUB 210:GOSUB 220
  17. 170 CLOSE
  18. 180 LOCATE 10,1:PRINT SPACE$(80)
  19. 190 LOCATE 10,22:PRINT CHR$(7);"Now to your communication program!"
  20. 200 SYSTEM
  21. 210 FOR X=1 TO LEN(MSG$):PRINT #1,MID$(MSG$,X,1);:NEXT
  22. 220 X!=TIMER:Y!=TIMER:WHILE Y!-X!<2:Y!=TIMER:WEND
  23. 230 RETURN
  24. 240 '
  25. 250 ' Line 35: Port 1020 (3FC) is the MCR (Modem Control Register). The
  26. 260 '          bits are described on page 6-9 of the Hayes Smartmodem
  27. 270 '          1200 manual. First CW sends a 4, which enables the
  28. 280 '          interrupt line drivers, and allows the UART to interrupt
  29. 290 '          the controller. If there are any problems with the serial
  30. 300 '          port, this command should generate an error message.
  31. 310 '          OUT 1020,3 will reset the modem and is equivalent to
  32. 320 '          power off/power on. This must be held for at least 50 ms.
  33. 330 '          This is done using the timing loop at line 110 which will
  34. 340 '          wait at least an entire second before continuing.
  35. 350 '
  36. 360 ' Line 40: Open the COM1 port for 1200 baud, no parity and 8 bit words
  37. 370 '          using buffer #1.
  38. 380 '
  39. 390 ' Line 50: Sends a command to the modem. The AT is the ATtention code,
  40. 400 '          which must precede all modem commands. The S10=200 is
  41. 410 '          described on page 6-7 of the manual. It allows the carrier
  42. 420 '          signal to momentarily disappear adjustable in 1/10 second.
  43.