SMSServer - HTTPServer Interface

Introduction

This interface enables SMSServer to act as a mini web server, accepting HTTP requests as remote commands. SMSServer uses the Jetty web server as its embedded server.

The following operations are currently supported:

The HTTPServer interface implements a REST-like calling scheme, where each supported call gets a number of parameters and response with an XML document. The functionality of each call is described below.

Installation

Starting from v3.4, the HTTPServer Interface class file has been pulled out of the main source directory. In order to install and use it, please do the following:

Functionality

SMSServer Status

Displays the status of the SMSServer application. This method returns an HTML document and is meant to be called from a web browser.

To see the status, point your browser to: http://smsserver-ip:port, where

For example: http://192.168.10.15:8080

You will get a simple web page where you can see:

Send a message

You can request SMSServer to send a specific message. The message details are given using parameters to the base URL. The minimum parameters are recipient and text.

URL: http://smsserver-ip/send

Parameters

OptionDescription
passwordThe SEND password, as defined in the relevant section of the configuration file.
recipientThe recipient's number.
textThe message text.
encodingRequests a specific encoding. Allowed values are:
  • 7 for 7bit encoding (the default)
  • 8 for 8bit encoding
  • U for Unicode (UCS2) encoding.
priorityThe priority of the message.
fromThe originator string of the message.
gatewayRequests the dispatch of the message from a specific gateway. If the parameter is missing, SMSServer decides which gateway to use.

Examples:

http://smsserver/send?password=1111&recipient=3012341234&text=Hello World!
http://smsserver/send?password=1111&recipient=3012341234&text=Hello World!&gateway=mySpecificGateway
http://smsserver/send?password=1111&recipient=3012341234&text=Hello World!&priority=-100

Read messages

You can request SMSServer to read and return to you the messages received from its gateways. What you do is that you call a specific URL and you get an XML document with all messages read. By default (i.e. if no parameters are given) SMSServer will read messages from all the gateways. You can customize the message query by using one or more of the supported parameters.

URL: http://smsserver-ip/read

Parameters

OptionDescription
passwordThe READ password, as defined in the relevant section of the configuration file.
gatewayIf given, SMSServer will try to read messages from the gateway with the specific gateway id. Otherwise, it will read all gateways.

Returns an XML structure like the following, which contains all messages read:

<?xml version='1.0' encoding='UTF-8'?>
<messages>
	<message>
	<message_type>Inbound</message_type>
	<message_date>2008-09-15T20:23:05+03:00</message_date>
	<originator>306974xxxx</originator>
	<text>Test</text>
	<encoding>ENC7BIT</encoding>
	<gateway>modem1</gateway>
	</message>
	...
</messages>

Examples:

http://smsserver/read?password=0000
http://smsserver/read?password=0000&gateway=myModem

Configuration File

This interface requires the following configuration settings:

OptionDescription
portThe TCP port to which the interface listens to. Default is 8080.
password.readThe password required to perform a remote READ operation.
password.writeThe password required to perform a remote SEND operation.

Example:

interface.0=httpServer, HttpServer
httpServer.port=8080
httpServer.password.read=0000
httpServer.password.send=1111