home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msmsupra.scr < prev    next >
Text File  |  2020-01-01  |  6KB  |  125 lines

  1. ; File SUPRV32B.SCR -- minor modification of Christine's HAYES.SCR.
  2. ; To be used with MS-DOS Kermit 3.11 or later.
  3. ; Stored in Kermit Distribution as MSMSUPRA.SCR; rename to SUPRA SCR if
  4. ; necessary so the DIAL macro can find it.  Place this file in your current
  5. ; directory or in any directory in your DOS PATH, and then set the DOS
  6. ; environment variable, MODEM, to be SUPRA.  Give the following command at the
  7. ; DOS prompt before starting Kermit, or add it to your AUTOEXEC.BAT file:
  8. ;
  9. ;   SET MODEM=SUPRA
  10. ; An MS-DOS Kermit script program for dialing a SupraFAXmodem V.32bis modem
  11. ; and compatibles.  Will probably work with the non-fax and V.32 versions of
  12. ; this modem, but this has not been tested.  The Supra, like most V.32/V.32bis
  13. ; modems, is Hayes-compatible up to the point that one starts dealing with
  14. ; buffering, error-correction, and compression modes.
  15. ; The modem setup specified below provides for "error correction call
  16. ; progress" reporting.  This may be useful in making other session decisions,
  17. ; e.g., max packet sizes/windows, and should be displayed to the user.  Also,
  18. ; modem is set up for RTS/CTS, buffering, local flow control, etc. and Kermit
  19. ; is placed into the corresponding modes.  One should not attempt to use one
  20. ; of these things without an adequate shielded cable.  See also the speed
  21. ; discussion below.
  22. ;
  23. ; Lines containing *** may require local editing.
  24. ; Expects variable %\1 to contain the phone number; this is done
  25. ; by the DIAL macro defined in MSKERMIT.INI.
  26. ;
  27. ; Uses ATD (modem's default dialing method) to dial the number.  Force tone
  28. ; dialing by including T as first character of phone number, or pulse dialing
  29. ; by including P as first character.
  30. ;
  31. ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag 
  32. ; if it fails.
  33. ;
  34. ;  Author: John C. Klensin, August 1992 (modified from HAYES.SCR by
  35. ;     Christine M. Gianone (July 1991).  Requires MS-DOS Kermit 3.11 or later.
  36. ;
  37. ; The normal DTE <-> DCE speed of this modem is 57.6 Kbps, regardless of the
  38. ; line or character speed.  Set that number here, regardless of what the
  39. ; DIALUPS file says.  However, this may exceed the speed at which may MSDOS
  40. ; computers can deal with characters and should be reduced if necessary.
  41. ;
  42. echo  Using SupraFaxModem V.32bis\13  ; Comforting in multimodem environment.
  43. set speed 57600                  ;****
  44. ;
  45. set flow rts                          ; Nothing else works at these speeds
  46.                       ; and modem is initialized to it.
  47. def errfail echo \%1,hangup,goto fail ; Macro to handle failures.
  48.  
  49. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE
  50. set input echo off              ; Don't echo the modem test
  51. output AT&F2W1\13               ; Send AT, use word result codes. &F2 is
  52.                                 ; special init for MSDOS. Report ECC progress.
  53. input 2 OK                      ; Modem should say "OK"
  54. if fail errfail {Turn on or connect your modem!}
  55. clear                ; Clear input buffer
  56. ;
  57. if not equ \%1 = goto dialnow   ; This provides for initialization only.
  58. echo Modem initialization completed, no number to dial
  59. end 0
  60. :dialnow
  61. set count 5                     ; Set up dialing retry counter
  62. set input echo on               ; From now on, show what happens
  63. echo Dialing \%1, wait...
  64. pause 1
  65. goto dial                       ; 1st time, skip Redialing message
  66. :REDIAL
  67. set alarm 30
  68. pause 30            ; Wait 30 seconds before redialing.
  69. if not alarm errfail {Dialing canceled.}
  70. echo Redialing...               ; Message for redialing.
  71. pause 1
  72. :DIAL
  73. output ATD\%1\13                ; Dial the number (ATDT or ATDP)
  74. :GETMSG
  75. set alarm 60            ; Detect keyboard interruptions.
  76. input 40 \10                    ; Wait for the linefeeds...
  77. input 20 \10            ; that surround response message.
  78. if success goto gotmsg        ; Got a message.
  79. if alarm errfail {No response from modem.} ; No response in 60 secs.
  80. hangup                ; User interrupted from keyboard,
  81. if count goto redial        ; so try again right away.
  82.  
  83. :GOTMSG
  84. reinput 0 CONNECT               ; Got message, was it CONNECT?
  85. if success goto speed           ; DTE-DCE rate.  Successful, continue
  86. reinput 0 ERROR            ; No, check for command error.
  87. if success errfail {Modem command error.}
  88. reinput 0 CARRIER        ; Connection rate (DCE-DCE)
  89. if success goto getmsg        ; no action
  90. reinput 0 PROTOCOL        ; Error correction type (NONE/LAPM/ALT)
  91. if success goto getmsg        ; no action (=/V.42/MNP)
  92. reinput COMPRESSION        ; Compression type (CLASS 5/V.42BIS/NONE)
  93. if success goto getmsg        ; no action (=MNP5/V.42bis/)
  94. reinput 0 RING            ; Ring signal detected.  Not a Hayes
  95. if success goto getmsg        ; Look for something useful.
  96. reinput 0 NO CARRIER        ; NO CARRIER?
  97. if success goto busy        ; Treat like BUSY.
  98. reinput 0 BUSY                  ; BUSY?
  99. if success goto busy         ; Go wait a bit, then dial again.
  100. errfail {No dialtone or no answer.  Try again later.}
  101.  
  102. :BUSY
  103. if < \v(count) 2 goto quit    ; Don't wait 60 seconds if tries used up.
  104. Echo Busy or No Carrier, will dial again in 30 seconds...
  105. echo Press any key to cancel...
  106. hangup                          ; Hang up.
  107. :AGAIN
  108. if count goto redial            ; Then go redial.
  109. :QUIT
  110. errfail {It never answers!  I give up.} ; Too many tries.
  111.  
  112. ; The following block is retained for compatibility for HAYES.SCR.  Since
  113. ; this modem buffers (always retains the same DCE<->DTE speed), the computer
  114. ; should not speed-match and the next section is a no-op.
  115. :SPEED                          ; Connected!
  116. echo \7                         ; Celebrate with a beep.
  117. define errfail            ; Erase ERRFAIL definition
  118. end 0                ; Finished, return success code.
  119.  
  120. :FAIL                ; Failed, return failure code.
  121. define errfail            ; Erase ERRFAIL definition
  122. end 1
  123.