SMS output event adapter is used to send message notifications via Short Message Peer-to-Peer Protocol (SMPP). It uses Axis2 SMS events when sending SMSs from WSO2 products. SMPP allows Axis2 to connect to a Short Messaging Service Center (SMSC) and send/receive SMSs. SMS event adapter can be configured with XML, text, and JSON output mappings.
Table of Contents maxLevel 3
Prerequisites
Before the configuration starts, follow the steps below to configure the SMS sender.
...
Follow the steps below to complete the prerequisites before starting the input adapter configurations.
Add the following configuration under transport senders section in the
<CEP_HOME>/repository/conf/axis2/axis2_client.xml
file file, to enable SMS Transport.Code Block <axisconfigname="AxisJava2.0"> ... <transportSenderclass="org.apache.axis2.transport.sms.SMSSender"name="sms"> <parametername="systemType"></parameter> <parametername="systemId">cep1</parameter> <parametername="password">cep123</parameter> <parametername="host">localhost</parameter> <parametername="port">2775</parameter> <parametername="phoneNumber">CEP1</parameter> </transportSender> ... </axisconfig>
Copy the following libraries to
<PRODUCT<CEP_HOME>/repository/components/lib/
directory.
Configuring output SMS event adapter
SMS output adapter requires following adapter configurations;
...
...
...
...
...
Phone No
...
Creating a SMS output event adapter
For instructions on creating a SMS output event adapter, see Publishing Events.
Configuring adapter properties
Specify the Dynamic Adapter Properties, when creating a SMS output event adapter using the management console as shown below.
Info |
---|
After entering the above adapter properties, select the Message Format which you want to apply on the published events. Also, click Advanced to define custom output mappings based on the Message Format you selected. For more information on custom output mapping types, see Publishing Events in Various Event Formats. |
You can also define the respective adapter properties of the event publisher based on the transport type within the <to>
element of the event publisher configuration in the <CEP_HOME>/repository/deployment/server/eventpublishers/
directory as follows.
Code Block | ||
---|---|---|
| ||
<eventPublisher name="SMSOutputEventAdapter" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
.........
<to eventAdapterType="sms">
<property name="sms.no">0716453453</property>
</to>
</eventPublisher> |
The above adapter properties are described below.
Adapter Property | Description | Configuration file property | Example |
---|---|---|---|
Phone No | Phone number of the SMS receiver .egin the following format: [country-code][number] | sms.no | 0716453453 |
Other post configurations that use SMS event adapter
Follow the instructions below to set up and configure a SMSC Simulator to to receive messages. This guide uses Logica SMSC simulator.
- Navigate to SMSC Simulator directory. The folder must contain following 3 filescontain following three files.
smpp.jar
smscsim.jar
users.txt
Add the following name-value pairs to
users.txt
file.Info Enter the value of the systemId
parameter defined in the above SMS transport sender configuration as the value of the name
parameter in the below list.Code Block name=cep1 password=cep123 timeout=unlimited
- Start SMSC Simulator by executing the following command:
java -cp smpp.jar:smscsim.jar com.logica.smscsim.Simulator
- In the console where the command runs:
- Enter 1 for the prompt to start simulation.
Enter 2775 as the port number (this port is equal to the port defined in the SMS transport sender configuration.)
Starting listener... started
log is displayed on the console, the SMSC simulator is ready to accept messages as shown below.