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

  1. ; File VIVA.SCR -- minor modification of Christine's HAYES.SCR.
  2. ; To be used with MS-DOS Kermit 3.11 or later.
  3. ;
  4. ; Gregory L. Forster [glf@alpha1.csd.uwm.edu]
  5. ; The Career Connection BBS 8/N/1 2400 (414)258-0164
  6. ;
  7. ; Place this file in your
  8. ; current directory or in any directory in your DOS PATH, and then set the
  9. ; DOS environment variable, MODEM, to be VIVA.  Give the following command
  10. ; at the DOS prompt before starting Kermit, or add it to your AUTOEXEC.BAT
  11. ; file:
  12. ;
  13. ;   SET MODEM=VIVA  or
  14. ;   DEFINE _MODEM VIVA at the MS-DOS Kermit prompt, or
  15. ;   DEFINE _MODEM VIVA to your MSCUSTOM.INI file.
  16. ;
  17. ; Uses ATD (modem's default dialing method) to dial the number.
  18. ; Force tone dialing by including T as first character of phone
  19. ; number, or pulse dialing by including P as first character.
  20. ;
  21. ; Puts the VIVA 2442ef in the following modes, which this script depends upon
  22. ; for following operation:
  23. ; V1 Selects Long-Form verbal result codes.
  24. ; E1 Echoes back characters to host typed in command mode
  25. ; M0 Speaker always off
  26. ; N1 Permits handshaking to occur at any speed supported by both  
  27. ;    modems.  Enables automode detection.
  28. ; Q0 Result codes are sent.
  29. ; X4 BUSY detect, NO DIALTONE detect, CONNECT (speed) messages displayed
  30. ; &C1 DCD On indicates presence of data carrier.
  31. ; &D2 DTR On-To-Off transition causes the modem to hangup, 
  32. ;     enter the command state, and disable auto-answer
  33. ; &S0 Modem maintains DSR on at all times
  34. ; %C3 Enable both MNP5 and V.42bis Data Compression
  35. ; %D2 Sets the V.42bis dictionary size at 2048
  36. ; %M3 Enables two-way compression
  37. ; These are set by the statement:
  38. ;    output ATV1E1M0X4&C1&D2&S0%C3%D2%M3\13
  39. ;
  40. ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag 
  41. ; if it fails.
  42. ;
  43. echo  Using VIVA 2442ef V.42bis/MNP5 FAX/MODEM\13  
  44. set speed 19200            ; Set interface speed to 19,200
  45.  
  46. def errfail echo \%1,hangup,goto fail ; Macro to handle failures.
  47.  
  48. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE
  49.  
  50. set input echo off              ; Don't echo the modem test
  51. output ATV1E1M0N1Q0X4&C1&D2&S0%C3%D2%M3\13  ; Send AT, initialization
  52. input 2 OK                      ; Modem should say "OK"
  53. if fail errfail {Turn on or connect your modem!}
  54. set flow rts                    ; Hardware flow control
  55. clear                ; Clear input buffer
  56. ;
  57. if not equ \%1 = goto dialnow   ; This provides for initialization only.
  58. echo Modem initialization completed, no number to dial
  59. end 0
  60. :dialnow
  61. set count 15                    ; Set up dialing retry counter (15 times)
  62. set input echo on               ; From now on, show what happens
  63. echo Dialing \%1, wait...       ; Dial inputted phone number
  64. pause 1                         ; Pause 1 second 
  65. goto dial                       ; 1st time, skip Redialing message
  66. :REDIAL
  67. set alarm 30
  68. pause 5             ; Wait 5 seconds before redialing.
  69. if not alarm errfail {Dialing canceled.}
  70. echo Redialing...               ; Message for redialing.
  71. pause 1                         ; Pause 1 second
  72. :DIAL
  73. output ATD\%1\13                ; Dial the number (ATDT or ATDP)
  74. :GETMSG
  75. set alarm 60            ; Detect keyboard interruptions.
  76. input 40 \10                    ; Wait for the linefeeds...
  77. input 20 \10            ; that surround response message.
  78. if success goto gotmsg        ; Got a message.
  79. if alarm errfail {No response from modem.} ; No response in 60 secs.
  80. hangup                ; User interrupted from keyboard,
  81. if count goto redial        ; so try again right away.
  82.  
  83. :GOTMSG
  84. reinput 0 CONNECT               ; Got message, was it CONNECT?
  85. if success goto speed           ; DTE-DCE rate.  Successful, continue
  86. reinput 0 ERROR            ; No, check for command error.
  87. if success errfail {Modem command error.}
  88. reinput 0 CARRIER        ; Connection rate (DCE-DCE)
  89. if success goto getmsg        ; no action
  90. reinput 0 PROTOCOL        ; Error correction type (NONE/LAPM/ALT)
  91. if success goto getmsg        ; no action (=/V.42/MNP)
  92. reinput COMPRESSION        ; Compression type (CLASS 5/V.42BIS/NONE)
  93. if success goto getmsg        ; no action (=MNP5/V.42bis/)
  94. reinput 0 RING            ; Ring signal detected.  Not a Hayes
  95. if success goto getmsg        ; Look for something useful.
  96. reinput 0 NO CARRIER        ; NO CARRIER?
  97. if success goto busy        ; Treat like BUSY.
  98. reinput 0 BUSY                  ; BUSY?
  99. if success goto busy         ; Go wait a bit, then dial again.
  100. errfail {No dialtone or no answer.  Try again later.}
  101.  
  102. :BUSY
  103. if < \v(count) 2 goto quit    ; Don't wait 60 seconds if tries used up.
  104. Echo Busy or No Carrier, will dial again in 5 seconds...
  105. hangup                          ; Hang up.
  106. :AGAIN
  107. if count goto redial            ; Then go redial.
  108. :QUIT
  109. errfail {Not answering now... Try later.} ; Too many tries.
  110.  
  111. ; The following block is retained for compatibility for HAYES.SCR.  Since
  112. ; this modem buffers (always retains the same DCE<->DTE speed), the computer
  113. ; should not speed-match and the next section is a no-op.
  114. :SPEED                          ; Connected!
  115. echo \7                         ; Celebrate with a beep.
  116. define errfail            ; Erase ERRFAIL definition
  117. end 0                ; Finished, return success code.
  118.  
  119. :FAIL                ; Failed, return failure code.
  120. define errfail            ; Erase ERRFAIL definition
  121. end 1
  122.