PPPDIAL.CMD REXX Script for IBM's OS/2 ® Warp 3.0 Internet Access Kit
Written by: Don Russell - Copyright © 1995.
*Team OS/2*
Vancouver British Columbia Canada
Last updated: 25 August 1995 (Documentation changes)
Most recent version: 2.6 - 24 August 1995
The
most recent documentation is on-line.
If you add the on-line document to your quick list
then you can delete the copy shipped with the original zip file.
PPPDIAL.CMD Features
- First and foremost: Automatic Re-Dial :-)
- Multiple phone number support for a single Internet provider
- Customization via a response file
- Dials either SLIP or PPP providers
- May be used with call-back systems
PPPDIAL.CMD is a REXX script used with the IBM Internet Access Kit included with
IBM OS/2 ® Warp V3.0 Bonus Pak.
Its purpose is to compliment the function of Dial Other Internet Providers
(SLIPPM.EXE) by providing an automatic re-dial capability.
SLIPPM.EXE, as supplied by IBM, does not currently (Version 2.0 Rev 1.12) provide this
function itself.
Instead, the user must select the Dial button over and over when busy conditions persist.
I found this to be a great time-waster because my modem was able to report back a busy
condition in a matter of seconds and I would be interrupted from my other OS/2 work to
start another dial attempt.
Obviously this prevented me from doing any other work with OS/2 (or anything
else for that matter).
So, why do I want pppdial.cmd? Because it saves me time.
With pppdial.cmd I can request a dial attempt once and pppdial.cmd takes over the task of doing
the necessary re-dialing.
After the modems connect successfully, pppdial.cmd can respond to host prompts with
a login id, a password, data entered directly from the keyboard (if used without slippm.exe),
or any other data you care to specify.
I have come to depend on pppdial.cmd to provide the basic redial function thus allowing me
to continue other work uninterrupted.
When pppdial.cmd finally does get me logged on, a beep brings my attention to the 'net.
[Contents]
[Contents]
- Fixed syntax error when using [SLEEP] keyword
- Fixed trying to use slip_com_input function for ppp connections
- Shortened default pause from 10 to 5 seconds between dial attempts
- Additional error checking/help when using response files with
the Dial Other Internet Providers (SLIPPM.EXE) program.
- Misc Timing changes to cope with slow logons.
- Support [PPPDIAL_MIN_CARRIER] to redial when a slow connection
is established. (Requires modem cooperation :-)
- Look for the .rsp file in the dialer's working dir before insisting
on the full path.
- Support [SLEEP] in response file
- Support [$IPDEST] and [$IPADDR] keywords for dynamic SLIP connections.
- Change so response file settings override the dialer ini settings.
- Fixes some minor bugs when using the Disable
feature of SLIPPM.EXE.
- Additional [PPPDIAL_...] keyword support.
- Report modem carrier rate when connected.
- Change readme.txt to HTML for easier viewing and finding information.
My intent is for the HTML to be permanently available so people can refer to it
at their leisure and be advised of new releases etc.
- Support for accepting keyboard input when using ppp.exe
without slippm.exe. (i.e. from the command line).
- Improvements over 2.3 in dealing with the slippm V2.0 R1.8h peculiarities.
(Thanks to Ed Tomlinson)
- Rework of some of the modem interface code.
- Added a check for drive and path specification for response file.
- Additional [PPPDIAL_...] keyword support.
- Recognize "protocol" response from Megahertz modem.
- Add support to send CTRL- sequences from response file
- Add support to issue OS/2 commands from the response file
- Fix redialing when using the new slippm.exe from IBM (V2.0 R1.8h)
- Additional [PPPDIAL...] response file parameters
- Recognize more modem responses...
- Change some logic to make it easier to customize to reject slow connections.
- Improve response file handling.
- Add response file keywords for setting pppdial parms.
- Fix a bug or two :-)
- Fix processing of "hung connection".
Redialing after a "hung" connection got dropped by the 2.0 changes. :-(
- Recognize CARRIER ... response from some 28.8 modems
- Support multiple phone numbers
- Get userid/password from Dial Other Internet Providers ini file
- Get timing info from modem
- Support response file after modem connection
I decided to write this script after someone asked me if I already had a script
that would redial when a busy condition was encountered.
[Contents]
- UNZIP ppdial25.zip into any directory.
- double-click pppdial.cmd.
PPPDIAL.CMD will move itself to the \tcpip\bin directory and display further help.
After displaying help it will erase the original pppdial.cmd file.
(The original zip file is still valid.)
Any previous version of pppdial.cmd is replaced,
without prompting, so you
may wish to back up any existing pppdial.cmd file yourself.
- start the Dial Other Internet Providers application.
- use modify entry (or add entry)
- in the Login sequence: field enter pppdial.cmd
The response file option
is required if your Internet provider uses something
other than ogin: to prompt for your user id or something other than
ssword: to prompt for your password.
Also, if you require more than entering your login id and password then the
response file will be beneficial.
- save the changes
- installation complete
[Contents]
In its simplest form pppdial.cmd does not need any configuring other than
from the Dial Other Internet Providers application.
In most cases this is already done because pppdial.cmd is not installed until
after discovering that re-dialing is not done by SLIPPM.EXE.
After a successful modem connection is established pppdial.cmd watches
for the character sequence ogin: and then sends your loginid
as specified in the Dial Other Internet Providers notebook on Page 1.
PPPDIAL.CMD watches for the characters ssword:
and then sends your password.
At that point pppdial.cmd completes with an audible tone to indicate you are
connected and logged on.
In this case, it is necessary to enter your password in the SLIPPM.EXE notebook and save the
changes.
Though you may leave the password field blank and SLIPPM.EXE will prompt for it, SLIPPM.EXE does
not make it readily available for the external REXX script and so pppdial.cmd will not know what your
password is.
There is an implicit security risk when you keep your password in this manner since anyone
with access to you system could log on with your account information.
If this is a concern to you, pppdial.cmd may be used
from the command line and
you can be prompted to enter your login id and/or password from the keyboard.
In this case, the password is never kept in a disk file and is therefore more secure.
If your provider does not use the above prompts, or uses a more complex conversation
to get logged on, or if you simply want to customize pppdial.cmd a bit then you will want to
read the response file section.
[Contents]
There are several sources of information if you have problems with pppdial.cmd:
If you're sending e-mail,
please use a subject line of PPPDIAL, including the version number.
The phone number specified in the
Dial Other Internet Providers notebook field on page one
may contain more than one phone number, separated by a space.
i.e 555-1212 800-123-4567.
Or, if you need to specify more phone numbers than slippm.exe allows
you to fit in the phone number field then you may enter a file specification
(drive:\path\name) of a file which contains a list of phone numbers, one on each line.
The keyword [PPPDIAL_PHONE] may be used within a response file.
The pppdial.cmd script file accepts one optional parameter - a file specification
(drive:\path\name) of a text file.
This response file may be in any directory on any drive and has a fairly
strict format, described below.
This parameter should be placed in the login sequence field
on page 1 of the Dial Other Internet Providers application.
i.e. pppdial.cmd d:\dir1\subdir1\myresp.rsp
Do not press the enter key when typing this information in.
The SLIPPM.EXE program will probably display the information on two lines, this is fine.
There are no requirements regarding the file's drive, path, name, extension etc.
(That's why all the details are needed)
Except where noted, keywords mentioned here begin in column one of the response file.
All keywords are uppercase, with no spaces and are contained within square brackets.
The first line must be GO or WAIT indicating
whether pppdial.cmd initiates the host conversation or
should wait for a specified prompt.
Comments and blank lines are allowed within the response file.
However, they may not appear before
the GO or WAIT keyword which must be the first line.
[PPPDIAL_REM] begins a comment.
Keywords that use the PPPDIAL_ prefix do not affect the conversation between
host and client.
Instead, they set options for pppdial.cmd execution.
The sequences [LOGINID] and [PASSWORD] will
be substituted with your login id
and password taken from the Dial Other Internet Providers> ini file.
CTRL- sequences may be sent from the response file by using the ^ (hat)
character. i.e. ^M will be sent as a carriage return.
A line consisiting only of \r will cause a carriage return to be sent. Or use ^M
The response file is useful for systems that do not immediately prompt for
the userid, instead requiring the user to "press enter" or make a menu selection
etc.
The first line of the response file is a synchronization keyword to
indicate whether to wait for a prompt, or to start sending.
The keyword must be either GO or WAIT.
Generally, lines in the file are used in pairs: assuming we wait for a prompt after
getting connected, the first line will be WAIT, the second line is what we wait
for, the third line is what we send in response, etc.
If WE must start the conversation after connecting, the first line in the
file will be GO and the second line will be sent right away.
We will wait for the system to reply with what we have in line 3 and so on.
Though I initially designed pppdial.cmd to work with IBM's
Dial Other Internet Providers (SLIPPM.EXE) program, there is a good reason
for bypassing SLIPPM.
SLIPPM.EXE requires intervention to start dialing.
I use the following REXX CMD file to perform the following functions for me:
- Suspend fax reception while I'm logging on to/using Internet
- Begin dialing my internet provider and get logged on.
(I use the response file option to start mail. web and news reader once I'm logged on)
- Resume fax reception when I end the internet session.
/* REXX */
call rxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
address cmd
'd:\faxworks\fxrcv.exe -off'
call syssleep 3
'ppp.exe com1 57600 rtscts modem defaultroute priority 1 exit connect "pppdial.cmd c:\new\myppp.rsp"'
say 'PPP return code' rc
'd:\faxworks\fxrcv.exe -on'
exit
The response file used is listed below.
GO
[PPPDIAL_REM] Don Russell - drussell@direct.ca - sample pppdial script response file.
[PPPDIAL_REM] Note: GO is still required first... and we use GO instead of WAIT
[PPPDIAL_REM] because our first action is a [REPEAT] which means WE start.
[PPPDIAL_USE_DIALER]
[PPPDIAL_PREFIX] ATDT*67W
[PPPDIAL_PHONE] 482-7000
[PPPDIAL_REM] I only want to connect at 14400...
[PPPDIAL_INIT1] ATZ
[PPPDIAL_INIT2] AT&N8
[PPPDIAL_DELAY] 3
[PPPDIAL_REM] Only retry dialing 500 times
[PPPDIAL_MAX_REDIAL] 500
[PPPDIAL_REM] OK, parms have been defined... let's get to the prompt/reply part...
[REPEAT] ^M ogin: 3
[KEYBOARD]
ssword:
[KEYBOARD_NOECHO]
[OS/2] START /K /B /MIN /I C:\NEW\STARTMAIL.CMD
No new keywords are introduced in this version :-(
The following keywords are used to set pppdial options.
They may appear in any order, in any place within the response file
provided they begin in column one.
If a keyword is duplicated, the most recent one read is used.
(i.e. the one nearest the end of the file.)
- [PPPDIAL_CARRIER_TIMEOUT]
- allows the setting of Modem Register 7 value.
(Usually this is determined dynamically, but I've had
reports of that causing problems with some modems.)
- [PPPDIAL_DELAY]
- allows specifying the number of seconds between dial attempts
- [PPPDIAL_DIAL_PREFIX]
- Not to be confused with [PPPDIAL_PREFIX] :-)
dial_prefix is intended to be used with PBX systems requiring
a '9' (or something) before the phone number.
(PPP_PREFIX is used for the modem command dial prefix. ATDT perhaps)
- [PPPDIAL_DO_NOT_USE_DIALER]
- No value is used here. This keyword indicates
that all information will be provided by the response file.
If this is not used, then prefix and phone number etc will be
obtained from the dialer, replacing values specified in the
response file.
- [PPPDIAL_INIT1]
- allows setting 1 or 2 modem init strings (include AT)
- [PPPDIAL_INIT2]
- allows setting a second modem init string (include AT)
- [PPPDIAL_MAX_REDIAL]
- allows setting a maximum number of redial attempts.
The default is 32767.
- [PPPDIAL_MIN_CARRIER]
- The number following indicates the minimum acceptable DCE rate
for your modem.
If the connection data rate is less than the minimum specified here then
pppdial will hang up and redial.
This feature is only meaningful when your modem responds with DCE rates
and not DTE rates.
i.e. CONNECT 14400
- [PPPDIAL_MODEM_ESCAPE]
- If your modem uses a sequence other than +++ to return
to command mode, this allows you to specify it.
- [PPPDIAL_MODEM_RESET]
- pppdial uses a modem reset command of ATH0Z unless this keyword is used to
specify something different.
- [PPPDIAL_PHONE]
- Specify the phone number to be dialed. This may be a
blank delimited list or a drive:\path\filename of a file
that contains a list of phone numbers, one per line.
For example:
[PPPDIAL_PHONE] 482-7000
[PPPDIAL_PHONE] c:\myphone.lst
- [PPPDIAL_PREFIX]
- The dial prefix used to start the modem dial command.
[PPPDIAL_PREFIX] ATDT70#W
- [PPPDIAL_QUIET]
- Do not beep when successfully logged in.
- [PPPDIAL_REM]
- allows comments to be placed in your response file
- [PPPDIAL_USE_DIALER]
- No value is used here. This keyword indicates
that some or all information will be provided by the
Dial Other Internet Providers ini file.
This is the default.
The following keywords are used as place holders to represent
data that sholud be sent to the host system.
Except where noted, these keywords may appear anywhere within a line of
text to be sent.
The surrounding text will be sent to the host as well.
- [KEYBOARD]
- When sending data from the script this temporaily interrupts the flow of the script
to accept input from the keyboard.
Characters are not sent to the host system until the enter key is pressed.
(This option is only available when used with ppp.exe directly
because slippm.exe does not allow user input from the keyboard.)
WAIT
Login:
[PPPDIAL_REM] Allow the user to enter their userid from the keyboard...
[KEYBOARD]
- [KEYBOARD_NOECHO]
- The same as [KEYBOARD] with the exception that typed characters are echoed
as asterisks (*). This is primarily for prompting for passwords.
Though pppdial does not display the characters as they are typed,
it is possible that your host system will echo them when pppdial sends them.
This is unlikely with items such as passwords because the host system typically does not
echo characters back for passwords.
- [LOGINID]
- Your login ID as specified in the dialer ini file.
This allows you to add a prefix or suffix to your login id if required.
For example, my provider requires %ppp to be appended to my actual
id for logging on.
I can accomplish this in the response file by using
[LOGINID]%ppp
This avoids having to include the %ppp as part of my userid.
- [OS/2]
- Any text after this keyword will be passed to OS/2 unmodified.
One of the more useful commands I presume will be the
START command.
This keyword must start in column one.
- [PASSWORD]
- Your password as specified in the dialer ini file.
Though this keyword may be used with a prefix and/or suffix, I don't anticipate
much use of this.
- [REPEAT]
- Allows a string to be sent to the host until a specified prompt is received.
This keyword must begin in column one.
Two or three parameters are required.
The first is the string to repeat.
The second is the string to compare for.
The third (optional) is a maximum number of times to repeat.
For example:
GO
[REPEAT] ^M Userid: 10
[LOGINID]%ppp
ssword:
[KEYBOARD_NOECHO]
- [SLEEP]
- One parameter is used to specify the number of seconds that
pppdial should pause before continuing.
If no value, or an invalid value is specified then a 1 second pause is used.
This keyword is really only useful after [$IPDEST] and [$IPADDR] keywords.
(Not yet supported.)
[SLEEP] 5
The following keywords are used to pick out information sent from the host
system.
These two keywords are meant to be used in pairs, on a line in the response file
where you are expecting data to be sent from the host. i.e. following the line
you send your password from.
These keywords cause pppdial to watch for IP addresses in decimal-dot
notation (i.e. 199.60.228.12).
Both should be specified on the same line, in the order your host system sends them to you.
For example...
...
ssword:
[KEYBOARD_NOECHO]
[$IPADDR] [$IPDEST]
If you like, othet text may be added as comments, mimicking what your provider sends.
As in ...
Session from [$IPADDR] to [$IPDEST] is beginning
In this case, the text is strictly ignored and only the order of the keywords is observed.
-
---cut ---
GO
[REPEAT] \r ogin: 10
[LOGINID]
Password:
[PASSWORD]
--- cut ---
GO tells pppdial that it must initiate the conversation after the modems
connect rather than wait for a response.
[REPEAT] causes pppdial to send a "return" (\r) and wait for
ogin: as a prompt.
If the requested prompt is not received this will be repeated 10 times.
If the count is missing, pppdial will REPEAT up to 1000 times, after which
it will hang up and dial again.
On successful receipt of ogin:, [LOGINID] is substituted with your id from
the Dial Other Internet Providers and sent to the host.
We wait for Password: and finally [PASSWORD]
is obtained from the Dial Other Internet Providers and sent to the host.
-
--- cut ---
WAIT
ogin:
[LOGINID]
ssword:
[PASSWORD]
--- cut ---
This has almost the same effect as the above example except pppdial waits for
the desired text instead of sending a carriage return first. (This is how pppdial
behaves if no response file is used)
-
--- cut ---
GO
[PPPDIAL_REM] Note: GO is still required first... and we use GO instead of WAIT
[PPPDIAL_REM] because our first action is a [REPEAT] which means WE start.
[PPPDIAL_REM] I only want to connect at 14400...
[PPPDIAL_INIT1] AT&N8
[PPPDIAL_REM] Only retry dialing 20 times
[PPPDIAL_MAX_REDIAL] 20
[PPPDIAL_REM] the 10 second default is too long... use 5 seconds...
[PPPDIAL_DELAY] 5
[PPPDIAL_REM] My modem S7 value is 35, but my modem won't tell pppdial that properly
[PPPDIAL_CARRIER_TIMEOUT] 35
[PPPDIAL_REM] OK, parms have been defined... let's get to the prompt/reply part...
[PPPDIAL_REM] My provider wants me to "press enter" until the Login: prompt appears
[PPPDIAL_REM] (By leaving out the 10 (number of times to try) pppdial.cmd will try
[PPPDIAL_REM] 1000 times)
[REPEAT] \r Login: 10
[LOGINID]
Password:
[PASSWORD]
[OS/2] START /K /B /MIN /I C:\NEW\STARTMAIL.CMD
--- cut ---
[Contents]
Using PPPDIAL with callback systems requires the use of a response file.
For example
GO
[PPPDIAL_REM] Make sure our modem is in auto-answer mode...
[PPPDIAL_INIT1] ATS0=1
[REPEAT] ^M ogin: 3
[LOGINID]
ssword:
[PASSWORD]
[PPPDIAL_REM] Now that we've passed the security, wait for the call
[PPPDIAL_REM] The modem will answer and give us a new CONNECT message
CONNECT
[Contents]
New versions of pppdial.cmd are put on the following ftp sites:
The file name is in the form of ppdial??.zip where ?? is
the version number. (i.e. ppdial26.zip)
At their convenience, the system operators then move it to:
If there are other ftp sites you'd like me to add to this list send me a note with the
site and directory names.
If you can't get to the sites mentioned above perhaps try using Archie to find another site.
If you'd like another site listed here, let me know what it is and I'll add it to the list.
[Contents]
This script may be distributed freely provided I am given credit for it, and it is
distributed in its original form.
Please do not alter my name or e-mail address nor the manner in which they are displayed.
There are several archive utilities other than the ZIP format.
If you would like to distribute this using a different format, I have no objections.
Please use the same filename (ppdial25) and include all the original files.
There is no charge for the use of this script.
If you decide you
like it and continue to use it, I'd appreciate hearing from you via
e-mail...
just a brief note saying which site you got it from and where you are using
it. A sort of electronic postcard from your home town. :-)
Please include your city and country as it's kind of hard to tell from some
e-mail addresses.
I've tested this as well as I can with a single provider.
Given the many providers and configurations, this may not work properly for you the
first time.
Specific things to watch for are the EXACT prompts used when the host
system is asking for a userid and password.
To change the script after it's been installed, use the EPM or E editor.
EPM d:\TCPIP\BIN\PPPDIAL.CMD
or E d:\TCPIP\BIN\PPPDIAL.CMD
In general I discourage this because if you want to use a future version
then you have to make your changes again.
Instead, I try to offer "customization" through the use of the resposne file.
[Contents]
PPPDIAL.CMD may be used to
set your PC/Workstation/Server clock
from a known time source available on Internet every time you log on.
Dial Other Internet Providers (SLIPPM.EXE)
Some settings in the dialer application have to be saved before pppdial.cmd
can use them.
The dial prefix, though on the dial program face,
must be specified, then the Modify Entry button must be selected,
the notebook closed and changes saved.
If you do not save your password in the entry field in the SLIPPM.EXE application, then
you must code the password either in the script itself, or in a response file.
(Or use pppdial.cmd without SLIPPM.EXE)
Unfortunately, when SLIPPM.EXE prompts for the password, it doesn't put it
anywhere readily available to pppdial.cmd :-(
When you specify any *.cmd file in the login sequence field IBM chose to
disable some of the fields on the modem info page and even erase some of
the info from the ini file pppdial reads to get information.
So, if you need a modem init string of something other than ATH0Z then you need to use the
[PPPDIAL_INIT1] and/or [PPPDIAL_INIT2] commands
in the response file.
Other Miscellaneous Stuff
My experience with issuing OS/2 commands once logged on is that ppp.exe is very
sensitive to timing.
On several occassions I got DCD LOST type errors and had to
manually start the redial process again.
I solved this by issuing only one OS/2 START command at the end of the script.
The cmd file I start then begins with a 3 seconds "sleep" (call syssleep 3) which gives
ppp.exe enough time to get stable (get the IP addresses).
The "intermediate" file then issues the start commands I want for starting mail, web,
news reader etc...
If you have a modem init string different from ATH0Z and don't want to use a
response file to define [PPPDIAL_INIT1]
then you may put it in the prefix in the dialer (page 4).
For example if you want to turn off the speaker...
ATM0DT is a good prefix :-)
If you want to be sure that you are always connecting at the highest speed, your
modem may support a command to enforce that. (My USR Courier supports an &N
command that says what speed to connect at - do not negotiate down! (Or UP) )
By putting the &N (or your modem command) in the prefix like AT&N8DT then
if the connection WOULD be slow, the modem does not connect and pppdial will
dial again, with the idea that line conditions will be better next time.
This command can not be used to set a MINIMUM connect rate. (at least not
with my modem. If I use &N6 to set the speed to 9600 then even if a 14.4 WOULD
have been OK... the modem says "No, only 9600". Check your modem manual for
similar commands... there MAY be one that says "minimum connect speed"... and
hey! if not, why not write some e-mail to your modem manufacturer and ask for
such a feature... If enough people ask... :-)