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

  1. ; FILE ROLM.SCR
  2. ;
  3. ; To be used with MS-DOS Kermit 3.11 or later.
  4. ;
  5. ; An MS-DOS Kermit script program for dialing from a ROLMphone DCM
  6. ; (Data Communication Module).
  7. ;
  8. ; Stored in Kermit Distribution as MSIROLM.SCR; rename to ROLM.SCR if
  9. ; necessary so the DIAL macro can find it.  Place this file in your current
  10. ; directory, or any directory in your DOS PATH.
  11. ;
  12. ; Expects variable \%1 to contain the phone number or data group name.  This
  13. ; is done by the DIAL macro defined in MSKERMIT.INI.  To make the DIAL macro
  14. ; use this file instead of HAYES.SCR, add the following line to your
  15. ; AUTOEXEC.BAT file:
  16. ;
  17. ;   SET MODEM=ROLM
  18. ;
  19. ; If you lack the DIAL macro definition, use this simple substitute:
  20. ;
  21. ;   DEFINE DIAL TAKE ROLM.SCR
  22. ;
  23. ; To use, just type "DIAL nnnnnnn" at the MS-Kermit> prompt, where "nnnnnnn"
  24. ; is the desired phone number or Rolm data group name.
  25. ;
  26. ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag 
  27. ; if it fails, for use with IF SUCCESS, IF FAILURE, \v(status).
  28. ;
  29. ; Author: Christine M. Gianone, September 1991.
  30. ; Revised September 1992.
  31.  
  32. ; Fatal error macro.
  33. ;
  34. def errfail if not def \%1 def \%1 Failed - try again later.,-
  35.   echo \%1, hangup, goto fail
  36.  
  37. ; Macro to check error messages.
  38. ;
  39. def chkmsg reinput 0 \%1, if success errfail
  40.  
  41. if < VERSION 311 errfail {MS-DOS Kermit 3.11 or later required.}
  42. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE
  43. set input echo on               ; Let's watch what happens
  44. clear                ; Clear out old stuff from INPUT buffer
  45. set count 3            ; Try up to 3 times to get Rolm prompt
  46.  
  47. :LOOP
  48. output \13                    ; Send carriage return
  49. input 3 MODIFY\63\13\10         ; ROLMphone says "CALL, DISPLAY OR MODIFY?"
  50. if success goto dial        ; Got it.
  51. if count goto loop        ; Didn't get it, try again.
  52.  
  53. echo ROLMphone not responding on port \v(port) at speed=\v(speed).
  54. errfail {Please check your connection and try again.}
  55.  
  56. :DIAL
  57. if def \%1 if equal "\%1" "=" end 0 ; Phone number "=" means initialize only.
  58. pause 1                ; Wait a second
  59. output CALL \%1\13              ; Dial the number or datagroup name
  60. set count 12            ; Try up to 12 times to read a known response
  61.  
  62. :GETMSG
  63. input 40 \13            ; Look for a carriage return.
  64. if fail errfail {No response to CALL command}
  65. reinput 0 CALL COMPLETE        ; The response we wanted.
  66. if success goto gotit
  67. chkmsg {NOT A DATALINE}        ; Check for error messages.
  68. chkmsg {FAILED}            ; This lets us fail right away, rather
  69. chkmsg {BUSY}            ; than waiting forever for CALL COMPLETE
  70. chkmsg {LACKS PERMISSION}    ; not to show up...
  71. chkmsg {DOES NOT ANSWER}
  72. chkmsg {INVALID GROUP NAME}
  73. chkmsg {INVALID DATA LINE NUMBER}
  74. chkmsg {ABANDONED}
  75. reinput 0 NOT AVAILABLE        ; This one needs a hint
  76. if fail goto again
  77. echo Failed - Most likely cause: \v(speed) bps can't be used with \%1.
  78. errfail {Please change your speed and try again.}
  79. :AGAIN
  80. if count goto getmsg        ; None of these, wait for another message.
  81. errfail {Sorry - I don't understand these reponses.} ; Too many tries.
  82.  
  83. :GOTIT
  84. echo \7                ; Succeeded, beep
  85. define errfail            ; Erase ERRFAIL definition
  86. define chkmsg            ; CHKMSG definition too
  87. end 0                ; Finished, return success code.
  88.  
  89. :FAIL                ; Dialing failed.
  90. define errfail            ; Erase ERRFAIL definition
  91. define chkmsg            ; CHKMSG definition too
  92. end 1                ; Return failure code.
  93.