![]() |
|||||||||||||||||||||||||||||
EasyServer II: Setting Up Devices and Services (continued) |
|||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
| \c | Do not append carriage return to output |
| \d | Output delayed by 2 seconds |
| \p | Output delayed by 1/4 second |
| \\ | RP with backslash character "\" |
| \^ | RP with caret character "^" |
| \ddd | RP with ascii character whose value is = to the octal value ddd |
| \n | RP with newline character |
| \r | RP with carriage return character |
| \s | RP with space character |
| ^c | RP with control character "c" |
| \T | Output the phone number (above codes are not interpreted) |
| \D | Output the phone number (above codes are interpreted) |
Each output string has a carriage return character appended to it unless it contains the special sequence "\c". Expect strings do not have anything appended to them and don't require the "\c" sequence. Expect strings can be more complicated.
- An expect string of a single dash ('-') means to expect nothing and proceed with the next output string.
- An expect string of "TIMEOUT" followed by a number of seconds will change the timeout value (default is 30 seconds). For example, the script "atdt1234 TIMEOUT 10 login: wysenet password: wysenet" sets the timeout value to 10 seconds and attempts to log into an account called wysenet.
- An expect string of "ABORT" followed by a second string will cause the script to abort if the second string is encountered on any input from the port. Multiple abort strings can be specified within a script. A match with any of the abort strings will cause the script to fail. For example, the script "atdt1234 ABORT NO\sDIALTONE ABORT BUSY login: wysenet password: wysenet" sets up two abort strings and attempts to log into an account called wysenet. If the modem cannot detect a dial tone or the phone line on the other modem is busy the script will fail immediately without waiting until the current timeout value expires.
- An expect string can also be formed by a nested series of expect and output strings separated by dashes ('-'). "expecta-outputa-expectb-outputb-expectc-...-expectn" This format is interpreted as expect string "expecta". If that fails then output string "outputa" and expect string "expectb". If that fails then output string "outputb" and expect string "expectc". And so on until either a match occurs or there are no pairs of nested expect-output strings.
Creating a Simple Dialer
Using a Terminal or Terminal emulator, go through all the steps to log onto the system you will be calling. Make careful note of the text that appears just before you need to enter information. Also take careful note of any information you need to enter. These two pieces of information are basically the chat script for your DIALER.
The following example sets up a dialer called "isp" for PPP using a typical login style chat script.
CHANGE DIALER isp PROTOCOL PPP
CHANGE DIALER isp HOST ADDRESS 192.168.0.1
CHANGE DIALER isp LOCAL ADDRESS 192.168.0.2
CHANGE DIALER isp SUBNET MASK 255.255.255.0
CHANGE DIALER isp SCRIPT "atdt123 ogin:--ogin: npp password:
nppp"Once we have created a dialer, and configured a port for use with a modem (see MODEM tutorial), we are ready to test the dialer. From the servers command prompt enter:
CONNECT DIALER isp DIAGNOSTICS ENABLED
It is best to test your dialer with diagnostics enabled so that you may see why it is failing and correct any errors in the script.