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.

{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]
{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}}.

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). |
| {{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). |
| {{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: \\
{{}}: Don't replace\\
{{}}: 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 |

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 and deliver 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 and deliver 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 and deliver sm*: Defines the address of SME (Short Message Entity) which originated this message. |
| {{CamelSmppSourceAddrNpi}} | *only for alert notification*: 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*: 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*: 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*: 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*: Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. |
| {{CamelSmppScheduleDeliveryTime}} | *only for deliver 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. |


{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}
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:xml}
<route>
  <from uri="direct:start"/>
  <to uri="smpp://smppclient@localhost:2775?password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=producer"/>
</route>
{code}

A route which receives an SMS using the Java DSL:
{code}
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:xml}
  <route>
     <from uri="smpp://smppclient@localhost:2775?password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=consumer"/>
     <to uri="bean:foo"/>
  </route>
{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}