SMPP Sink
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Sends each message as an SMS text message to a mobile phone, through an SMS center (SMSC) that speaks the SMPP protocol.
Use it to send alerts, one-time codes or notifications by SMS, through an SMS provider or operator that offers SMPP access. Use smpp-source to receive SMS replies and delivery receipts.
Input: the body is the text of the SMS. The phone number to send it to comes from the CamelSmppDestAddr header when it is set, and from destAddr otherwise. A text longer than one SMS (160 characters, or 70 with alphabet 8) is split, cut or refused, as splittingPolicy says.
Output: the message is unchanged, with the IDs that the SMSC gave the SMS in the CamelSmppId header (a List), and how many SMS were sent in CamelSmppSentMessageCount.
Good to know: the defaults of sourceAddr (1616) and destAddr (1717) are test numbers: set them, or set CamelSmppDestAddr on each message. It asks the SMSC for a delivery receipt of each SMS, which smpp-source receives: set registeredDelivery to 0 to not ask for them. The text is encoded with encoding, so characters it cannot hold, such as Cyrillic or emoji in ISO-8859-1, are sent as ?: for text in any language, set alphabet and dataCoding to 8. It logs in to the SMSC when the integration starts, and the integration fails to start when the SMSC cannot be reached. It connects with no TLS unless usingSSL is true. Headers that start with CamelSmpp, except CamelSmppDestAddr, are removed from the message first, so they cannot change what the Kamelet does.
Configuration Options
The following table summarizes the configuration options available for the smpp-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Host | Required The host name or IP address of the SMSC (the SMS center of your SMS provider or operator). | string | smsc.example.com | ||
Alphabet | How to turn the body into the bytes of the SMS: Enum values: * 0 * 4 * 8 | integer | 8 | ||
Data Coding | The data coding the SMS is marked with, from 0 to 127, which tells the phone how to read its bytes, as in section 5.2.19 of the SMPP 3.4 specification: | integer | 8 | ||
Recipient Address | The phone number to send the SMS to, used when the message has no | string | 1717 | 4598765432 | |
Recipient Numbering Plan | The numbering plan indicator (NPI) of the recipient address: Enum values: * 0 * 1 * 3 * 4 * 6 * 8 * 9 * 10 * 14 * 18 | integer | 1 | ||
Recipient Type Of Number | The type of number (TON) of the recipient address, from Enum values: * 0 * 1 * 2 * 3 * 4 * 5 * 6 | integer | 1 | ||
Encoding | The character set of the text of the SMS, such as | string | ISO-8859-1 | ||
Enquire Link Interval | How often to check that the connection to the SMSC is alive with an enquire_link, in milliseconds. When it is not set, it is 60000, which is one minute. A lower value finds a lost connection sooner. | integer | 30000 | ||
Password | The password to log in to the SMSC with. Your SMS provider gives it. | string | |||
Port | The port of the SMSC. 2775 is the usual SMPP port. | integer | 2775 | ||
Delivery Receipt | Which delivery receipts to ask the SMSC for: Enum values: * 0 * 1 * 2 | integer | 0 | ||
Sender Address | The sender of the SMS, as the recipient sees it: a phone number, a short code or, when the SMSC allows it, a name. The default, 1616, is a test value. | string | 1616 | 4512345678 | |
Sender Numbering Plan | The numbering plan indicator (NPI) of Enum values: * 0 * 1 * 3 * 4 * 6 * 8 * 9 * 10 * 14 * 18 | integer | 1 | ||
Sender Type Of Number | The type of number (TON) of Enum values: * 0 * 1 * 2 * 3 * 4 * 5 * 6 | integer | 5 | ||
Splitting Policy | What to do with a text longer than one SMS (160 characters, or 70 with Enum values: * ALLOW * TRUNCATE * REJECT | string | ALLOW | ||
System ID | The user name, called system ID in SMPP, to log in to the SMSC with. Your SMS provider gives it. | string | smppclient | ||
System Type | A short label of at most 13 characters that some SMSCs ask for when logging in. Leave it empty unless your SMS provider gives one. | string | cp | ||
Use TLS | Whether to secure the connection to the SMSC with TLS (the smpps protocol). The SMSC must support it, usually on another port. | boolean | false |
Dependencies
At runtime, the smpp-sink Kamelet relies upon the presence of the following dependencies:
-
camel:smpp
-
camel:kamelet
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:smpp-sink" You can now run it directly through the following command
camel run route.yaml SMPP Sink Kamelet Description
Message
The message body is sent as the short message text. The recipient is the CamelSmppDestAddr header when it is set, and the destAddr option otherwise.
Delivery Receipts
The Kamelet asks the SMSC for a delivery receipt of each SMS. The SMSC sends the receipts to a receiver logged in to it, such as smpp-source, not to this Kamelet. registeredDelivery says which receipts to ask for:
registeredDelivery | Receipts |
|---|---|
not set, or | A receipt whether the SMS reached the phone or not |
| A receipt only when the SMS failed |
| No receipt |
Sender and Recipient Numbers
The type of number (TON) and the numbering plan (NPI) tell the SMSC how to read sourceAddr and the recipient address. When they are not set, both are 0 (unknown), and the SMSC guesses. Common settings:
| Address | TON | NPI | Example |
|---|---|---|---|
A phone number with its country code |
|
|
|
A name as the sender |
|
|
|
Set them with sourceAddrTon and sourceAddrNpi for the sender, and destAddrTon and destAddrNpi for the recipient. Ask your SMS provider which values it expects.
Text in Any Language
The text is encoded with encoding, ISO-8859-1 by default, so characters it cannot hold, such as Cyrillic, Greek or emoji, are sent as ?. To send text in any language, set both alphabet and dataCoding to 8 (UCS-2): alphabet encodes the text as UCS-2, and dataCoding marks the SMS as UCS-2 so that the phone can read it. One SMS then holds 70 characters instead of 160.
To send binary data, such as a body of bytes, set both alphabet and dataCoding to 4: the bytes are sent as they are.
Connection
The Kamelet binds to the SMSC when the integration starts, so an unreachable SMSC makes the integration fail to start, rather than failing each message.
Every enquireLinkTimer milliseconds, one minute by default, the Kamelet checks that the connection is alive. A lower value finds a lost connection sooner.
Set usingSSL to secure the connection with TLS, where the SMSC supports it.
Example with Delivery Receipts and Unicode Text
- route:
from:
uri: "kamelet:timer-source"
parameters:
message: "Ihr Paket ist unterwegs. Ваша посылка в пути."
period: 3600000
steps:
- to:
uri: "kamelet:smpp-sink"
parameters:
host: "smsc.example.com"
systemId: "myaccount"
password: "{{smpp.password}}"
sourceAddr: "MyShop"
sourceAddrTon: 5
sourceAddrNpi: 0
destAddr: "4598765432"
destAddrTon: 1
destAddrNpi: 1
registeredDelivery: 1
alphabet: 8
dataCoding: 8
enquireLinkTimer: 30000 The delivery receipts of these SMS arrive at an smpp-source logged in to the same SMSC.