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