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

  1. ; FILE ZOOM.SCR
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the Zoom 14400 (V.32bis)
  4. ; modem, to be used with MS-DOS Kermit 3.11 or later.  The modem is set
  5. ; up for compression, error correction, all types of fallback.
  6. ; RTS/CTS flow control, fixed interface speed of 57600 or 38400.
  7. ;
  8. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993.
  9. ;   PP14400.SCR adapted for Zoom modem by:
  10. ;   Phillip Feldman <feldman@wiener.pstat.ucsb.edu>, Sept 1993.
  11. ;   This script is almost identical to PP14400.SCR.  Changes:
  12. ;   a) Setting S46=2 does not work with Zoom modem.  Must use S46=138.
  13. ;   b) Default delay before execution of forced hangup is 20 seconds;
  14. ;   S38=1 reduces this to 1 second.
  15. ;
  16. ; Revised April 1995 to account for RPI models.
  17.  
  18. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  19. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  20. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  21.  
  22. define chkerr if fail stop 1 \%1
  23. define chkok input 3 OK, if fail stop 1 \%1
  24.  
  25. set input echo on               ; So we can watch what happens.
  26. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  27. set input case ignore           ; Use caseless string comparisons
  28.  
  29. set parity none                 ; Avoid parity foulups
  30. set flow none                   ; Avoid flow control deadlocks
  31. hangup                          ; Begin by dropping DTR
  32. pause 1                         ; for one second
  33.  
  34. ; Speed.  Don't worry about modem, it autobauds up to 57600.
  35.  
  36. set speed 57600                 ; If computer can be set to 57600 bps, use it.
  37. if fail set speed 38400         ; If not, use 38400.
  38.  
  39. echo Configuring Zoom Telephonics 14400 bps modem on \v(line).
  40.  
  41. :INIT
  42. output ATQ0V1\13                ; Enable word result codes
  43. chkok {Can't get modem's attention}
  44.  
  45. output AT E1 W1 &D2 S95=47 X4\13 ; Echoing, result codes, etc.
  46. chkok {Can't initialize modem}
  47.  
  48. echo Enabling modulation negotiation...
  49. output AT S37=11 N1\13          ; Start modulation speed negotiation at V32bis
  50. chkok {Can't enable modulation speed negotiation}
  51. echo Enabling hardware flow control...
  52. output AT &K3\13                ; RTS/CTS hardware flow control
  53. chkok {Can't enable RTS/CTS}    ; On modem
  54. wait 5 cts
  55. if fail errfail {Modem is not asserting CTS!}
  56. set flow rts/cts                ; And in Kermit too, but only now
  57. echo Configuring modem to ignore BREAK...
  58. output AT S82=128\13            ; Make modem ignore BREAK
  59. chkok {Can't become transparent to BREAK}
  60. echo Enabling error correction and data compression...
  61. output AT &Q5 S36=7 S46=138\13  ; Enable error correction & compression
  62.                                 ; with automatic speed buffering
  63. input 3 OK
  64. if success goto FHD        ; Watch out for RPI models.
  65. echo
  66. echo WARNING:\7  Your modem apparently does not have built-in error
  67. echo correction and compression.  This can result in a poor connection.
  68. echo See your modem manual.
  69. echo 
  70. :FHD
  71. echo Reduce forced hangup delay to 1 second...
  72. output AT S38=1\13
  73. chkok {Can't set forced hangup delay}
  74.  
  75. if def \%1 if not equal "\%1" "=" goto BEGIN
  76. echo Modem initialization complete, no number to dial
  77. end 0
  78.  
  79. :BEGIN                          ; Now DIAL.
  80. clear                           ; Clear INPUT buffer.
  81. set count 5                     ; Dialing retry counter, 5 tries allowed.
  82. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  83. echo
  84. pause 1
  85. goto dial                       ; 1st time, skip pause and Redialing message
  86.  
  87. :REDIAL
  88. set alarm 30
  89. pause 30                        ; Wait 30 seconds before redialing.
  90. if not alarm errfail {Dialing canceled.}
  91. echo Redialing...               ; Message for redialing.
  92. pause 1
  93.  
  94. :DIAL
  95. output ATD\%1\13                ; Dial the number.
  96. set alarm 90                    ; (For detecting keyboard interruptions.)
  97. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  98. if < VERSION 313 clear
  99. input 30 \10                    ; Wait for the linefeeds...
  100.  
  101. :GETMSG
  102. input 60 \10                    ; ...that surround the response message.
  103. if success goto gotmsg          ; Got a message.
  104. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  105. hangup                          ; User interrupted from keyboard,
  106. output \13                      ; cancel dialing by sending carriage return,
  107. goto again                      ; and go try again right away.
  108.  
  109. :GOTMSG
  110. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  111. if success goto done            ; If so, we're done.
  112. reinput 1 BUSY                  ; Line is busy.
  113. if success goto busy            ; Go wait a while and then dial again.
  114. reinput 1 ERROR                 ; Command syntax error.
  115. if success errfail {Dialing command error}
  116. reinput 1 NO CARRIER            ; Phone didn't answer or no carrier.
  117. if success errfail {No answer or no carrier}
  118. reinput 1 NO DIALTONE           ; No dialtone when phone taken off hook.
  119. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  120. goto getmsg                     ; None of the above, get another message.
  121.  
  122. :BUSY
  123. if < \v(count) 2 goto quit      ; Don't wait 30 seconds if tries are used up.
  124. Echo Line is busy, will dial again in 30 seconds
  125. echo Press any key to cancel...
  126. output \13                      ; CR cancels dialing
  127. hangup                          ; Hang up.
  128. :AGAIN
  129. if count goto redial            ; Then go redial.
  130. :QUIT
  131. errfail {It never answers!  I give up.} ; Too many tries.
  132.  
  133. :DONE                           ; Connected.
  134. echo \7                         ; Celebrate with a beep.
  135. define errfail                  ; Erase local macro definitions...
  136. end 0                           ; Finished, return success code.
  137.  
  138. :FAIL                           ; Dialing failed, no beep.
  139. define errfail                  ; Erase local macro definitions...
  140. end 1                           ; Return failure code.
  141.  
  142. ; End of ZOOM.SCR
  143.