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

  1. ; FILE BOCA.SCR
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the BOCA 14.4 (V.32bis)
  4. ; Faxmodem, to be used with MS-DOS Kermit 3.13 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.
  7. ;
  8. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, March 1994.
  9. ;
  10. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  11. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  12. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  13.  
  14. define chkerr if fail stop 1 \%1
  15. define chkok input 3 OK, if fail stop 1 \%1
  16.  
  17. set input echo on               ; So we can watch what happens.
  18. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  19. set input case ignore           ; Use caseless string comparisons
  20.  
  21. set parity none                 ; Avoid parity foulups
  22. set flow none                   ; Avoid flow control deadlocks
  23. hangup                          ; Begin by dropping DTR
  24. pause 1                         ; for one second
  25.  
  26. ; Speed.  Modem autobauds up to 57600.
  27.  
  28. set speed 57600                 ; Use high interface speed.
  29.  
  30. echo Configuring BOCA 14.4 Faxmodem on \v(line) at \v(speed) bps...
  31.  
  32. :INIT
  33. output ATQ0V1\13                ; Enable word result codes
  34. chkok {Can't get modem's attention}
  35.  
  36. output AT E1 W1 &D2 S95=47 X4\13 ; Echoing, result codes, etc.
  37. chkok {Can't initialize modem}
  38.  
  39. echo Enabling modulation negotiation...
  40. output AT F1 S37=11 N1\13       ; Start modulation speed negotiation at V32bis
  41. chkok {Can't enable modulation speed negotiation}
  42. echo Enabling hardware flow control...
  43. output AT &K3\13                ; RTS/CTS hardware flow control
  44. chkok {Can't enable RTS/CTS}    ; On modem
  45. wait 5 cts
  46. if fail errfail {Modem is not asserting CTS!}
  47. set flow rts/cts                ; And in Kermit too, but only now
  48. echo Configuring modem to ignore BREAK...
  49. output AT S82=128\13            ; Make modem ignore BREAK
  50. chkok {Can't become transparent to BREAK}
  51. echo Enabling error correction and data compression...
  52. output AT &Q5 S36=7 S46=138\13  ; Enable error correction & compression
  53.                                 ; with automatic speed buffering
  54. chkok {Can't enable compression EC and fallback}
  55. echo Fixing interface speed...
  56. output AT \{92}N3 S48=7\13      ; Fix speed, start EC negotiation with LAPM
  57. chkok {Can't fix interface speed}
  58. echo Reduce forced hangup delay to 1 second...
  59. output AT S38=1\13
  60. chkok {Can't set forced hangup delay}
  61.  
  62. if def \%1 if not equal "\%1" "=" goto BEGIN
  63. echo Modem initialization complete, no number to dial
  64. end 0
  65.  
  66. :BEGIN                          ; Now DIAL.
  67. clear                           ; Clear INPUT buffer.
  68. set count 5                     ; Dialing retry counter, 5 tries allowed.
  69. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  70. echo
  71. pause 1
  72. goto dial                       ; 1st time, skip pause and Redialing message
  73.  
  74. :REDIAL
  75. set alarm 30
  76. pause 30                        ; Wait 30 seconds before redialing.
  77. if not alarm errfail {Dialing canceled.}
  78. echo Redialing...               ; Message for redialing.
  79. pause 1
  80.  
  81. :DIAL
  82. output ATD\%1\13                ; Dial the number.
  83. set alarm 90                    ; (For detecting keyboard interruptions.)
  84. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  85. if < VERSION 313 clear
  86. input 30 \10                    ; Wait for the linefeeds...
  87.  
  88. :GETMSG
  89. input 60 \10                    ; ...that surround the response message.
  90. if success goto gotmsg          ; Got a message.
  91. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  92. hangup                          ; User interrupted from keyboard,
  93. output \13                      ; cancel dialing by sending carriage return,
  94. goto again                      ; and go try again right away.
  95.  
  96. :GOTMSG
  97. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  98. if success goto done            ; If so, we're done.
  99. reinput 1 BUSY                  ; Line is busy.
  100. if success goto busy            ; Go wait a while and then dial again.
  101. reinput 1 ERROR                 ; Command syntax error.
  102. if success errfail {Dialing command error}
  103. reinput 1 NO CARRIER            ; Phone didn't answer or no carrier.
  104. if success errfail {No answer or no carrier}
  105. reinput 1 NO DIALTONE           ; 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. end 0                           ; Finished, return success code.
  124.  
  125. :FAIL                           ; Dialing failed, no beep.
  126. define errfail                  ; Erase local macro definitions...
  127. end 1                           ; Return failure code.
  128.  
  129. ; End of BOCA.SCR
  130.