With this interface, SMSServer can be instructed to call a specific URL with arguments once a message is sent or received (contributed by Ernas M. Jamil).
Starting from v3.4, the HTTP Interface class file has been pulled out of the main source directory. In order to install and use it, please do the following:
Http.java
(found in the /misc/SMSServer/Interfaces/Stable/
directory) to the /src/java/org/smslib/smsserver/interfaces/
directory.This interface requires the following configuration settings:
Option | Description |
get_url | The URL called when a message is received. |
dlr_url | The URL called when a message is sent. |
method | The HTTP method used to transfer the parameters. Use either POST or GET (the default). |
encoding | The encoding of the parameters. ISO-8859-1 is the default. |
Example:
interface.0=http1, Http
http1.get_url=http://192.168.1.1/test.php?gatewayId=%gatewayId%&text=%text%&originator=%originator%
http1.dlr_url=http://192.168.1.1/dlr.php?gatewayId=%gatewayId%&text=%text%&from=%from%&refNo=%refNo%
Each HTTP call takes some (or all) of the interface's predefined arguments. Different arguments are available for inbound and outbound messages.
The URL arguments will be replaced with the real message values, according to the following table:
Argument | Description |
%gatewayId% | Replaced by the ID of the gateway which the message was received from |
%encoding% | Replaced by the encoding of the inbound message |
%date% | Replaced by the date when the originator has sent the message |
%text% | Replaced by the message text itself |
%pduUserData% | Replaced by the raw PDU data block of the message |
%originator% | Replaced by the originator of the inbound message |
%memIndex% | Replaced by GSM Modem/Phone memory index from which the message was read |
%mpMemIndex% | Replaced by GSM Modem/Phone memory index for multipart messages |
The URL arguments will be replaced with the real message values, according to the following table:
Argument | Description |
%gatewayId% | Replaced by the ID of the gateway which the message was sent from |
%encoding% | Replaced by the encoding of the inbound message |
%date% | Replaced by the date when the message was sent |
%text% | Replaced by the message text itself |
%refNo% | Replaced by the RefNo of the message |
%recipient% | Replaced with the recipient of the message |
%from% | The "from" indication (if any) |
%failureCause% | Replaced by the failure cause in case the message was not sent |
%messageStatus% | Replaced by the message status |