(FILECREATED " 3-Apr-85 10:51:26" {DSK}<LISPFILES>ANSWER-PHONE.;2 1668   

      changes to:  (FNS ANSWER.PHONE)
		   (VARS ANSWER-PHONECOMS)

      previous date: " 3-Apr-85 10:11:47" {DSK}<LISPFILES>ANSWER-PHONE.;1)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT ANSWER-PHONECOMS)

(RPAQQ ANSWER-PHONECOMS ((FNS ANSWER.PHONE)))
(DEFINEQ

(ANSWER.PHONE
  [LAMBDA (MESSAGE)                                          (* BBB " 3-Apr-85 10:51")
                                                             (* This function will answer the phone with MESSAGE and
							     then hang up.)
    (LOAD? (QUOTE {ERIS}<LISP>HARMONY>LIBRARY>RS232.DCOM)
	   (QUOTE SYSLOAD))
    (RS232INIT 600)
    (RS232BACKGROUND (QUOTE ON))
    (SPEAK "↑[*0L")                                          (* Initialize phone.)
    (SPEAK (CONCAT "↑[*%"↑[[200s" MESSAGE "%""))             (* Install auto-answer.)
    (SPEAK "↑[*3L")                                          (* Arm phone.)
    (ADD.PROCESS (QUOTE (while T bind MARKER.FLAG do         (* Wait up to five minutes for the index marker 
							     (returned from auto answer) then hangup.)
			       (forDuration 300 timerUnits (QUOTE SECONDS) until MARKER.FLAG
				  do (SETQ MARKER.FLAG (EQ (RS232READBYTE)
							   (CHARCODE i)))
				     (BLOCK 1000))
			       (SETQ MARKER.FLAG NIL)
			       (SPEAK "↑[*5L")))
		 (QUOTE NAME)
		 (QUOTE Answer% Phone])
)
(PUTPROPS ANSWER-PHONE COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (378 1585 (ANSWER.PHONE 388 . 1583)))))
STOP