SMPP Component
CamelSmppFinalStatusAvailable as of Camel 2.2
This component provides access to an SMSC (Short Message Service Center) over the SMPP protocol to send and receive SMS. The JSMPP library is used for the protocol implementation.
The Camel component currently operates as an ESME (External Short Messaging Entity) and not as an SMSC itself.
The SMS Router project provides an excellent example of an SMS Router daemon based on the Camel framework, routing messages between JMS queues (ActiveMQ) and the SMPP network. Run multiple instances in parallel for high-availability.
Starting with Camel 2.9 you are also able to execute ReplaceSm, QuerySm, SubmitMulti, CancelSm and DataSm.
Maven users will need to add the following dependency to their pom.xml
for this component:
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-smpp</artifactId>
<version>x.x.x</version>
<!-- use the same version | ||||
Wiki Markup | ||||
h2. SMPP Component This component provides access to an SMSC (Short Message Service Center) over the [SMPP|http://smsforum.net/SMPP_v3_4_Issue1_2.zip] protocol to send and receive SMS. The [JSMPP|http://code.google.com/p/jsmpp/] is used. Maven users will need to add the following dependency to their {{pom.xml}} for this component: {code} <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-smpp</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> {code} {info:title=Using Camel 2.2 onwards} This component is only available for Camel 2.2 or newer. {info} h3. URI format {code} smpp://[username@]hostname[:port][?options] smpps://[username@]hostname[:port][?options] {code} If no *username* is provided, then Camel will provide the default value {{smppclient}}. If no *port* number is provided, then Camel will provide the default value {{2775}}. *Camel 2.3:* If the protocol name is "smpps", camel-smpp with try to use SSLSocket to init a connection to the server. You can append query options to the URI in the following format, {{?option=value&option=value&...}} h3. URI Options {div:class=confluenceTableSmall} || Name || Default Value || Description || | {{password}} | {{password}} | Specifies the password to use to log in to the SMSC. | | {{systemType}} | {{cp}} | This parameter is used to categorize the type of ESME (External Short Message Entity) that is binding to the SMSC (max. 13 characters). | | {{dataCoding}} | {{0}} | *Camel 2.5 onwarts* Defines encoding of data according the SMPP 3.4 specification, section 5.2.19. Example data encodings are:\\ {{0}}: SMSC Default Alphabet\\ {{4}}: 8 bit Alphabet\\ {{8}}: UCS2 Alphabet| | {{encoding}} | {{ISO-8859-1}} | Defines the encoding scheme of the short message user data. | | {{enquireLinkTimer}} | {{5000}} | Defines the interval in milliseconds between the confidence checks. The confidence check is used to test the communication path between an ESME and an SMSC. | | {{transactionTimer}} | {{10000}} | Defines the maximum period of inactivity allowed after a transaction, after which an SMPP entity may assume that the session is no longer active. This timer may be active on either communicating SMPP entity (i.e. SMSC or ESME). | | {{initialReconnectDelay}} | {{5000}} | Defines the initial delay in milliseconds after the consumer/producer tries to reconnect to the SMSC, after the connection was lost. | | {{reconnectDelay}} | {{5000}} | Defines the interval in milliseconds between the reconnect attempts, if the connection to the SMSC was lost and the previous was not succeed. | | {{registeredDelivery}} | {{1}} | Is used to request an SMSC delivery receipt and/or SME originated acknowledgements. The following values are defined:\\ {{0}}: No SMSC delivery receipt requested.\\ {{1}}: SMSC delivery receipt requested where final delivery outcome is success or failure.\\ {{2}}: SMSC delivery receipt requested where the final delivery outcome is delivery failure. | | {{serviceType}} | {{CMT}} | The service type parameter can be used to indicate the SMS Application service associated with the message. The following generic service_types are defined:\\ {{CMT}}: Cellular Messaging\\ {{CPT}}: Cellular Paging\\ {{VMN}}: Voice Mail Notification\\ {{VMA}}: Voice Mail Alerting\\ {{WAP}}: Wireless Application Protocol\\ {{USSD}}: Unstructured Supplementary Services Data | | {{sourceAddr}} | {{1616}} | Defines the address of SME (Short Message Entity) which originated this message. | | {{destAddr}} | {{1717}} | Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. | | {{sourceAddrTon}} | {{0}} | Defines the type of number (TON) to be used in the SME originator address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{destAddrTon}} | {{0}} | Defines the type of number (TON) to be used in the SME destination address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{sourceAddrNpi}} | {{0}} | Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{destAddrNpi}} | {{0}} | Defines the numeric plan indicator (NPI) to be used in the SME destination address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{priorityFlag}} | {{1}} | Allows the originating SME to assign a priority level to the short message. Four Priority Levels are supported:\\ {{0}}: Level 0 (lowest) priority\\ {{1}}: Level 1 priority\\ {{2}}: Level 2 priority\\ {{3}}: Level 3 (highest) priority | | {{replaceIfPresentFlag}} | {{0}} | Used to request the SMSC to replace a previously submitted message, that is still pending delivery. The SMSC will replace an existing message provided that the source address, destination address and service type match the same fields in the new message. The following replace if present flag values are defined: \\ {{0}}: Don't replace\\ {{1}}: Replace | | {{typeOfNumber}} | {{0}} | Defines the type of number (TON) to be used in the SME. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{numberingPlanIndicator}} | {{0}} | Defines the numeric plan indicator (NPI) to be used in the SME. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | {div} You can have as many of these options as you like. {code} smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer {code} h3. Message Headers The following message headers can be used to affect the behavior of the SMPP producer || Header || Description || | {{CamelSmppDestAddr}} | Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. | | {{CamelSmppDestAddrTon}} | Defines the type of number (TON) to be used in the SME destination address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{CamelSmppDestAddrNpi}} | Defines the numeric plan indicator (NPI) to be used in the SME destination address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{CamelSmppSourceAddr}} | Defines the address of SME (Short Message Entity) which originated this message. | | {{CamelSmppSourceAddrTon}} | Defines the type of number (TON) to be used in the SME originator address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{CamelSmppSourceAddrNpi}} | Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{CamelSmppServiceType}} | The service type parameter can be used to indicate the SMS Application service associated with the message. The following generic service_types are defined:\\ {{CMT}}: Cellular Messaging\\ {{CPT}}: Cellular Paging\\ {{VMN}}: Voice Mail Notification\\ {{VMA}}: Voice Mail Alerting\\ {{WAP}}: Wireless Application Protocol\\ {{USSD}}: Unstructured Supplementary Services Data | | {{CamelSmppRegisteredDelivery}} | Is used to request an SMSC delivery receipt and/or SME originated acknowledgements. The following values are defined:\\ {{0}}: No SMSC delivery receipt requested.\\ {{1}}: SMSC delivery receipt requested where final delivery outcome is success or failure.\\ {{2}}: SMSC delivery receipt requested where the final delivery outcome is delivery failure. | | {{CamelSmppPriorityFlag}} | Allows the originating SME to assign a priority level to the short message. Four Priority Levels are supported:\\ {{0}}: Level 0 (lowest) priority\\ {{1}}: Level 1 priority\\ {{2}}: Level 2 priority\\ {{3}}: Level 3 (highest) priority | | {{CamelSmppScheduleDeliveryTime}} | This parameter specifies the scheduled time at which the message delivery should be first attempted. It defines either the absolute date and time or relative time from the current SMSC time at which delivery of this message will be attempted by the SMSC. It can be specified in either absolute time format or relative time format. The encoding of a time format is specified in chapter 7.1.1. in the smpp specification v3.4. | | {{CamelSmppValidityPeriod}} | The validity period parameter indicates the SMSC expiration time, after which the message should be discarded if not delivered to the destination. It can be defined in absolute time format or relative time format. The encoding of absolute and relative time format is specified in chapter 7.1.1 in the smpp specification v3.4. | | {{CamelSmppReplaceIfPresentFlag}} | The replace if present flag parameter is used to request the SMSC to replace a previously submitted message, that is still pending delivery. The SMSC will replace an existing message provided that the source address, destination address and service type match the same fields in the new message. The following values are defined: \\ {{0}}: Don't replace\\ {{1}}: Replace | | {{CamelSmppDataCoding}} | The data coding according to the SMPP 3.4 specification, section 5.2.19: \\ {{0}}: SMSC Default Alphabet\\ {{4}}: 8 bit Alphabet\\ {{8}}: UCS2 Alphabet| The following message headers are used by the SMPP producer to set the response from the SMSC in the message header || Header || Description || | {{CamelSmppId}} | the id to identify the submitted short message for later use (delivery receipt, query sm, cancel sm, replace sm). | The following message headers are used by the SMPP consumer to set the request data from the SMSC in the message header || Header || Description || | {{CamelSmppSequenceNumber}} | *only for alert notification, deliver sm and data sm*: A sequence number allows a response PDU to be correlated with a request PDU. The associated SMPP response PDU must preserve this field. | | {{CamelSmppCommandId}} | *only for alert notification, deliver sm and data sm*: The command id field identifies the particular SMPP PDU. For the complete list of defined values see chapter 5.1.2.1 in the smpp specification v3.4. | | {{CamelSmppSourceAddr}} | *only for alert notification, deliver sm and data sm*: Defines the address of SME (Short Message Entity) which originated this message. | | {{CamelSmppSourceAddrNpi}} | *only for alert notification and data sm*: Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{CamelSmppSourceAddrTon}} | *only for alert notification and data sm*: Defines the type of number (TON) to be used in the SME originator address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{CamelSmppEsmeAddr}} | *only for alert notification*: Defines the destination ESME address. For mobile terminated messages, this is the directory number of the recipient MS. | | {{CamelSmppEsmeAddrNpi}} | *only for alert notification*: Defines the numeric plan indicator (NPI) to be used in the ESME originator address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{CamelSmppEsmeAddrTon}} | *only for alert notification*: Defines the type of number (TON) to be used in the ESME originator address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | | {{CamelSmppId}} | *only for smsc delivery receipt and data sm*: The message ID allocated to the message by the SMSC when originally submitted. | | {{CamelSmppDelivered}} | *only for smsc delivery receipt*: Number of short messages delivered. This is only relevant where the original message was submitted to a distribution list.The value is padded with leading zeros if necessary. | | {{CamelSmppDoneDate}} | *only for smsc delivery receipt*: The time and date at which the short message reached it's final state. The format is as follows: YYMMDDhhmm. | | {{CamelSmppStatus}} | *only for smsc delivery receipt and data sm*: The final status of the message. The following values are defined:\\ {{DELIVRD}}: Message is delivered to destination\\ {{EXPIRED}}: Message validity period has expired.\\ {{DELETED}}: Message has been deleted.\\ {{UNDELIV}}: Message is undeliverable\\ {{ACCEPTD}}: Message is in accepted state (i.e. has been manually read on behalf of the subscriber by customer service)\\ {{UNKNOWN}}: Message is in invalid state\\ {{REJECTD}}: Message is in a rejected state | | {{CamelSmppError}} | *only for smsc delivery receipt*: Where appropriate this may hold a Network specific error code or an SMSC error code for the attempted delivery of the message. These errors are Network or SMSC specific and are not included here. | | {{CamelSmppSubmitDate}} | *only for smsc delivery receipt*: The time and date at which the short message was submitted. In the case of a message which has been replaced, this is the date that the original message was replaced. The format is as follows: YYMMDDhhmm. | | {{CamelSmppSubmitted}} | *only for smsc delivery receipt*: Number of short messages originally submitted. This is only relevant when the original message was submitted to a distribution list.The value is padded with leading zeros if necessary. | | {{CamelSmppDestAddr}} | *only for deliver sm and data sm*: Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. | | {{CamelSmppScheduleDeliveryTime}} | *only for deliver sm and data sm*: This parameter specifies the scheduled time at which the message delivery should be first attempted. It defines either the absolute date and time or relative time from the current SMSC time at which delivery of this message will be attempted by the SMSC. It can be specified in either absolute time format or relative time format. The encoding of a time format is specified in Section 7.1.1. in the smpp specification v3.4. | | {{CamelSmppValidityPeriod}} | *only for deliver sm*: The validity period parameter indicates the SMSC expiration time, after which the message should be discarded if not delivered to the destination. It can be defined in absolute time format or relative time format. The encoding of absolute and relative time format is specified in Section 7.1.1 in the smpp specification v3.4. | | {{CamelSmppServiceType}} | *only for deliver sm and data sm*: The service type parameter indicates the SMS Application service associated with the message. | | {{CamelSmppRegisteredDelivery}} | *only for data sm*: Is used to request an delivery receipt and/or SME originated acknowledgements. The following values are defined:\\ {{0}}: No SMSC delivery receipt requested.\\ {{1}}: SMSC delivery receipt requested where final delivery outcome is success or failure.\\ {{2}}: SMSC delivery receipt requested where the final delivery outcome is delivery failure. | | {{CamelSmppDestAddrNpi}} | *only for data sm*: Defines the numeric plan indicator (NPI) in the destination address parameters. The following NPI values are defined: \\ {{0}}: Unknown\\ {{1}}: ISDN (E163/E164)\\ {{2}}: Data (X.121)\\ {{3}}: Telex (F.69)\\ {{6}}: Land Mobile (E.212)\\ {{8}}: National\\ {{9}}: Private\\ {{10}}: ERMES\\ {{13}}: Internet (IP)\\ {{18}}: WAP Client Id (to be defined by WAP Forum) | | {{CamelSmppDestAddrTon}} | *only for data sm*: Defines the type of number (TON) in the destination address parameters. The following TON values are defined:\\ {{0}}: Unknown\\ {{1}}: International\\ {{2}}: National\\ {{3}}: Network Specific\\ {{4}}: Subscriber Number\\ {{5}}: Alphanumeric\\ {{6}}: Abbreviated | {tip:title=JSMPP library} See the documentation of the [JSMPP Library|http://code.google.com/p/jsmpp/] for more details about the underlying library. {tip} h3. Samples A route which sends an SMS using the Java DSL: {code} |
SMS limitations
SMS is neither reliable or secure. Users who require reliable and secure delivery may want to consider using the XMPP or SIP components instead, combined with a smartphone app supporting the chosen protocol.
- Reliability: although the SMPP standard offers a range of feedback mechanisms to indicate errors, non-delivery and confirmation of delivery it is not uncommon for mobile networks to hide or simulate these responses. For example, some networks automatically send a delivery confirmation for every message even if the destination number is invalid or not switched on. Some networks silently drop messages if they think they are spam. Spam detection rules in the network may be very crude, sometimes more than 100 messages per day from a single sender may be considered spam.
- Security: there is basic encryption for the last hop from the radio tower down to the recipient handset. SMS messages are not encrypted or authenticated in any other part of the network. Some operators allow staff in retail outlets or call centres to browse through the SMS message histories of their customers. Message sender identity can be easily forged. Regulators and even the mobile telephone industry itself has cautioned against the use of SMS in two-factor authentication schemes and other purposes where security is important.
While the Camel component makes it as easy as possible to send messages to the SMS network, it can not offer an easy solution to these problems.
Data coding, alphabet and international character sets
Data coding and alphabet can be specified on a per-message basis. Default values can be specified for the endpoint. It is important to understand the relationship between these options and the way the component acts when more than one value is set.
Data coding is an 8 bit field in the SMPP wire format.
Alphabet corresponds to bits 0-3 of the data coding field. For some types of message, where a message class is used (by setting bit 5 of the data coding field), the lower two bits of the data coding field are not interpreted as alphabet and only bits 2 and 3 impact the alphabet.
Furthermore, current version of the JSMPP library only seems to support bits 2 and 3, assuming that bits 0 and 1 are used for message class. This is why the Alphabet class in JSMPP doesn't support the value 3 (binary 0011) which indicates ISO-8859-1.
Although JSMPP provides a representation of the message class parameter, the Camel component doesn't currently provide a way to set it other than manually setting the corresponding bits in the data coding field.
When setting the data coding field in the outgoing message, the Camel component considers the following values and uses the first one it can find:
- the data coding specified in a header
- the alphabet specified in a header
- the data coding specified in the endpoint configuration (URI parameter)
Older versions of Camel had bugs in support for international character sets. This feature only worked when a single encoding was used for all messages and was troublesome when users wanted to change it on a per-message basis. Users who require this to work should ensure their version of Camel includes the fix for
Jira | ||||
---|---|---|---|---|
|
In addition to trying to send the data coding value to the SMSC, the Camel component also tries to analyze the message body, convert it to a Java String (Unicode) and convert that to a byte array in the corresponding alphabet When deciding which alphabet to use in the byte array, the Camel SMPP component does not consider the data coding value (header or configuration), it only considers the specified alphabet (from either the header or endpoint parameter).
If some characters in the String can't be represented in the chosen alphabet, they may be replaced by the question mark ( ? ) symbol. Users of the API may want to consider checking if their message body can be converted to ISO-8859-1 before passing it to the component and if not, setting the alphabet header to request UCS-2 encoding. If the alphabet and data coding options are not specified at all then the component may try to detect the required encoding and set the data coding for you.
The list of alphabet codes are specified in the SMPP specification v3.4, section 5.2.19. One notable limitation of the SMPP specification is that there is no alphabet code for explicitly requesting use of the GSM 3.38 (7 bit) character set. Choosing the value 0 for the alphabet selects the SMSC default alphabet, this usually means GSM 3.38 but it is not guaranteed. The SMPP gateway Nexmo actually allows the default to be mapped to any other character set with a control panel option. It is suggested that users check with their SMSC operator to confirm exactly which character set is being used as the default.
Message splitting and throttling
After transforming a message body from a String to a byte array, the Camel component is also responsible for splitting the message into parts (within the 140 byte SMS size limit) before passing it to JSMPP. This is completed automatically.
If the GSM 3.38 alphabet is used, the component will pack up to 160 characters into the 140 byte message body. If an 8 bit character set is used (e.g. ISO-8859-1 for western Europe) then 140 characters will be allowed within the 140 byte message body. If 16 bit UCS-2 encoding is used then just 70 characters fit into each 140 byte message.
Some SMSC providers implement throttling rules. Each part of a message that has been split may be counted separately by the provider's throttling mechanism. The Camel Throttler component can be useful for throttling messages in the SMPP route before handing them to the SMSC.
URI format
Code Block |
---|
smpp://[username@]hostname[:port][?options]
smpps://[username@]hostname[:port][?options]
|
If no username is provided, then Camel will provide the default value smppclient
.
If no port number is provided, then Camel will provide the default value 2775
.
Camel 2.3: If the protocol name is "smpps", camel-smpp with try to use SSLSocket to init a connection to the server.
You can append query options to the URI in the following format, ?option=value&option=value&...
URI Options
Div | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You can have as many of these options as you like.
Code Block |
---|
smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer
|
Producer Message Headers
The following message headers can be used to affect the behavior of the SMPP producer
Div | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The following message headers are used by the SMPP producer to set the response from the SMSC in the message header
Div | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
|
Consumer Message Headers
The following message headers are used by the SMPP consumer to set the request data from the SMSC in the message header
Div | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tip | ||
---|---|---|
| ||
See the documentation of the JSMPP Library for more details about the underlying library. |
Exception handling
This component supports the general Camel exception handling capabilities
When an error occurs sending a message with SubmitSm (the default action), the org.apache.camel.component.smpp.SmppException is thrown with a nested exception, org.jsmpp.extra.NegativeResponseException. Call NegativeResponseException.getCommandStatus() to obtain the exact SMPP negative response code, the values are explained in the SMPP specification 3.4, section 5.1.3.
Camel 2.8 onwards: When the SMPP consumer receives a DeliverSm
or DataSm
short message and the processing of these messages fails, you can also throw a ProcessRequestException
instead of handle the failure. In this case, this exception is forwarded to the underlying JSMPP library which will return the included error code to the SMSC. This feature is useful to e.g. instruct the SMSC to resend the short message at a later time. This could be done with the following lines of code:
Code Block | ||||
---|---|---|---|---|
| ||||
from("smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer")
.doTry()
.to("bean:dao?method=updateSmsState")
.doCatch(Exception.class)
.throwException(new ProcessRequestException("update of sms state failed", 100))
.end();
|
Please refer to the SMPP specification for the complete list of error codes and their meanings.
Samples
See the SMS Router source code for a full sample application. Consider integrating your application with SMS Router through queues rather than adding the SMPP code directly to your routes, building a more loosely-coupled architecture.
A route which sends an SMS using the Java DSL:
Code Block |
---|
from("direct:start") .to("smpp://smppclient@localhost:2775? password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer"); {code} |
A
...
route
...
which
...
sends
...
an
...
SMS
...
using
...
the
...
Spring
...
XML
...
DSL:
Code Block | ||||
---|---|---|---|---|
| ||||
{code:xml} <route> <from uri="direct:start"/> <to uri="smpp://smppclient@localhost:2775? password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer"/> </route> {code} |
A
...
route
...
which
...
receives
...
an
...
SMS
...
using
...
the
...
Java
...
DSL:
Code Block |
---|
} from("smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer") .to("bean:foo"); {code} |
A
...
route
...
which
...
receives
...
an
...
SMS
...
using
...
the
...
Spring
...
XML
...
DSL:
Code Block | ||||
---|---|---|---|---|
| ||||
{code:xml} <route> <from uri="smpp://smppclient@localhost:2775? password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer"/> <to uri="bean:foo"/> </route> |
Tip | ||
---|---|---|
| ||
If you need an SMSC simulator for your test, you can use the simulator provided by Logica. |
Debug logging
This component has log level DEBUG, which can be helpful in debugging problems. If you use log4j, you can add the following line to your configuration:
Code Block |
---|
{code} {tip:title=SMSC simulator} If you need an SMSC simulator for your test, you can use the simulator provided by [Logica|http://opensmpp.logica.com/CommonPart/Download/download2.html#simulator]. {tip} h3. Debug logging This component has log level *DEBUG*, which can be helpful in debugging problems. If you use log4j, you can add the following line to your configuration: {code} log4j.logger.org.apache.camel.component.smpp=DEBUG {code} {include:Endpoint See Also} |
Include Page | ||||
---|---|---|---|---|
|