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

  1. ; File QX4232.SCR -- minor modification of Klensin's PENRIL.SCR.
  2. ; To be used with MS-DOS Kermit 3.11 or later.
  3. ;
  4. ; This MS-DOS Kermit script program is for dialing a Microcom QX/4232hs modem, 
  5. ; which is a v.32(w/bis) / v.42(w/bis) MNP class *10* modem. What else do you 
  6. ; expect from the people who created the Microcom Networking Protocol anyway? 
  7. ; The QX/4232hs, like most V.32 modems, is Hayes-compatible up to the point 
  8. ; that one starts dealing with buffering, error-correction, and compression 
  9. ; modes.  Expects variable %\1 to contain the phone number; this is done by 
  10. ; the DIAL macro defined in MSKERMIT.INI.  Items marked by "*!*" might need 
  11. ; editing.
  12. ;
  13. ; NOTE: The annotation *FDSS indicates a MS-KERMIT software setting that was 
  14. ; originally defined by the Factory Default Switch Settings, which do not 
  15. ; always match the default software settings.  Also, many terminal packages 
  16. ; have their own preferred settings for the switches, and default software 
  17. ; settings in the modem's NRAM.  This script studiously avoids touching any of 
  18. ; the NRAM functions, or modem switches, to avoid trashing the functionality 
  19. ; of other packages that expect the NRAM & switches to be in a certain 
  20. ; configuration.  It also attempts to put everything back to the original 
  21. ; factory sets, with minor modifications for optimal Kermit functionality, as 
  22. ; the ones for this modem are the most viable for auto-reliable connections to 
  23. ; the widest variety of modems.  These changes are all completely temporary, 
  24. ; and are wiped out by a simple ATZ.
  25. ;
  26. ; The following decimal codes are given as a QRL (Quick Reference Listing) for 
  27. ; the various special characters in the extended AT command set that the 
  28. ; Microcom QX/4232hs uses.
  29. ;       \36 = $         \42 = *
  30. ;       \37 = %         \58 = &
  31. ;       \38 = &         \92 = \
  32. ;
  33. ; Uses ATD (modem's default dialing method) to dial the number, after setting 
  34. ; Tone Dialing with ATT.  If you're still in a phone service area that uses 
  35. ; pulse dialing, modify this script accordingly in the initialization, to set 
  36. ; Pulse Dialing with ATP.
  37. ;
  38. ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag if it fails.
  39. ;
  40. ;  Author: Kevin P. Brott, Clackamas Community College, Oregon City, OR
  41. ;          e-mail: <KEVINB@mailhost.clackamas.cc.or.us>
  42. ;          WWW:    http://198.153.201.254/html/kevinb.htm
  43. ;          Last update: 941224.1235PST (24-DEC-94)
  44. ;          
  45. ;  Adapted from PENRIL.SCR John C. Klensin, August 1992
  46. ;  Adapted from HAYES.SCR by Christine M. Gianone (July 1991).
  47. ;  Requires MS-DOS Kermit 3.11 or later.
  48. ;
  49. ; The normal DTE <-> DCE speed of this modem is 38.4 Kbps, regardless of the 
  50. ; line or character speed.  Set that number here, regardless of what the 
  51. ; DIALUPS file says.  However, this may exceed the speed at which MSDOS 
  52. ; computers can deal with characters and should be reduced if necessary.
  53. ;
  54. echo Using Microcom QX/4232hs modem\13\10 
  55. set speed 38400                       ; *!* This is the locked serial speed.
  56. ;
  57. set flow rts                          ; Best set, modem default.
  58. def errfail echo \%1,hangup,goto fail ; Macro to handle failures.
  59.  
  60. if < VERSION 310 errfail {MS-DOS Kermit 3.10 or later required.}
  61.  
  62. set input timeout proceed    ; Allow IF SUCCESS, IF FAILURE
  63. set input echo on            ; Do echo the modem test/init, for debugging
  64. output ATZ\13                ; Send ATZ to reset/init the modem.
  65. output AT\38F\13\10          ; Send AT&F, resets modem to factory defaults
  66. output ATQ0\13\10            ; Send ATQ0, enables modem result codes
  67. output ATT\13\10             ; then send an ATT, setting tone dialing. *!*
  68. input 2 OK                   ; Modem should say "OK"
  69. if fail errfail {Turn on or connect your modem!}
  70. pause                        ; Continue initializing
  71. output AT\38C1               ; &C1 So CD follows remote carrier *FDSS
  72. output \37G1                 ; %G1 Allows modem speed to vary from serial
  73. output \37B9600              ; %Bn Sets the initial modem speed to 9600
  74. output \92J0                 ; \J0 Disables bps rate adjust *FDSS
  75. ;; output \58K1              ; :K1 Enables Kermit spoofing asynch protocol.
  76. output \92K3                 ; \K3 Break passed immediately to remote host
  77. output \37L3                 ; %L3 Enables CCITT Automode speed matching.
  78. output \92N3                 ; \N3 Sets Auto-Reliable connect mode *FDSS
  79. output \92Q3                 ; \Q3 RTS/CTS, bidirectional *FDSS
  80. output \92V2                 ; \V2 Enables v.42 result codes on CONNECT msg.
  81. output S7=60                 ; Wait *1* whole minute for connect (insurance)
  82. output \13                   ; That's it, we're done, xmit to modem!
  83. input 2 OK
  84. if fail errfail {Unable to initialize modem}
  85. clear                        ; Clear input buffer
  86. ;
  87. if not equ {\%1} {=} goto dialnow   ; This provides for initialization only
  88. echo Modem initialization complete, no number to dial
  89. end 0
  90.  
  91. :DIALNOW
  92. set count 5                     ; Set up dialing retry counter
  93. set input echo on               ; From now on, show what happens
  94. echo Dialing \%1, wait...
  95. pause 1
  96. goto dial                       ; 1st time, skip Redialing message
  97.  
  98. :REDIAL
  99. set alarm 30
  100. pause 30                        ; Wait 30 seconds before redialing.
  101. if not alarm errfail {Dialing canceled.}
  102. echo Redialing...               ; Message for redialing.
  103. pause 1
  104.  
  105. :DIAL
  106. output ATDT\%1\13               ; Dial the number (ATDT)
  107. input 10 \10                    ; ignore the immediate LF
  108.  
  109. :GETMSG
  110. set alarm 130                              ; Detect keyboard interruptions.
  111. input 60 \10                               ; Wait for the linefeeds...
  112. input 40 \10                               ; that surround response message.
  113. if success goto gotmsg                     ; Got a message.
  114. if alarm errfail {No response from modem.} ; No response in a long time
  115. hangup                                     ; User interrupted from keyboard,
  116. if count goto redial                       ; so try again right away
  117. goto fail                                  ; die here if over count
  118.  
  119. :GOTMSG
  120. reinput 7 CONNECT               ; Got message, was it CONNECT?
  121. if success goto cspeed          ; Yes, wait for LAPM, MNP, or /REL 
  122. reinput 5 ERROR                 ; No, check for command error.
  123. if success errfail {Modem command error.}
  124. reinput 10 NO CARRIER           ; NO CARRIER?
  125. if success goto busy            ; Treat like BUSY.
  126. reinput 4 BUSY                  ; BUSY?
  127. if success goto busy            ; Go wait a bit, then dial again.
  128. reinput 4 /REL                  ; Reliable connection v.42 v.32 MNP/LAPM
  129. if success goto speed           ; modem ready, set speed
  130. reinput 4 LAPM                  ; Protocol stuff (V.42/V.42bis)
  131. if success goto speed           ; modem ready, set speed
  132. reinput 3 MNP                   ; MNP, ignore
  133. if success goto speed           ; modem ready, set speed
  134. errfail {No dialtone or no answer.  Try again later.}
  135.  
  136. :BUSY
  137. if < \v(count) 2 goto quit      ; Don't wait 60 seconds if tries used up.
  138. Echo Busy or No Carrier, will dial again in 30 seconds...
  139. echo Press any key to cancel...
  140. hangup                          ; Hang up.
  141. :AGAIN
  142. if count goto redial            ; Then go redial.
  143. :QUIT
  144. errfail {It never answers!  I give up.} ; Too many tries.
  145.  
  146. ; The following block is retained for compatibility for HAYES.SCR.  Since
  147. ; this modem buffers (always retains the same DCE<->DTE speed), the computer
  148. ; should not speed-match and the next section is a no-op.
  149. :CSPEED
  150. pause 2                         ; wait for protocol announcement
  151. :SPEED                          ; Connected!
  152. echo \7                         ; Celebrate with a beep.
  153. define errfail                  ; Erase ERRFAIL definition
  154. end 0                           ; Finished, return success code.
  155.  
  156. :FAIL                           ; Failed, return failure code.
  157. define errfail                  ; Erase ERRFAIL definition
  158. end 1
  159.  
  160. ; end of QX4232HS.SCR
  161.