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