Versions Compared

Key

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

Output SMS 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
maxLevel3

Excerpt
hiddentrue

NOTE TO WRITERS: Add the TOC here.

Table of Contents
maxLevel3

Configuring SMS sender

Before the configuration starts, follow the steps below to configure the SMS sender.

  1. Edit systemId, passwordand other relevant properties of SMS sender configuration in <PRODUCT_HOME>/repository/conf/axis2/axis2_client.xml file. For example,

    Code Block
    languagehtml/xml
    <axisconfig name="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>
  2.  Copy following libraries to <PRODUCT_HOME>/repository/components/lib/ directory.

Configuring output SMS event adapter

Anchor
Using the management console
Using the management console
Configure using the management console

Follow the instructions below to configure output SMS event adapter using the management console. This deploys the event adapter in the <PRODUCT_HOME>/

...

  1. Log in to product's management console, and click Configure.
  2. Click Output Event Adaptors in the Event Processor Configs menu, and then click Add Output Event Adaptor.
  3. Enter outputSMSAdaptor for Event Adaptor Name, and select sms for Event Adaptor Type as shown below. 

    create output SMS event adapter

  4. Click Add Event Adaptor.

Anchor
Using a configuration file
Using a configuration file
Configure using a configuration file

Follow the instructions below to configure output SMS event adapter using a configuration file.

...

Info

After an adapter is successfully added, it gets added to the list of adapters displayed under Event Processor Configs in the Configure menu of the product's management console. Click Edit to change its configuration and redeploy it. This opens an XML-based editor allowing you to edit the event adapter configurations from the UI.  Do your modifications and click Update. You can also delete it, enable/disable statistics or enable/disable tracing on it using the provided options in the UI.

Other post configurations that use SMS event adapter

Follow the instructions below to set up and configure SMCC server to receive messages. This example uses Logica SMSC simulator.

  1. Navigate to SMSC Simulator directory, and add the following name-value pairs to users.txt file. (The folder must also contain smpp.jar and smscsim.jar files.)

    Code Block
    name=cep1 (Note that name is the systemId parameter defined in the SMS transport sender configuration)
    password=cep123
    timeout=unlimited
  2. Start SMSC Simulator by executing the following command:
    java -cp smpp.jar:smscsim.jar com.logica.smscsim.Simulator
  3. 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.

Configuring output SMS event adapter message properties

The configured output event adapters are used in event formatters. With output event adapter message properties, event formatters are able to extract data from event streams and format the output events. Following are the output SMS event adapter-specific message properties.
output SMS event adapter message propertiesImage Removed
The message properties of the output SMS . Message properties specific to output event adapters of the sms type can be configured as follows. 
  1. Log into the BAM Management Console. For detailed instructions, see Running the Product.
  2. In the Main tab, click Event Streams to open the AvailableEvent Streams page.
  3. Click the Outflows link of the event stream to which the relevant output event adapter is connected. As a result, Event Out-Flows (<Output_Event_Adapter_Name>) opens.
  4. Click on the relevant event builder name to open the Event Formatter Details page.
    output SMS event adapter message propertiesImage AddedThe message properties of an sms output event adapter are described below. Change the property values as required.

    PropertyDescription
    Phone NoPhone number of the SMS receiver.
    Output Event Type The outgoing event type to be mapped. The output SMS event adapter supports text, XML, and JSON mappings.