Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SMS event publisher 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 publisher can be configured with XML, text, and JSON output mappings.

...

  1. Add the following configuration under transport senders section in the <PRODUCT_HOME>/repository/conf/axis2/axis2_client.xml file, to enable SMS Transport .

    Code Block
    <axisconfigname="AxisJava2.0">
       ... 
       <transportSender class="org.apache.axis2.transport.sms.SMSSender" name="sms">
            <parameter name="systemType"></parameter>
            <parameter name="systemId">cep1</parameter>
            <parameter name="password">cep123</parameter>
            <parameter name="host">localhost</parameter>
            <parameter name="port">2775</parameter>
            <parameter name="phoneNumber">CEP1</parameter>
        </transportSender>
        ...
    </axisconfig>

    Copy the following libraries to <PRODUCT_HOME>/repository/components/lib/ directory.

  2. axis2-transport-sms-1.0.0.jar
  3. jsmpp-2.1.0.jar
  4. Configure WSO2 CEP by adding relevant jars to support SMS transport.

Creating a SMS event publisher

For instructions on creating a SMS event publisher, see Publishing Events .  Configuring CEP to Create Alerts.

Configuring adapter properties

...

Adapter Property
Description
Configuration file propertyExample

Phone No

Phone number of the SMS receiver in the following format: [country-code][number]

sms.no

0716453453

Other post configurations that use SMS event publisher

...

  1. Navigate to SMSC Simulator directory. The folder must contain following three files.
    smpp.jar
    smscsim.jar
    users.txt
  2. 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
  3. Start SMSC Simulator by executing the following command:
    java -cp smpp.jar:smscsim.jar com.logica.smscsim.Simulator
  4. 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.)

    When the Starting listener... started log is displayed on the console, the SMSC simulator is ready to accept messages as shown below

Related samples

For more information on sms event publisher type, see the following sample.