!---------------------------------------------------------------------- ! Fully-commented InterSLIP dialing script ! version 1.0, Tue 9 Nov 1994 ! ! InterCon has graciously provided InterSLIP ! gratis to the net.community but they neglected to show us how to ! script it. (Don't bother lookingin the InterSLIP docs.) This is my ! attempt to fill the void. ! ! This script is composed of two parts: the "outer" part configures a ! modem and dials a number (forever) as specified in the InterSLIP ! control panel. The "inner" portion acts when you're connected, and ! negotiates the transactions with the answering terminal server. ! ! Copyright (c) 1993-1994 by Michael Sattler. All rights reserved. ! ! Please e-mail any suggestions, comments, corrections, and questions ! to me at msattler@GeekTimes.com. ! !---------------------------------------------------------------------- ! Assumptions: ! ! Your modem will return the strings "CONNECT" and "BUSY". Check the ! docs for your particular brand of modem to see how to configure this. ! Many do this by default; try "AT&F1" (revert to default factory ! settings). ! ! Your modem uses the string "AT" to initiate command sequences. ! ! Your modem uses the string "ATH" to hang up. ! ! Your modem recognizes the string "+++" as the attention sequence. ! !---------------------------------------------------------------------- ! ! C O N F I G U R E T H E M O D E M ! A N D ! D I A L U N T I L C O N N E C T E D ! !---------------------------------------------------------------------- ! ! You begin at "originate" when you hit the Connect button on the ! InterSLIP dialer. ! @originate ! canonical label ! ! We do this section the first time through the script and after a ! BUSY is detected. ! note "Initializing the modem (^4)..." ! pause 30 ! give the human a chance to read ! ! "note" writes the specified message to the InterSLIP status area. ! ! Initialize the modem. ! write "^4\13" ! initialize the modem ! ! "write" sends the specified string to the modem. ! ! "^4" is replaced by the modem initialization string specified by ! the user in InterSLIP. ! ! "\13" denotes the end of the command (so the modem will "see" it). ! pause 20 ! let modem digest prev command ! note "Setting speaker mode (ATM^2)..." ! pause 30 ! give the human a chance to read ! write "ATM^2\13" ! set the speaker mode ! ! "^2" is replaced by the modem speaker mode string specified by ! the user in InterSLIP. ! pause 20 ! let modem digest prev command ! ! "pause" pauses the script for the time specified. ! ! Times are specified in one-sixtieth of a second. ! !note "Dialing ATD^3^1" !pause 30 ! give the human a chance to read !write "ATD^3^1\13" ! note "Dialing ATDT^1" !pause 30 ! give the human a chance to read write "ATDT^1\13" ! ! "ATD" causes the modem to dial (using the proper dial mode) the ! dial string, hopefully resulting in a phone call to a modem or ! terminal server on the other end. ! ! "^3" is replaced by the dial-mode string (denoting tone or pulse ! dialing) specified by the user in InterSLIP. ! ! "^1" is replaced by the dial string (eg. "9,555-1212") ! specified by the user in InterSLIP. ! pause 20 ! let modem digest prev command ! matchstr 1 originate "BUSY" matchstr 2 connected "CONNECT" ! ! "matchstr" matches strings received from the outside world to a ! an arranged list of strings in the script. The two preceeding ! lines have set up a relationship between a string to match ("BUSY" ! and "CONNECT") and the next section of code to execute ("originate" ! and "connected", respectively). (The numbers immediately after the ! matchstr verb seems to always start at 1 and increment by 1, ending ! with the "matchread" verb that uses the relationships. ! matchread 600 ! ! "matchread" causes the script to wait for input for the specified ! period of time. If neither "BUSY" nor "CONNECT" are seen before ! the matchread expires, we fall through to the following section of ! the script. (The matchstr relationships are wiped clean with the ! "matchclr" verb.) ! note "Failed to connect. Trying again." pause 30 jump originate ! ! !---------------------------------------------------------------------- ! A N S W E R M O D E ! ! I haven't ever used answer mode, but I've left a stub here in case I ! ever figure out why I want my computer to pick up the phone. ! @answer ! canonical label exit -1 ! failure ! ! "exit" stops the script and passes to the calling program (the ! InterSLIP dialer) a status; success is 0, failure is -1. ! !---------------------------------------------------------------------- ! H A N G U P ! ! This section of the script is executed when you hit the Disconnect ! button on the InterSLIP dialer. It gets the modem's attention and ! then instructs it to hang up the line. ! @hangup ! canonical label note "Hanging up the modem..." write "+++" pause 20 ! let modem digest prev command write "ATH\13" pause 20 ! let modem digest prev command exit 0 ! success ! ! ! !---------------------------------------------------------------------- ! ! S U C C E S S !!! ! ! N O W Y O U ' L L J U M P T O T H E ! G A T E W A Y S C R I P T ! !---------------------------------------------------------------------- @connected exit 0 ! success !---------------------------------------------------------------------- ! end of the script !----------------------------------------------------------------------