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

  1. ; FILE CONN144P.SCR (MSMC144P.SCR)
  2. ; An MS-DOS Kermit script program for dialing the Digicom Connection 144+
  3. ; (previously known as the Connection 96+; there is no functional difference)
  4. ; 14400 modem, to be used with MS-DOS Kermit 3.12 or later.  The modem is set
  5. ; for V.32bis, compression, error correction (if appropriate software loaded),
  6. ; RTS/CTS flow control, fixed interface speed of 115200, 57600, or 38400.
  7. ; NOTE: Compression is enabled only if DATA144B software is loaded in the 
  8. ; modem.  Do not use %C1 to enable compression, because the modem will
  9. ; malfunction if this command is given but DATA144B is not loaded (if it is
  10. ; loaded, compression will be enabled automatically anyway).
  11. ;
  12. ; Rename this file to CONN144P.SCR if necessary.
  13. ;
  14. ; To use: SET MODEM=CONN144P (in DOS, before starting Kermit)
  15. ; or:     DEFINE _MODEM CONN144P (in Kermit, before dialing)
  16. ; and:    Make sure Kermit executes the standard MSKERMIT.INI file.
  17. ;
  18. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, September 1993
  19. ; Adapted from DATAPORT.SCR by Mike Long; January 1994
  20. ;
  21. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  22. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  23. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  24.  
  25. define chkerr if fail stop 1 \%1
  26. define chkok input 3 OK, if fail stop 1 \%1
  27.  
  28. set input echo on               ; So we can watch what happens.
  29. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  30. set input case ignore           ; Use caseless string comparisons
  31.  
  32. set parity none                 ; Avoid parity foulups
  33. set flow none                   ; Avoid flow control deadlocks
  34. hangup                          ; Begin by dropping DTR
  35. pause 1                         ; for one second
  36.  
  37. ; Speed.  Don't worry about modem, it autobauds up to 115200 bps.
  38. ;
  39. set speed 57600                 ; If computer can be set to 57600 bps, use it.
  40. if fail set speed 38400         ; If not, use 38400.
  41.  
  42. echo Configuring Digicom Connection 144+ on \v(line).\13\10
  43.  
  44. :INIT
  45. output ATQ0V1\13                ; Enable word result codes
  46. chkok {Can't get modem's attention}
  47. ; E1 = Echo commands
  48. ; W0 = Don't show error correction & compression status
  49. ; X4 = Verbose result codes, show modulation speed
  50. ; &C1 = CD follows RS232
  51. ; &D2 = DTR follows RS232
  52. output ATE1W1X4&C1&D2\13
  53. chkok {Can't initialize modem}
  54. output AT&K3\13                 ; RTS/CTS hardware flow control
  55. chkok {Can't enable RTS/CTS}    ; On modem
  56. wait 5 cts
  57. if fail errfail {Modem is not asserting CTS!}
  58. set flow rts/cts                ; And in Kermit too, but only now
  59. output AT\92N5\13               ; Auto-reliable V.42, and V.42bis enabled
  60. chkok {Can't enable compression or error correction}
  61. output AT&V\13                  ; Show modem configuration
  62. chkok {Can't display configuration}
  63. echo Firmware version:\13\10
  64. output ATI3\13                  ; Show modem software version
  65. chkok {Can't determine modem software version}
  66.  
  67. if def \%1 if not equal "\%1" "=" goto BEGIN
  68. echo Modem initialization complete, no number to dial
  69. end 0
  70.  
  71. :BEGIN                          ; Now DIAL.
  72. clear                           ; Clear INPUT buffer.
  73. set count 5                     ; Dialing retry counter, 5 tries allowed.
  74. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  75. echo
  76. pause 1
  77. goto dial                       ; 1st time, skip pause and Redialing message
  78.  
  79. :REDIAL
  80. set alarm 30
  81. pause 30                        ; Wait 30 seconds before redialing.
  82. if not alarm errfail {Dialing canceled.}
  83. echo Redialing...               ; Message for redialing.
  84. pause 1
  85.  
  86. :DIAL
  87. output ATD\%1\13                ; Dial the number.
  88. set alarm 90                    ; (For detecting keyboard interruptions.)
  89. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  90. if < VERSION 313 clear
  91. input 30 \10                    ; Wait for the linefeeds...
  92.  
  93. :GETMSG
  94. input 60 \10                    ; ...that surround the response message.
  95. if success goto gotmsg          ; Got a message.
  96. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  97. hangup                          ; User interrupted from keyboard,
  98. output \13                      ; cancel dialing by sending carriage return,
  99. goto again                      ; and go try again right away.
  100.  
  101. :GOTMSG
  102. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  103. if success goto done            ; If so, we're done.
  104. reinput 1 BUSY                  ; Line is busy.
  105. if success goto busy            ; Go wait a while and then dial again.
  106. reinput 1 ERROR                 ; Command syntax error.
  107. if success errfail {Dialing command error}
  108. reinput 1 NO CARRIER            ; Phone didn't answer or no carrier.
  109. if success errfail {No answer or no carrier}
  110. reinput 1 NO ANSWER             ; No answer
  111. if success errfail {No answer - try again later}
  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 CONN144P.SCR
  137.