home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskscripts / aceex.kds next >
Text File  |  2020-01-01  |  8KB  |  225 lines

  1. ; FILE ACEEX.SCR (for use with the Aceex DM1414V Faxmodem)
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the Aceex DM1414V faxmodem.
  4. ; to be used with MS-DOS Kermit 3.14. Not tested on other Kermit versions!
  5. ; The modem is set up for compression, error correction, all types of
  6. ; fallback, RTS/CTS flow control, maximum interface speed of 38400.
  7. ; The Aceex DM1414V is a V.32bis FAX/DATA modem with the Rockwell 144
  8. ; CLASS 1/2 chipset. The modem is equipped with a non-volatile memory
  9. ; for storing your personal profile.
  10. ;
  11. ; Before using this script, be sure to make the following correction
  12. ; to your mscustom.ini file: set modem ACEEX (instead of Hayes)
  13. ;
  14. ; Authors: Boris Nagels, Paul Jansen, The Netherlands, feb. 1998.
  15. ; Modified from DYNA1414.SCR (Christine M. Gianone, Frank da Cruz; june 1993)
  16. ;
  17. ;  *******************************************************************
  18. ;  *   Modified by Sengels Unlimited for use with 'Aceex DM1414V'    *
  19. ;  *******************************************************************
  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.  
  24. define chkerr if fail stop 1 \%1
  25. define chkok input 5 OK, if fail stop 1 \%1
  26.  
  27. ; Macro to try to get attention of modem's command processor
  28. ; at the given speed, or if no speed given, at the current speed.
  29. ; Q0 = Enable result codes, V1 = display result codes as words.
  30. ; The dynalink modem sometimes is a bit slow with the OK so input
  31. ; will wait 5 seconds for it. This way it works ok with the aceex.
  32. ;
  33. define atok -
  34.  if not def \%1 assign \%1 \v(speed), -
  35.  set speed \%1, -
  36.  echo Trying \%1..., -
  37.  output ATQ0V1\13, -
  38.  input 5 OK, -
  39.  end \v(status)
  40.  
  41. set input echo on               ; So we can watch what happens.
  42. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  43. set input case ignore           ; Use caseless string comparisons
  44.  
  45. set parity none                 ; Avoid parity foulups
  46. set flow none                   ; Avoid flow control deadlocks
  47. hangup                          ; Begin by dropping DTR
  48. pause 1                         ; for one second
  49.  
  50. ; Speed.  Don't worry about modem, it autobauds up to 38400 bps.
  51. ;
  52. set speed 38400                 ; If computer can be set to 38400 bps, use it.
  53. if fail set speed 19200         ; If not, use 19200.
  54.  
  55. echo Configuring Aceex DM1414V on \v(line).
  56.  
  57. atok                            ; Autobaud at current speed
  58. if fail atok 14400
  59. if fail atok 9600
  60. if fail atok 2400
  61. if fail atok 300
  62. if fail stop 1 Can't get modem's attention.
  63.  
  64. :OK
  65. ;
  66. ; Initialize the modem.
  67. ;
  68. ; &C1    Use actual state of carrier for DCD
  69. ; &D2    Hangup if DTR drops, so Kermit's HANGUP command will work
  70. ; E1     Commands are to be echoed
  71. ; W1     Enable dialing progress messages (stripped)
  72. ; X4     Enable full range of result codes
  73. ; &Q5    Enable error correction
  74. ;
  75. output AT &C1 &D2 E1 X4 &Q5 S95=46\13  ; Init string
  76. chkok {Can't initialize modem}
  77. ;
  78. ; S0=0   Auto answer off (added)
  79. ; S37=11 Begin modulation negotiations at V.32bis = 14400 bps
  80. ; N1     Negotiate highest common modulation (stripped)
  81. ; &N8    (added)
  82. ;
  83. echo Enabling modulation negotiation...
  84. output AT S0=0 S37=11 &N8\13    ; Start modulation speed negotiation at 14400
  85. chkok {Can't enable modulation speed negotiation}
  86. ;
  87. ; Enable hardware flow control
  88. ;
  89. echo Enabling hardware flow control...
  90. output AT &K3\13                ; Enable RTS/CTS hardware flow control
  91. chkok {Can't enable RTS/CTS}    ; On modem
  92. wait 5 cts
  93. if fail errfail {Modem is not asserting CTS!}
  94. set flow rts/cts                ; And in Kermit too, but only now
  95.  
  96. ; Specify treatment of BREAK signal
  97. ;
  98. echo Configuring modem to ignore BREAK...\13
  99. output AT \92K5\13              ; Make modem pass BREAK transparently
  100. chkok {Can't become transparent to BREAK}
  101.  
  102. ; Enable error correction and compression
  103. ;
  104. ; &Q5       Enable error correction
  105. ; S36=7     LAPM (V.42) => MNP => ASB (automatic speed buffering)
  106. ; S38=1     When DTR from PC goes off, hang up after 1 second
  107. ; S39=240   Disconnect phoneline after 240 sec. of inactivity (added)
  108. ; S46=138   Enable compression (%C1)
  109. ; S48=7     EC and compression negotiation enabled
  110. ;
  111. echo Enabling error correction and data compression...\13
  112. output AT &Q5 S36=7 S38=1 S39=240 S46=138 S48=7 \92T240\13
  113. chkok {Can't enable compression and EC}
  114.  
  115. ; The Aceex modem is also very noisy with the default volume set to L2.
  116. ; The volume can be set to low (L1).
  117. ; Add M0 to the output statement below if L1 is still too loud.
  118. ;
  119. ; L2       We like a good sound
  120. ; M0       Speaker off
  121. echo Silencing modem...
  122. output AT L2\13         ; Add M0 to shut down the speaker
  123. ;; chkok {Can't silence the modem}
  124.  
  125. if def \%1 if not equal "\%1" "=" goto BEGIN
  126. ;
  127. ; User only wanted to initialize the modem.
  128. ; Display configuration. The settings take up a whole 24 rows screen.
  129. ;
  130. echo Aceex DM1414V initialized OK:
  131. ;output AT&V\13
  132. input 10 OK
  133. end 0
  134.  
  135. :BEGIN
  136. ;
  137. ; User wants to dial.
  138. ;
  139. clear                           ; Clear INPUT buffer.
  140. set count 5                     ; Dialing retry counter, 5 tries allowed.
  141. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  142. echo
  143. pause 1
  144. goto dial                       ; 1st time, skip pause and Redialing message
  145.  
  146. :REDIAL
  147. set alarm 30
  148. pause 30                        ; Wait 30 seconds before redialing.
  149. if not alarm errfail {Dialing canceled.}
  150. echo Redialing...               ; Message for redialing.
  151. pause 1
  152.  
  153. :DIAL
  154. output ATDT\%1\13               ; Dial the number.
  155. set alarm 90                    ; (For detecting keyboard interruptions.)
  156. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  157. if < VERSION 313 clear
  158.  
  159. :GETMSG
  160. input 90 \10                    ; Wait for linefeed
  161. if success goto gotmsg          ; Got a message.
  162. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  163. hangup                          ; User interrupted from keyboard,
  164. output \13                      ; cancel dialing by sending carriage return,
  165. echo Dialing interrupted, will dial again in 30 seconds.
  166. echo Press any key to cancel...
  167. goto again                      ; and go try again right away.
  168.  
  169. :GOTMSG
  170. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  171. if success goto done            ; If so, we're done.
  172. reinput 1 BUSY                  ; Line is busy.
  173. if success goto busy            ; Go wait a while and then dial again.
  174. reinput 1 ERROR                 ; Command syntax error.
  175. if success errfail {Dialing command error}
  176. reinput 1 CARRIER               ; Connection rate (DCE-DCE)
  177. if success goto getmsg          ; no action
  178. reinput 1 PROTOCOL              ; Error correction type (NONE/LAP-M/ALT)
  179. if success goto getmsg          ; no action
  180. reinput 1 COMPRESSION           ; Compression type (CLASS 5/V.42BIS/NONE)
  181. if success goto getmsg          ; no action
  182. reinput 1 NO ANSWER             ; No answer
  183. if success errfail {No answer, please try again later}
  184. reinput 1 NO CARRIER            ; Phone didn't answer or no carrier.
  185. if success goto nocarrier
  186. reinput 1 NO DIALTONE           ; No dialtone when phone taken off hook.
  187. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  188. reinput 1 RING                  ; Phone is ringing
  189. if success errfail {Somebody is calling this number}
  190. goto getmsg                     ; None of the above, get another message.
  191.  
  192. :BUSY
  193. if < \v(count) 2 goto quit      ; Don't wait 30 seconds if tries are used up.
  194. echo Line is busy, will dial again in 30 seconds.
  195. echo Press any key to cancel...
  196. :AGAIN
  197. if count goto redial            ; Then go redial.
  198. :QUIT
  199. errfail {It never answers!  I give up.} ; Too many tries.
  200.  
  201. :DONE                           ; Connected.
  202. echo \7                         ; Celebrate with a beep.
  203. define errfail                  ; Erase local macro definitions...
  204. define chkerr
  205. define ckok
  206. define atok
  207. end 0                           ; Finished, return success code.
  208.  
  209. :NOCARRIER
  210. echo
  211. echo Connection failed, S86 contains the reason code:
  212. echo
  213. output ATS86\63\13
  214. input 2 \10
  215. input 2 \10
  216.  
  217. :FAIL                           ; Dialing failed, no beep.
  218. define errfail                  ; Erase local macro definitions...
  219. define chkerr
  220. define ckok
  221. define atok
  222. end 1                           ; Return failure code.
  223.  
  224. ; End of ACEEX.SCR
  225.