IPSentry - Alert - Pager - Script Configuration
While IPSentry does support a vast majority of pager options through TAP, DTMF and SMTP, there are cases in which your paging service does not handle any of the above.
For reference, we will concentrate on the Telenote paging service which uses a terminal dialup with manual entry.
Obviously, these types of paging systems can vary every so slightly making a standard script completely useless. The ability to modify the functionality of the SEND/RECV dialogue gives you the flexibility to create an automated paging solution using a manual paging service.
In order to make use of scripts, you must select "ALPHA (TAP/SMS)" as the paging type. This let's IPSentry know that it will be required to dial and connect to a modem. The differences between TAPI and Direct to Com still apply however there are some additional script considerations for the difference.
Let's get started on an example since that is
the only way to explain how this works.
(Assuming you have read the Alpha (TAP/SMS) Configuration section.)
The Manual Process
Let's assume that you dial a service with your terminal program (Hyperterminal)
and the instructions you gathered from your service provider are as follows:
Terminal Number: 55-1212-1212
Pager ID: 0743333
Speed: 1200 bps
Settings: N-8-1
Once connected, follow the prompts... (uh , ok.)
The first part is easy, simply enter the
Terminal Number in the "Dial Number" field and set the appropriate
communication settings through the "Modem/Port Settings" tab just as
if we were using a simple TAP dialup terminal.
What the terminal sends us will be in black, and what you
might type will be in maroon.
ENTER PAGER ID (LEAVE BLANK TO QUIT): 0743333
ENTER MESSAGE AND PRESS (RETURN): Machine ABCDEFG is Down<CR><CR>
THANK YOU MESSAGE ACCEPTED
NO CARRIER
As you can see, the above session shows that a large amount of variation can be used by various services in the prompting, order of prompting and even the information that might be requested. Some terminals may ask for different items, some may ask for a password, the sequence of asking for the Pager ID and Password may vary, etc..
Now that we know what to expect and what to send in response to the systems requests, we can outline a basic "PSEUDO" script using the standard WAITFOR and SEND commands that will give us an interim script solution using basic language and thought.
Wait for "QUIT"
Send the PAGERID and press ENTER
Wait for "RETURN"
Send the message text and press ENTER
Wait for "ACCEPTED"
Finished
The next step is simply converting our logical pseudo script to a syntactically correct IPSentry script and setting up the connection and the timing. All we want to do is dial the terminal, connect, and begin the process above. Once we receive "ACCEPTED", we are done.
#Initialize the modem
SEND "<MODEMINIT><CR>"
#Wait until initialized.
WAITQUIET 5
#Dial the terminal
SEND "<DIALSTRING><DIALNUMBER><CR>"
#Wait for a connect (CD HIGH)
WAITCONNECT <CONNECTTIMEOUT>
#Now, let's give the system 5 seconds for the first prompt.
WAITFOR 5 "QUIT"
#Make sure the terminal is finished sending data.
WAITQUIET 2
#Send our pager ID
SEND "<PAGERID><cr>"
#Give the terminal 5 seconds to return the next prompt.
WAITFOR 5 "RETURN"
#Make sure the terminal is finished sending data.
WAITQUIET 2
#Send our message text. (Masked to remove carriage returns and line feeds)
SEND "<MASKTEXT><CR>"
#Give the terminal 5 seconds to process the message.
WAITFOR 5 "ACCEPTED"
#Finished successfully, let's just clean up but ignore
#any errors that might be generated from this point on.
NOFAIL
SEND "<cr>"
SEND "<cr>"
WAIT 2 "GOODBYE"
#Terminate the script.
QUIT
While the above script may seem long, let's remove all the comments to really show how little this actually does.
SEND "<MODEMINIT><CR>"
WAITQUIET 5
SEND "<DIALSTRING><DIALNUMBER><CR>"
WAITCONNECT <CONNECTTIMEOUT>
WAITFOR 5 "QUIT"
WAITQUIET 2
SEND "<PAGERID><cr>"
WAITFOR 5 "RETURN"
WAITQUIET 2
SEND "<MASKTEXT><CR>"
WAITFOR 5 "ACCEPTED"
NOFAIL
SEND "<cr>"
SEND "<cr>"
WAIT 2 "GOODBYE"
QUIT
That's it!
As I stated earlier, there are some minor considerations for using TAPI
compliant modem access instead of direct to com access. The above script
will work with direct to com but will fail completely when using TAPI. This
is due to the fact that access to the modem is not available in the same manner
as above (opening the port and send/recv data immediately).
Instead, TAPI must make specific calls using the windows TAPI to initialize the port
appropriately.
In order to make the above script work with TAPI, we need only convert the dial
and connection sequence to tell the scripting engine to use TAPI.
The following commands are introduced: TAPION, TAPICDTIMEOUT, and TAPIDIAL.
So, in using TAPI, you will convert the first 4 lines (int the script above) to 3 TAPI lines as
follows:
TAPION
TAPICDTIMEOUT <CONNECTTIMEOUT>
TAPIDIAL "<DIALNUMBER>"
Notice that we are not directly communicating with the port at this point. Instead, we are simply setting up TAPI and telling it to dial a number. Any modem initialization commands should be set using control panel modems applet.
The first line tells the IPSentry script engine that we will be using TAPI at which point it grabs the configuration information as set under the Modem/Port Settings tab.
The second line sets the connect timeout to the value specified.
The third line actually initializes the modem, dials the terminal number, and waits for a connection.
The remainder of the script would be identical since the only difference we need to consider is port initialization.
I highly recommend using direct to com for trying script files. Once you successfully create the script, then save the file with a TAPI. prefix and change the connection commands as above. Believe me, this will make life MUCH easier.
Now that we have gone through the creation of a script without you knowing what in the world the commands are, you are ready.
There are four important parts to know about an IPSentry paging script.
The Commands
The IPSentry paging script uses a very limited yet robust scripting language in
order to allow paging functionality through a wide variety of text paging
terminals with minimal effort. The commands available which will
ultimately make up the script are as follows:
SEND |
Syntax: SEND
"data" |
WAITFOR |
Syntax: WAITFOR
n "data" |
WAITQUIET |
Syntax WAITQUIET
n |
WAITCONNECT |
Syntax:
WAITCONNECT n |
NOFAIL |
Syntax: NOFAIL |
QUIT |
Syntax: QUIT |
TAPION |
Syntax:
TAPION |
TAPICDTIMEOUT |
Syntax: TAPICDTIMEOUT
n |
TAPIDIAL |
Syntax: TAPIDIAL
"data" |
The Script Variables
A pre-defined set of keywords or script variables have been defined in order to
allow scripts that are created for use with many different pagers, paging
functionality through a wide variety of text paging terminals with minimal
effort.
These key script variables are replaced with various settings from the pager
configuration entry.
The commands available which will ultimately make up the script are as follows:
<MODEMINIT> |
This key is
replaced by the "Modem Init" field value and is normally used
only when the "Direct to Com" setting is enabled. |
<DIALSTRING> |
This key is
replaced by the "Dial String" field value and is normally used
only when the "Direct to Com" setting is enabled. |
<DIALNUMBER> |
This key is
replaced by the "Dial Number" field value. When "Use
TAPI Device" is selected, this setting is modified to comply with
international phone number format. |
<PAGERID> |
This key is
replaced by the "Pager ID" field value. |
<PASSWORD> |
This key is
replaced by the "Password" field value. |
<MESSAGETEXT> |
This key is
replaced by the "Alpha Text Message" field value. IPSentry
KeyWords are replaced prior to replacement. |
<MASKTEXT> |
This key is
replaced by the "Alpha Text Message" field value and converted
to a masked text value for TAP terminals (i.e. low/high ascii value
characters are masked based on the TAP bit requirements). IPSentry
KeyWords are replaced prior to replacement and masking. |
<STX> |
(TAP Protocol
Specific) |
<ETX> |
(TAP Protocol
Specific) |
<EOT> |
(TAP Protocol
Specific) |
<ACK> |
(TAP Protocol
Specific) |
<NAK> |
(TAP Protocol
Specific) |
<RS> |
(TAP Protocol
Specific) |
<CR>, ^M |
This key is
replaced by ASCII Character 13. |
<ESC> |
This key is
replaced by ASCII Character 27. |
<LF> |
This key is
replaced by ASCII Character 10. |
<TAB> |
This key is
replaced by ASCII Character 9. |
<QUOTE> |
This key is
replaced by ASCII Character 34. |
<\nnn> |
Replaced by the
ASCII character (nnn). |
The Syntax
Each command has a specific syntax as outlined above in the command
section.
The scripting engine contains no syntax checking and thus causes of script
failure may be difficult to diagnose in some cases.
The most common cause for script failures (non logic failures) is improper
syntax of the SEND and WAITFOR commands. More specifically, failure to
enclose the data portion within quotes, or leaving the data open-quoted (eg:
"no end quote ).
Another common failure is neglecting to insert a value in the "WAITFOR"
command which specifies how many seconds the script should wait to receive the
value (eg: WAITFOR "this")
Other than the two problems noted above, we believe the scripting engine is
designed to be simple and logical requiring no formal programming experience.
The script files provided in the IPSentry distribution can be used as templates
and examples for additional help in creating a script for your own specific use.
The Script Files
All pager scripts must reside in the PGSCRIPT folder under the directory in
which IPSentry is installed.
All scripts must have the file extension of ".SCR".
This is the folder in which IPSentry will look for all available scripts that will be listed in the drop-down box on the pager configuration screen.
The first line of each script file will be considered the description or "title" of the script and should be somewhat descriptive.
IPSentry does provide a simple script editor although this is not required and you could use something like Notepad just as well to edit the script files.
Any line in a script file that begins with a pound sign (#) will be considered a comment line and will be ignored by the script processor.
SCRIPT EDITOR
NOTE: When editing scripts with text editor such as notepad, the TITLE must
be the first line
|
||
Contact: support@ipsentry.com | https://ipsentry.com | © 2006 by RGE, Inc. - All Rights Reserved |