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

  1. ; FILE SPORT.SCR (MSMSPORT.SCR)
  2. ; An MS-DOS Kermit script program for dialing the US Robotics Sportster or
  3. ; Courier 14400 or 28800 modem, to be used with MS-DOS Kermit 3.12 or later.
  4. ; The modem is set for RTS/CTS flow control, fixed interface speed of 57600,
  5. ; and to negotiate highest modulation, compression, with error correction
  6. ; with all types of fallback.
  7. ;
  8. ; To use: SET MODEM=SPORT (in DOS, before starting Kermit)
  9. ; or:     DEFINE _MODEM SPORT (in Kermit, before dialing)
  10. ; or:     SET MODEM SPORT (in Kermit, v3.14 or later)
  11. ; and:    Make sure Kermit executes the standard MSKERMIT.INI file.
  12. ;
  13. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993
  14. ; Modified 8 Aug 93 to fix typo (W1 is not a legal Sportster command).
  15. ; 10 Nov 93 - eliminate DSR check.
  16. ; 18 Jan 95 - update for version 3.14, SET CARRIER, etc.
  17. ; 24 Mar 95 - update comments after testing with V.34 model.
  18. ;
  19. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  20. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  21.  
  22. define chkerr if fail stop 1 \%1
  23. define chkok input 3 OK, if fail stop 1 \%1
  24.  
  25. if > VERSION 313 set carrier OFF ; Don't require carrier during dialing.
  26.  
  27. set input echo on        ; So we can watch what happens.
  28. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  29. set input case ignore        ; Use caseless string comparisons
  30.  
  31. set parity none            ; Avoid parity foulups
  32. set flow none            ; Avoid flow control deadlocks
  33. hangup                ; Begin by dropping DTR
  34. pause 1                ; for one second
  35.  
  36. ; Speed.  Don't worry about modem, it autobauds up to 57600 bps.
  37.  
  38. set speed 57600
  39. echo Configuring USR Sportster on \v(line).
  40.  
  41. :INIT
  42. output ATQ0V1&S0I3\13        ; Enable word result codes, turn on DSR
  43. chkok {Can't get modem's attention}
  44. output AT E1 X4 &A3 &D2\13    ; Set echoing, result codes, etc.
  45. chkok {Can't initialize modem}
  46. output AT&B1\13            ; Fixed interface speed
  47. chkok {Can't fix interface speed}
  48. output AT &H1&R2\13        ; RTS/CTS hardware flow control
  49. chkok {Can't enable RTS/CTS}    ; On modem
  50. wait 5 cts
  51. if fail errfail {Modem is not asserting CTS!}
  52. set flow rts/cts        ; And in Kermit too, but only now
  53. output AT &N0\13
  54. chkok {Can't enable modulation fallback}
  55. output AT &K1&M4\13        ; Compression and EC enabled
  56. chkok {Can't enable compression and EC}
  57. output AT &Y3\13        ; Make modem pass BREAK transparently
  58. chkok {Can't become transparent to BREAK}
  59.  
  60. if def \%1 if not equal "\%1" "=" goto BEGIN
  61. echo Modem initialization complete, no number to dial.
  62. end 0
  63.  
  64. :BEGIN                ; Now DIAL.
  65. clear                ; Clear INPUT buffer.
  66. set count 5                     ; Dialing retry counter, 5 tries allowed.
  67. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  68. echo
  69. pause 1
  70. goto dial                       ; 1st time, skip pause and Redialing message
  71.  
  72. :REDIAL
  73. set alarm 30
  74. pause 30            ; Wait 30 seconds before redialing.
  75. if not alarm errfail {Dialing canceled.}
  76. echo Redialing...               ; Message for redialing.
  77. pause 1
  78.  
  79. :DIAL
  80. output ATD\%1\13                ; Dial the number.
  81. set alarm 90            ; (For detecting keyboard interruptions.)
  82. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  83. if < VERSION 313 clear
  84. input 30 \10                    ; Wait for the linefeeds...
  85.  
  86. :GETMSG
  87. input 60 \10            ; ...that surround the response message.
  88. if success goto gotmsg        ; Got a message.
  89. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  90. hangup                ; User interrupted from keyboard,
  91. output \13            ; cancel dialing by sending carriage return,
  92. goto again            ; and go try again right away.
  93.  
  94. :GOTMSG
  95. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  96. if success goto done            ; If so, we're done.
  97. reinput 1 BUSY            ; Line is busy.
  98. if success goto busy        ; Go wait a while and then dial again.
  99. reinput 1 ERROR            ; Command syntax error.
  100. if success errfail {Dialing command error}
  101. reinput 1 NO CARRIER        ; Phone didn't answer or no carrier.
  102. if success errfail {No answer or no carrier}
  103. reinput 1 NO ANSWER        ; No answer
  104. if success errfail {No answer - try again later}
  105. reinput 1 NO DIAL TONE        ; No dialtone when phone taken off hook.
  106. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  107. goto getmsg            ; None of the above, get another message.
  108.  
  109. :BUSY
  110. if < \v(count) 2 goto quit    ; Don't wait 30 seconds if tries are used up.
  111. Echo Line is busy, will dial again in 30 seconds.
  112. echo Press any key to cancel...
  113. output \13            ; CR cancels dialing
  114. hangup                          ; Hang up.
  115. :AGAIN
  116. if count goto redial            ; Then go redial.
  117. :QUIT
  118. errfail {It never answers!  I give up.} ; Too many tries.
  119.  
  120. :DONE                           ; Connected.
  121. echo \7                         ; Celebrate with a beep.
  122. define errfail            ; Erase local macro definitions...
  123. if > VERSION 313 set carrier on ; Require carrier from now on.
  124. end 0                ; Finished, return success code.
  125.  
  126. :FAIL                ; Dialing failed, no beep.
  127. define errfail            ; Erase local macro definitions...
  128. if > VERSION 313 set carrier off ; So they can CONNECT and see what's up...
  129. end 1                ; Return failure code.
  130.  
  131. ; End of SPORT.SCR
  132.