Versions Compared

Key

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

The SMPP inbound endpoint allows you to consume messages from SMSC via WSO2 ESB.

...

  1. Go to https://store.wso2.com/store/assets/esbconnector/details/1f5ca0e2-3fe0-42e5-ae9b-05af1f8e361b and click Download Streaming Connector to download org.apache.synapse.smpp.listen.class-1.0.1.jar and copy inside <ESB_HOME>/repository/components/dropins directory. Please delete old smpp jar, if you have already added.
  2. Download  jsmpp-2.1.0-RELEASE.jar from http://central.maven.org/maven2/com/googlecode/jsmpp/jsmpp/2.1.0-RELEASE/ and copy inside <ESB_HOME>/repository/components/lib directory.
  3. Download asyncretry-jdk7-0.0.6.jar from https://mvnrepository.com/artifact/com.nurkiewicz.asyncretry/asyncretry-jdk7/0.0.6 and copy inside <ESB_HOME>/repository/components/lib directory.

...

Code Block
languagexml
titleInbound Configuration
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
                 name="SMPP"
                 sequence="request"
                 onError="fault"
                 class="org.wso2.carbon.inbound.smpp.SMPPListeningConsumer"
                 suspend="false">
   <parameters>
      <parameter name="inbound.behavior">eventBased</parameter>
      <parameter name="sequential">true</parameter>
      <parameter name="coordination">true</parameter>
      <parameter name="port">2775</parameter>
      <parameter name="addressNpi">UNKNOWN</parameter>
      <parameter name="host">localhost</parameter>
      <parameter name="reconnectInterval">3000</parameter>
      <parameter name="addressTon">UNKNOWN</parameter>
      <parameter name="systemType">CPT</parameter>
      <parameter name="retryCount">-1</parameter>
      <parameter name="bindType">BIND_RX</parameter>
      <parameter name="addressRange">null</parameter>
      <parameter name="systemId">esb1</parameter>
      <parameter name="password">esb123</parameter>
      <parameter name="exponentialFactor">5</parameter>
      <parameter name="maximumBackoffTime">10000</parameter>
   </parameters>
</inboundEndpoint>

   We can get the message properties such as MessageId, SourceAddress, DestiationAddress, DataCoding, DestinationAddressNPI, DestinationAddressTON, ESMClass, PriorityFlag, ProtocolId, RegisteredDelivery, ReplaceIfPresentFlag, ReplaceIfPresentFlag, ScheduleDeliveryTime, SequenceNumber, ServiceType, SourceAddressNPI, SourceAddressTON, ValidityPeriod from the sequence as below.

Code Block
languagexml
titleSequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="request" onError="fault">
   <log level="custom">
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="MessageId"
                expression="get-property('SMPP_MessageId')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="SourceAddress"
                expression="get-property('SMPP_SourceAddress')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="DataCoding"
                expression="get-property('SMPP_DataCoding')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="ScheduleDeliveryTime"
                expression="get-property('SMPP_ScheduleDeliveryTime')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="SequenceNumber"
                expression="get-property('SMPP_SequenceNumber')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="ServiceType"
                expression="get-property('SMPP_ServiceType')"/>
   </log>
   <log level="full"/>
</sequence>

...