[ Main Index | IPSentry Help Index ]
 

From the SMS Pager Configuration select New or Edit script.

Cell/Pager/SMS Mobile Device Scripting

IPSentry SMS Notification / Scripted

(The sample above is the script used to send SMS message with Nokia SMS phone attached to COM port.)

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 example, you provider may not have any terminal dialup yet you may have a device connected to your system that is capable of sending SMS messages direct.  Or, you mobile provider may offer a menu driven interface for modem dialup (e.g. Telenote, Orange, etc..)

Obviously, these types of paging systems can vary ever 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 as well as script out the more technical AT command required to send SMS messages direct through SMS capable devices such as a Nokia phone with a PC COM adapter.  (Inquire with your mobile provider regarding SMS capable devices and compatibility with PC's).

In order to make use of scripts, you must select "Text via SMS/TAP" as the delivery  type. This let's IPSentry know that it will be required to utilize a communication device with data capabilities. The differences between TAPI and Direct to Com still apply however there are some additional script considerations to compensate for the difference.  * If using a SMS capable device attached to your COM port - you must use Direct to COM.

You can use the COPY FROM button to copy the contents of an existing script into your new script for editing.
Simply select the script you wish to copy and modify accordingly.

SMS Notification - Copy Script Dialogue

Let's get started on an example since that is the only way to explain how this works.

The Manual Process
Let's assume that you dial a service with your terminal program (HyperTerminal) using  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.)
 

(Bold represents the data that was received, norm is what you entered.)

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.

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.

Now, we setup the script using proper syntax:

#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/receive 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 (in 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 Script Variables

The Syntax

The Script Files
 


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"

Sends the contents of "data" to the modem for transmission.

WAITFOR
Syntax: WAITFOR n "data"

Waits for (n) seconds to receive the contents of "data"

WAITQUIET
Syntax WAITQUIET n

Waits for (n) seconds of no incoming data from the modem.

WAITCONNECT
Syntax: WAITCONNECT n

Waits for (n) seconds for the CD signal (carrier detect)

NOFAIL
Syntax: NOFAIL

Turns of error checking such that any command following this command that fails will report as successful and the script will continue without error. This should only be used during termination where failures will not impede the delivery of the message.

QUIT
Syntax: QUIT

Terminates the connection, hangs up the modem.

TAPION
Syntax: TAPION

Signifies that this script will use the TAPI configurations supplied and will make use of special TAPI commands for dialing and connecting.

TAPICDTIMEOUT
Syntax: TAPICDTIMEOUT n

Sets the connection timeout limit to (n) seconds.

TAPIDIAL
Syntax: TAPIDIAL "data"

Requests the TAPI driver to initialize the mode, dial the number in "data" and wait for a connection. If a connection is not established within TAPICDTIMEOUT seconds, a failure will be generated and the script will terminate.

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 Key Words 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 Key Words are replaced prior to replacement and masking.


<STX>
(TAP Protocol Specific)
This key is replaced by ASCII Character 2.


<ETX>
(TAP Protocol Specific)
This key is replaced by ASCII Character 3.


<EOT>
(TAP Protocol Specific)
This key is replaced by ASCII Character 4.


<ACK>
(TAP Protocol Specific)
This key is replaced by ASCII Character 6.


<NAK>
(TAP Protocol Specific)
This key is replaced by ASCII Character 21.


<RS>
(TAP Protocol Specific)
This key is replaced by ASCII Character 30.


<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).
e.g.: \013 is the same as <CR> or ^M

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 (e.g.: "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 (e.g.: 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.

 



     If you require additional assistance, please visit our on-line support forum at http://forum.ipsentry.com.
 
©1997-2012 by RGE, Inc. - All Rights Reserved
IPSentry® is a registered trademark of RGE, Inc.

 
Support Forums: http://forum.ipsentry.com
Web Site: https://ipsentry.com
Support Email: support@ipsentry.com