2004 © Manison Softworks. All rights reserved.
This software is free for non-commercial use. This software is provided "as-is", without any expressed or implied warranty. In no event shall the author be held liable for any damages arising from the use of this software. Software must be redistributed in the original package only. Internet, CD-ROM and any other media redistribution is allowed only with the permission of the author. Content of the original package must not be changed (e.g. modify, add or remove files). Program cannot be disassembled and no changes must be done in binary and any other files of the program without the permission of the author. User can install software in any number of computers as long as he or she will use the original software package.
SMS server processes short messages received through mobile phone terminal. It can also send short message in response on some external event. SMS server is highly adaptable because it makes use of the Microsoft® JScript. You can use SMS server in home automation or security, measure applications and similar.
Configure the modem (see paragraph Configuration later in this document). Then write a script in the editor or open existing script (see example scripts for inspiration) and run the server (menu Tools-Start Server or simply hit the red arrow button on the toolbar). If the both SMS server and the modem are properly configured you will get the 'Found modem xxx' and then 'Server running' message in the log. Also the status bar text changes to 'Running'.
Also see Command Line Parameters for advanced options.
Connect GSM mobile phone or GSM terminal to the computer using standard serial port. The modem must support Phase 2+ according to GSM 07.05 specification. You can check this by running the server. If the modem is not Phase 2+ compliant you will get the 'Bad modem answer message' in the log window and the server will not run. Setup properly the communication port and the bitrate in the modem configuration dialog (menu Tools-Options...).
SMS server makes use of the Microsoft® JScript. For more information about
JScript see the documentation on
http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriJScript.asp.
SMS server exposes one global object named SmsServer
. The object
features following methods and events.
SendShortMessage(destination, message)
Sends short message to the phone number destination
with text
message
. Phone number should be in international format. Returns
true if the message was sent or false if an error occured.
Example:
SendShortMessage("420604123456", "Hello.");
StopServer()
Puts the server in stopped state. This method has no return value.
Log(message)
Writes message
to the log. This must be enabled in the
configuration dialog. This method has no return value.
MessageBox(message, flags)
Displays dialog box with message
, flags
are
combination of following values:
mbOk, mbOkCancel, mbYesNo, mbYesNoCancel, mbAbortRetryIgnore, mbRetryCancel
Specifies the button used on the dialog.
mbError, mbWarning, mbInformation, mbQuestion
Specifies the icon displayed in the dialog.
Return value depends on the button that user pressed. It is one of following value:
mrOk, mrCancel, mrYes, mrNo, mrAbort, mrRetry, mrIgnore
Example:
if (MessageBox("Press a button.", mbYesNo|mbInformation) == mrYes) { // the YES button was pressed } else { // the NO button was pressed }
OnServerStart()
Invoked after the server is successfuly started.
OnServerStop()
Invoked when the server is going to be stopped.
OnIncomingMessage(from, message)
Invoked when a new short message is received from
specified
originating phone number. Message text is specified by the message
parameter.
-start
Starts the server.
-stop
Stops the server.
-f script_filename
Loads the script script_filename.
-quit
Stops the server and exits the application.
-nolog
Creates no file log. Cannot be combined with '-log'
parameter.
-log log_filename
Outputs the log to the log_filename. Cannot be combined with
'-nolog'
switch.
-minimize
Runs the application minimized.
-silent
Supress some dialogs.