home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Communication ToolBox / Outils CTB ƒ / CCL Modem Tool 1.2 ƒ / CCL Script 9600 V.42 < prev    next >
Encoding:
Text File  |  1993-03-11  |  4.2 KB  |  222 lines  |  [mlts/slnk]

  1. ! 11/8/92  Modified GVC TelePort Serial ARA Script
  2. !          for use with Stalker's CCL Modem Tool.
  3. !
  4. ! 12/3/92  Improved disconnect logic
  5. !          Removed login logic (Eudora now does it)
  6. !          Added Manual dial logic
  7. !         
  8. ! 12/6/92  Changed disconnect logic to Inline 
  9. !          (There's only one Settries var, and its used for redialing)
  10. !
  11. ! 12/18/92 Added ATZ to disconnect logic
  12. !
  13. @ANSWER
  14. exit -6019
  15. @ORIGINATE
  16. !
  17. ! Talk to the modem at 19,200 bps.  
  18. !
  19. serreset 19200, 0, 8, 1
  20. !
  21. ! &f  - recall factory settings
  22. ! &d0 - ignore DTR from DTE
  23. ! &k3 - Enable Hardware flow control
  24. ! w2  - Connect result code reports modem speed
  25. ! \q3 - Use RTS/CTS flow control in full-duplex mode
  26. ! \k0 - Enter command state but do not send break
  27. ! \j0 - Disable port rate adjust
  28. ! s7=60 - To allow for an international call
  29. !
  30. HSReset 0 0 0 0 0 0
  31. matchclr
  32. @LABEL 1
  33. note "Initializing the modem..." 3
  34. matchstr 1 4 "OK\13\10"
  35. write "AT&F&D2\\N3\\Q1\\J0\\G1W2\13"
  36. matchread 30
  37. note "Modem initialization failed, setting factory defaults." 3
  38. matchstr 1 4 "OK\13\10"
  39. write "AT&F&C1&D1\13"
  40. matchread 30
  41. ! Modem is not responding, abort
  42. jump 59
  43. !
  44. @LABEL 4
  45. matchclr
  46. ! If speaker on flag is true, turn on the speaker
  47. !
  48. pause 5
  49. matchstr 1 8 "OK\13\10"
  50. ifstr 2 6 "1"
  51. !Speaker Off
  52. write "ATM0\13"
  53. jump 7
  54. @LABEL 6
  55. !Speaker on low during connection after dialing
  56. write "ATM3L1\13"
  57. @LABEL 7
  58. matchread 30
  59. jump 59
  60. !
  61. ! The modem is ready so originate a call
  62. !
  63. !Initialize Retry counter
  64. settries 0
  65. @LABEL 8
  66. pause 5
  67. ! Check if Phone Number is empty
  68. ifstr 1 40 ""
  69. jump 41
  70. !@LABEL 40
  71. !ask 0 "Please enter Phone Number"
  72. !note "Dialing ^*" 3
  73. !write "ATDT^*\13"
  74. !jump 42
  75. @LABEL 40
  76. ask 1 "No Phone Number specified!\13Dial call manually and click OK."
  77. write "ATS7=120X1D\13"
  78. note "Listening for remote modem..."
  79. jump 42
  80. @LABEL 41
  81. note "CCL Script Rev .74\13Dialing ^1" 3
  82. write "ATDT^1\13"
  83. @LABEL 42
  84. !
  85. @LABEL 9
  86. matchstr 1  11 "CONNECT 1200\13\10"
  87. matchstr 2  12 "CONNECT 2400\13\10"
  88. matchstr 3  13 "CONNECT 4800\13\10"
  89. matchstr 4  14 "CONNECT 7200\13\10"
  90. matchstr 5  17 "CONNECT 9600\13\10"
  91. matchstr 6  18 "CONNECT 12000\13\10"
  92. matchstr 7  19 "CONNECT 14400\13\10"
  93. matchstr 8  51 "NO CARRIER\13\10"
  94. matchstr 9  50 "ERROR\13\10"
  95. matchstr 10 52 "NO DIAL TONE\13\10"
  96. matchstr 11 53 "BUSY\13\10"
  97. matchstr 12 54 "NO ANSWER\13\10"
  98. matchread 600
  99. note "No Connection, Retrying..."
  100. !
  101. @LABEL 10
  102. pause 30
  103. !Hangup first
  104. jsr 60
  105. ! Dial the number again
  106. inctries
  107. iftries 3 59
  108. jump 8
  109. !
  110. !
  111. ! Notice that all we do for different connect speeds is issue a 
  112. ! "Communicating at" message.  Remember, we locked the interface speed
  113. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  114. !
  115. @LABEL 11
  116. note "Communicating at 1200 bps." 2
  117. jump 15
  118. @LABEL 12
  119. note "Communicating at 2400 bps." 2
  120. jump 15
  121. @LABEL 13
  122. note "Communicating at 4800 bps." 2
  123. jump 15
  124. @LABEL 14
  125. note "Communicating at 7200 bps." 2
  126. jump 15
  127. @LABEL 17
  128. note "Communicating at 9600 bps." 2
  129. jump 15
  130. @LABEL 18
  131. note "Communicating at 12000 bps." 2
  132. jump 15
  133. @LABEL 19
  134. note "Communicating at 14400 bps." 2
  135. jump 15
  136. !
  137. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  138. ! command below )
  139. !
  140. @LABEL 15
  141. HSReset 0 1 0 0 0 1 
  142. pause 15
  143. exit 0
  144. !
  145. !
  146. ! 50: error messages
  147. !
  148. @LABEL 50
  149. ! Modem returned Error
  150. exit -6021
  151. !
  152. @LABEL 51
  153. ! Modem returned No Carrier
  154. note "No Carrier, Retrying..."
  155. jump 10
  156. @LABEL 52
  157. ! Modem returned No Dial Tone
  158. exit -6020
  159. !
  160. @LABEL 53
  161. ! Modem returned Busy
  162. note "Busy, Retrying..."
  163. jump 10
  164. exit -6022
  165. !
  166. @LABEL 54
  167. ! Modem returned No Answer
  168. note "No Answer, Retrying..."
  169. jump 10
  170. exit -6023
  171. !
  172. @LABEL 59
  173. ! General Abort
  174. exit -6019
  175. !
  176. ! Hang up the modem
  177. !
  178. @HANGUP
  179. jsr 60
  180. serreset 19200, 0, 8, 1
  181. HSReset 0 0 0 0 0 0
  182. exit 0
  183. ! Disconnect subroutine
  184. @LABEL 60
  185. note "Hanging up..."
  186. matchclr
  187. matchstr 1 63 "OK\13\10"
  188. matchstr 2 63 "NO CARRIER\13\10"
  189. !There's only one Settries variable! (Yuck) and its used for Redialing
  190. !So we just have to put the hangup retires Inline instead of looping.
  191. pause 12
  192. write "+++"
  193. pause 12
  194. Flush
  195. write "ATH\13"
  196. matchread 20
  197. write "+++"
  198. pause 12
  199. Flush
  200. write "ATH\13"
  201. matchread 20
  202. write "+++"
  203. pause 12
  204. Flush
  205. write "ATH\13"
  206. matchread 20
  207. write "+++"
  208. pause 12
  209. Flush
  210. write "ATH\13"
  211. matchread 20
  212. write "+++"
  213. pause 12
  214. Flush
  215. write "ATH\13"
  216. matchread 20
  217. note "Error: Make sure modem disconnected properly!"
  218. pause 100
  219. !
  220. @LABEL 63
  221. write "ATZ\13"
  222. return