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