CHAPTER 10 UNATTENDED MODE The unattended mode will let you or your friends call and access your system from a remote location. The remote user can leave a message in the buffer or in a disk file or retrieve a message from the buffer or disk. Disk files can be sent to or received from the remote user's system using either the XMODEM protocol or the MMGR protocol supported by this program. The remote user can also change logged drives and look at the directory (catalog) of your disks. After you specify the welcome message and password, no further action is required on your part. Your system will automatically answer calls, send the welcome message, ask for and verify the password, provide help menus, and hangup when the remote user is finished. To use the unattended mode, you must have a modem which can answer the phone in the answer mode, detect the remote carrier, and hangup either automatically or under the direction of this program. The following modems are among those which have these capabilities: 1) Apple Modem 300/1200, or Personal Modem 2) Applied Engineering Datalink 3) E+E Avatex 1200 4) Hayes Smartmodem 300/1200/2400 or 1200A 5) "Smart" modems which are Hayes-compatible 6) Hayes Micromodem II or IIe 7) Novation Apple-CAT II 8) Novation Smart-Cat 9) Prometheus Promodem 1200 or 1200A 10) Transend ModemCard 11) US Robotics Courier 2400 12) Zoom Modem ][e 13) Most auto modems There are dozens of modems in category 5) which are compatible with the Hayes Smartmodem command set. All of the ones tested with this program worked in the unattended mode. However, there may be a few which are not exactly compatible and do not operate reliably in this mode. If you are using an external "non-smart" modem, you must enable carrier control and interface the modem carrier-detect (DCD) signal properly to your computer. This interface is described in Chapters 4 and 11. If you are using an internal plug-in modem or an external "smart" modem, you may set carrier control to ON or OFF. If you set carrier control ON, you must interface the external modem carrier-detect signal to your computer. The Novation Apple-CAT II will operate in the unattended mode using any of the three drivers you may have installed for this modem. Unattended operation with the Apple-CAT in the 202 half-duplex mode will have some slightly different characteristics than with the other modes; we will describe this later in this chapter. The diagram shown below shows how you can enter or exit the unattended mode. TERMINAL ---U---> UNATTENDED MODE <-QY-- - MODE You can enter the unattended mode by using the U command in the terminal command mode. The remainder of this paragraph applies to the DOS 3.3 version only. In the DOS 3.3 version, the work disk must be in the same drive that the program was started in. If it is not in the same drive, the unattended program module will not be found and the the program will attempt to return to the terminal mode. If the work disk is not in the same drive, the terminal program module will not be found either and the program will halt. An error message will prompt you to insert the work disk in the drive and press any key to re-start the program. After returning to the terminal mode with the work disk in the proper disk drive, you can try to enter the unattended mode again with the U command. After a few seconds of disk activity, the program will ask you to enter the wel come message. This is the "hello" message which your system will send to the remote caller when your modem answers the phone. The welcome message must not exceed 64 characters and can not include control characters. You may use the backspace key to edit your entry. After entering the welcome message, enter [RETURN]. If you don't want to have a welcome message, just enter [RETURN] alone. If you want to quit the unattended mode, enter [ESC]. Here are five example welcome messages: Welcome to the IMSAI users group. Joe: Read the message in file "TO.JOE". Frank: Leave your arrival time in the buffer. Call 555-1212 for more info. THIS IS A PRIVATE SYSTEM. After you enter the welcome message, the program will ask you to enter the password. This is the password the remote caller must use to access your system. The password must be 16 characters or less. It may consist of upper-case letters, numbers, or punctuation symbols. You may use the backspace key to edit the password. After you have specified the password, enter [RETURN]. If you don't want password protection, just enter a [RETURN]. If you want to quit, enter [ESC]. After you enter the password, the modem will switch to the answer mode. This may take a few seconds. You will then see the following message: Waiting for call 01 The 01 means your system is waiting for the first caller. This number will be incremented for subsequent calls. Your system is now ready for a call and there is nothing further for you to do. If you want to quit this unattended mode, enter [ESC]. A few seconds may elapse before you are asked to confirm this. Enter Y (for Yes) if you want to quit and return to the terminal mode. Enter N (for No) if you want to remain in the unattended mode. If you want to change the welcome message or password, you must exit the unattended mode and enter it again. These two entries can be entered only during initial execution of the unattended mode. The unattended program will not switch baud rates automatically. You must select the desired baud rate while you are in the terminal mode before you enter the unattended mode. You must tell all potential callers which baud rate your unattended system is set up for. (Don't forget to tell them the password also). REMOTE CALLER The preceding discussion described what you have to do to set up your system for unattended operation. The remainder of this chapter will cover what you have to do if you are the remote user calling the unattended system. You do not have to use MODEM MGR or an Apple computer to call the unattended system. You can use any software and any computer as long as you are able to transmit a CR character and the escape character. Before calling the unattended system, be sure your baud rate matches the baud rate of that system. The unattended system will echo any characters you send and will send a LF after each CR echoed. If you ar e using MODEM MGR, be sure your program is in full duplex and your program is not sending LF characters after CR characters. (Unless you are using the 202 mode, which we will discuss later). This is the same setup you would use to call an information or bulletin board system. Use the F and I commands if necessary to set this operating environment. Call the unattended system in the originate mode. The unattended system will answer the phone and enable its answer-mode carrier. Your modem should respond with its originate carrier. Wait a few seconds for both modems to go online, then send a CR by pressing the [RETURN] key. If your remote system does not have a [RETURN] key, try control-M. If the unattended system doesn't send the welcome message, wait a second or two and try again. The CR character must be sent before the unattended system will respond. When the unattended system receives your CR, it will send you the welcome message (if there is one) and ask you for the password. You must send the correct password. If you make a mistake in entering the password before entering [RETURN], you may use the backspace key and correct your entry. If you send the wrong password, the remo te system will warn you and allow you to make two more tries. If you do not send the correct password with the three attempts, the unattended system will hang up. After the password is successfully recognized by the unattended system, it will send you the following prompt which indicates it is awaiting your command: [Command?]--> Note: Most of the command and status messages sent by the unattended system will be enclosed in [ ] brackets. This will help you to distinguish between the commands and status of your system and the commands and status of the unattended system. Some unattended system disk error messages will not be enclosed in [ ]. If you do not see the [Command?]--> prompt, you can set the unattended system into the command mode by sending an escape character. If you are using MODEM MGR to access the unattended MODEM MGR system, remember that you must type [ESC] twice to send the escape character (unless you have redefined the terminal command key). When you enter [ESC] the first time, you will see your own Command? --> prompt. After you enter [ESC] the second time, the escape character will be sent and the unattended system should reply with the [Command?]--> prompt. If you lose track of the unattended system status, just keep entering [ESC] until you see the bracketed [Command?]--> prompt from the unattended system. If you have changed your terminal command key to some other key, just type [ESC] once to send the escape character to the unattended system. If you send the ? character as a command to the unattended system, it will send the menu shown in below. These are the commands the unattended system will respond to. These commands are similar to the commands used in the terminal and transfer modes, and will be briefly described. REMOTE COMMANDS ~~~~~~~~~~~~~~~ B: Buffer ON/ OFF C: Clear buffer R: Restore buffer V: View buffer L: Look at status H: Hangup D: Disk functions X: XON/XOFF 1: Rcv MMGR file 2: Snd MMGR file 2: Rcv XMODEM file 4: Snd XMODEM file [DISK COMMANDS] [DISK COMMANDS] Drive= 1 Prefix=/ MMGR/ C: Catalog C:Catalog R: Read file R:Read file W:Write file W:Write file D: Drive P: Prefix D: Drive Figure If you send a character to the unattended system which is not one of these comm ands, the unattended system will exit the command mode and enter the terminal mode. If you send an escape character to the unattended system while it is in the terminal mode, it will switch to the command mode. This is similar to the type of operation used in the normal (attended) terminal mode. B: BUFFER ON/OFF The B command will toggle the capture buffer of the unattended system on or off . When the buffer is on, any text you send to the unattended system will be captured in its buffer. You can send text from your keyboard or you can send text from one of your disk files using any one of the non-protocol methods in your transfer mode. If your disk file is sent with a non-protocol transfer and it has an escape character in it, it will switch the unattended system into the command mode. The character in your file following the escape character will be considered a command by the unattended system and some undesired response may take place. If your disk file has some unusual characters like the escape character in it, use a protocol transfer to send it to the unattended system. Protocol transfers with the unattended system will be covered later. Since any user can clear the buffer of the unattended system, you should save anything of significance you have sent to the unattended system to its disk. If the buffer is off, received text will not be captured in the buffer of the unattended system. C: CLEAR BUFFER The C command will clear the buffer of the unattended system. If you wish to restore the buffer, see the restore command. The buffer will also be cleared if you send files to or receive files from the unattended system using a protocol transfer. R: RESTORE BUFFER If you have cleared the buffer of the unattended system and want to restore it again, enter the R command immediately to restore it. V: VIEW BUFFER The V command will let the unattended system transmit the contents of its buffer to you. You can halt and restart the transmission by sending the space character and you can cancel the buffer transmission by sending a CR (except in the 202 mode). L: LOOK AT STATUS When the L command is sent to the unattended system, it will send you a summary of its status. The following is a typical summary of the status of the unattended system: [BUFFER ON] [XON/ XOFF ENABLED] [O/34047] [LAST DISK ERROR: NONE] Note the status sent by the unattended system will be enclosed in [ ] brackets. The first status line shows whether the buffer is on or off. The second status line shows whether XON/XOFF is enabled or disabled. The third status line shows the number of bytes captured in the buffer and the space left in the buffer. The fourth status line shows the last disk error during protocol transfers. If a disk error occurs at the unattended system when protocol transfers are being performed, the remote system will not display the received error message because it is looking for a handshake character instead. A disk error will also force a termination of the transfer so the remote system may be busy closing the disk file when the disk error message is transmitted. Therefore, disk error messages during protocol transfers are saved for display on the last status line. If a protocol transfer has been cancelled by the unattended system, use the L command to check if a disk error occurred. After you have requested the status of the unattended system by using the L command, the last disk error status will be reset to NONE. H: HANGUP The H command will force the unattended system to hangup. You should always execute this command when your session with the unattended system is completed to provide a positive disconnect at the unattended system. D: DISK FUNCTIONS The D command will let you execute remote control of some disk operations at the unattended system. When you enter this command, the unattended system will send a [Disk command?]--> prompt. If you enter a ?, you will see either the DOS 3.3 or ProDOS remote disk functions menu in shown above. The Drive= or Prefix= shows which drive or prefix is currently active at the unattended system. The D command can be used to change the logged drive. In addition, the ProDOS version allows the P command to change the active prefix. The menu shows the disk commands you can use. These commands are similar to the disk functions described in chapter 6, with the following differences: 1) You cannot erase a disk file directly. However, you can effectively erase an unlocked disk file by over-writing it with another file having the same name. 2) You can read or write text files only. Use the protocol transfer to send or receive other types of files. 3) With DOS 3.3, you cannot specify another disk slot. With ProDOS, you can spe cify a prefix on another slot. X: XON/XOFF The X command will enable or disable the XON/XOFF handshake at the unattended system. When XON/XOFF is enabled, the unattended system will transmit a control-S when its input buffer is nearly full. If the remote system uses XON/ XOFF handshaking, it should stop transmitting. When the input buffer level becomes empty, the unattended system will transmit a control-Q, and the remote system can resume sending again. When XON/ XOFF is disabled, the unattended system will not transmit any handshaking signal. If the remote system also responds to control-S and control-Q as handshake signals, then XON/XOFF should normally be enabled at both the remote and unattended systems. 1: RECEIVE MMGR FILE The 1 command lets the unattended system receive one of your disk files using the MMGR protocol file transfer. The unattended system will ask you to furnish the filename or pathname under which that system will save the transferred file. The file will be saved on the currently logged disk at the unattended system or you can append a comma followed by D# after the filename to specify another drive number #. If a file with the same name exists on the drive at the unattended system, that system will send you an error message. With protocol transfer to an unattended system, you cannot send a file with a name which currently exists on the same drive of that system. After you have specified a suitable name, you will receive a ready-to- receive message. You must then switch to your transfer mode. Do this by entering [ESC] to get into your terminal command mode (Command? --> displayed) and Y to enter your transfer mode. When you are in your transfer mode, enter the same 1 command. For your remote system in the transfer mode, this is the command to send an MMGR file. Note the same command number (in this case command 1) is used for both the unattended system command and your transfe r command. This makes it easier to insure you have picked the correct complementary commands ('receive' at the unattended system and 'send' at your remote system). After you specify the name of the file to send, the transfer will proceed in the manner described in Chapter 9. Refer to that chapter for details. When the transfer is completed, quit the transfer mode. When you are back in your terminal mode, you will still be online with the unattended system. 2: SEND MMGR FILE The 2 command lets the unattended system send you one of its disk files using the MODEM MGR protocol file transfer. The unattended system will ask you to furnish the filename or pathname of the file to send. The file should be on the currently logged disk at the unattended system or you can append a comma followed by D# after the filename to specify another drive number #. If the file exists at the unattended system and it is not a DOS 3.3 text file, that system will send you a [Ready to send] message. You must then enter your transfer mode and prepare to receive the file. If it is a DOS 3.3 text file, the unattended system will ask you whether it is a sequential or random text file. See the discussion in chapter 9 regarding the differences in transferring DOS 3.3 sequential and random text files. If the file does not exist, you will receive a [FILE NOT FOUND] message and will be asked for the name again. When you are in your transfer mode, enter the same 2 command. For your remote system in the transfer mode, this is the command to send a MMGR file. Note the same transfer command number (in this case command 2) is used for both the unattended system command and your remote command. After you specify the filename or pathname to use for saving the file on your disk, the transfer will proceed in the manner described in Chapter 9. When the transfer is completed, quit the transfer mode and return to the terminal mode. You cannot transmit any of the MODEM MGR main execution programs from the unat tended system. These programs have names starting with the letters MDM (if DOS 3.3) or MDP (if ProDOS). If you attempt to have these files transmitted, the unattended system will hang up. 3: RECEIVE XMODEM FILE This command is similar to the 1 command for receiving a MMGR file. The major difference is the XMODEM protocol is used instead of the MMGR protocol. You must also specify the type of file under which the unattended system will save the received file. The file types are either TXT, BIN, or BAS. The Integer file type is allowed with DOS 3.3. When you enter your transfer mode to send your file, use the same command number 3. Additional information on XMODEM transfers is in chapter 9 and will not be repeated here. 4: SEND XMODEM FILE This command is similar to the 2 command for sending a MMGR file. The major difference is the XMODEM protocol is used instead of the MMGR protocol. You must also specify the type of file under which your system w ill save the file sent by the unattended system. When you enter your transfer mode to receive your file, use the same command number 4. Additional information on XMODEM transfers is in chapter 9. TIMEOUT If you don't transmit anything to the unattended system for a long period of time, the unattended system will send you a [BYE] message and hang up. This is an automatic disconnect in case you have become distracted by another more important activity. This also provides an eventual hangup if you disconnect without issuing the hangup command to the unattended system and that system does not have carrier control enabled. To prevent timeout, you should occasionally send a character or command to the unattended system to show you are still there. TERMINATION When you are finished, the best way to terminate the session with the unattended system is to execute the H command when that system is awaiting a command from you. This will force the unattended system to hang up and reset for the next caller. After the unattended system acknowledges the hangup command, you can then hangup your system. If the unattended system is not using carrier control and you hang-up your system without commanding the unattended system to hang up first, the unattended system will probably hang up also (if the modem disconnects automatically), but the unattended system will not reset until it times out. This will make it unavailable to any other caller during the timeout period. However, if the unattended system is using carrier control, it will hangup and reset immediately even if you hangup first. It is a good practice at the end of a session to issue the hangup command to the unattended system even if it has carrier control. MANUAL OVER-RIDE The operator of the unattended system (SYSOP) can enter commands and text from his keyboard and the system will respond as if they were received from the remote caller. This "attended" operation can be useful in providing assistance for a caller who is not familiar with the system commands. BUFFER OVERFLOW Although a large input buffer (not the same as the capture buffer) is used at the unattended system, buffer overflow can occur if you are using a non-protocol transfer to send a long file from the remote system at the effective baud rate continuously without XON/XOFF handshaking. The unattended system echoes incoming text and inserts a LF after each CR received. Therefore, the unattended system is normally sending more characters than it is receiving. If the incoming text is at the maximum rate (the hardware baud rate), the unattended system must send more characters, but is limited to the same baud rate for sending. Therefore, it cannot echo the incoming text at the maximum throughput rate forever. If the incoming text is non-stop, eventually the unattended system buffer will overflow. Selecting a lower baud rate is not a solution because although the rate at which characters are being received is reduced, the sending rate is correspondingly reduced also. This is not a problem with protocol transfers because the incoming characters are not echoed and there are pauses between blocks transmitted. To avoid buffer overflow on long non-protocol transfers, use a slower sending pace or enable XON/XOFF at the remote and unattended systems. SMARTMODEM ESCAPE CHARACTER In the unattended mode, MODEM MGR changes the "smart" modem escape character sequence from +++ to ---. This reduces interaction when both the remote and unattended systems are using "smart" modems. Do not change the "smart" modem escape character sequence. APPLE-CAT II 202 MODE If you are using the Apple-CAT 202 1200 bps half-duplex driver, you can also use the unattended mode. Anyone calling your system must be using the same driver. Most of the same features described earlier for the unattended system are available, including protocol file transfers. One exception is the caller cannot interrupt non-protocol trans mission of a disk text file or a view operation. Since this is a half-duplex system, the caller must wait until the unattended transmissions are completed before sending his commands. The carrier hang-on time is reduced significantly on most unattended system transmissions so a slight delay is all that is required. Before you call the unattended system, use the terminal F command to place your system in half-duplex and use the I command to insert a LF after every CR you send.