The ServiceMix SMPP component provides support for receiving and sending SMS using the SMPP protocol via the enterprise service bus. It uses the jSMPP library.
You can use Maven servicemix-smpp-service-unit archetype to create a SMPP service unit:
mvn archetype:create \ -DarchetypeGroupId=org.apache.servicemix.tooling \ -DarchetypeArtifactId=servicemix-smpp-service-unit \ -DarchetypeVersion=2010.01 \ -DgroupId=your.group.id \ -DartifactId=your.artifact.id \ -Dversion=your-version |
Once you've customized the service unit, simply install the SU:
mvn install |
|
Remember that to be deployable in ServiceMix, the ServiceUnit has to be embedded in a Service Assembly: only the Service Assembly zip file can be deployed in ServiceMix.
|
A SMPP Consumer endpoint connects to a SMPP server, waiting for incoming SMS message. When a SMS message comes, the endpoint converts it into a JBI message (using the marshaler) and send to the NMR.
Currently, the SMPP Consumer endpoint only supports the DELIVERY_SM protocol data unit, which will acknowledge positive even if the exchange fails.
<smpp:consumer service="test:service"
endpoint="endpoint"
host="smpp.example.com"
port="2700"
systemId="user"
password="passwd"/>
|
|
A SMPP Provider endpoint expects messages coming from the NMR, converts it into a SMS message (using the marshaler) and send to the SMPP server.
Currently, the SMPP Provider endpoint only supports the SUBMIT_SM protocol data unit. Positive or negative acknowledgements received from the SMSC will set the Exchange status to DONE or ERROR. For InOut Exchanges the OUT NormalizedMessage is a copy of IN message.
<smpp:provider service="test:service"
endpoint="endpoint"
host="smpp.example.com"
port="2700"
systemId="user"
password="passwd"/>
|
|
By default, SMPP endpoints expect (and generate) the content of the message in XML format. The XML message looks like:
<message> <source>SOURCE_PHONE_NUMBER</source> <destination>DESTINATION_PHONE_NUMBER</destination> <text>MESSAGE_CONTENT</text> <npi>NATIONAL_PREFIX_INDICATOR</npi> <ton>TYPE_OF_NUMBER</ton> </message> |
If you want to manipulate different format, you need to define your own marshaler.
<?xml version="1.0"?>
<beans xmlns:smpp="http://servicemix.apache.org/smpp/1.0"
xmlns:test="http://test">
<smpp:consumer service="test:smpp"
endpoint="endpoint"
host="smpp.example.com"
port="2700"
systemId="test"
password="test">
<property name="marshaler">
<bean class="org.apache.servicemix.smpp.marshaler.OtherSmppMarshaler"/>
</property>
</smpp:consumer>
</beans>
|
SMPP provides a set of Optional parameters that can be set on the supported protocol data units. The default SMPP marshaler will treat the optional parameters as Normalized message properties (will copy matching properties from the NormalizedMessage to the PDU and vice versa). Below is a small matrix the presentes the supported optional parameters and how they are mapped to NomralizedMessage properties.
|
Note: DATA_SM, QUERY_SM and and response PDUs are not currently supported.