All integration guides
Connect Kannel to TelecomsXchange
In short: Add a group = smsc with smsc = smpp, host = smpp01.telecomsxchange.com, port = 2776, transceiver-mode = true and your account's SMPP System Id and SMPP Password as smsc-username and smsc-password. Set unified-prefix = "TECH_PREFIX#,+,00" on that group so +447700900123 leaves as 80039#447700900123. To sell SMS, Kannel needs the opensmppbox add-on to accept TelecomsXchange's bind.
Kannel to TelecomsXchange over SMPP
- Your applicationHTTP sendsms to smsbox, to=+447700900123
- then, smsc=tcxc, Your Kannelbearerbox smsc group, transceiver bind
- then, 80039#447700900123, TelecomsXchangesmpp01, TCP 2776
- Seller's SMSCThe SMS route you purchased
On this page
Kannel connects to TelecomsXchange like to any SMSC: one smsc group in bearerbox makes the transceiver bind, and smsbox takes your applications' HTTP requests. This guide adds the TelecomsXchange link, prefixes every number with your route's tech prefix, wires up delivery receipts and covers the selling direction, which needs the opensmppbox add-on. For the values themselves, see Connect an SMPP platform.
Before you start#
- An SMPP account with its SMPP System Id and SMPP Password. Set its IP Address to your Kannel server's public IP, for example
203.0.113.10. - An SMS route and its tech prefix from My Interconnections, for example
80039. Below,TECH_PREFIXstands for it. - A sender ID registered on the account (see Sender Settings on Logs → SDR (SMS)).
- Kannel 1.4 or later with a working
coreandsmsboxgroup.
How do I send SMS through TelecomsXchange?#
- Add an
smscgroup tokannel.conf:
# TelecomsXchange: one transceiver bind
group = smsc
smsc = smpp
smsc-id = tcxc
host = smpp01.telecomsxchange.com
port = 2776
transceiver-mode = true # bind_transceiver on 'port'; no receive-port
smsc-username = SYSTEM_ID # account's SMPP System Id
smsc-password = PASSWORD # account's SMPP Password
interface-version = 34 # SMPP 3.4
enquire-link-interval = 30
reconnect-delay = 10
max-pending-submits = 10
throughput = 10 # keep at or below the account's SMPP Rate Limit (req/sec)
# Put the tech prefix in front of every number sent on this link:
# +447700900123 or 00447700900123 becomes 80039#447700900123
unified-prefix = "TECH_PREFIX#,+,00"SYSTEM_ID and PASSWORD are the account's credentials; replace TECH_PREFIX with the route's prefix, keeping the #: unified-prefix = "80039#,+,00".
- Send messages to this link only. Either force it on the sendsms user:
group = sendsms-user
username = app
password = APP_PASSWORD
forced-smsc = tcxc
default-sender = MyBrand # a sender ID registered on your account
max-messages = 10 # allow long messages to be split
concatenation = trueor pass smsc=tcxc on each request.
-
Restart bearerbox and smsbox.
-
Have your applications send numbers in international format with
+or00, so theunified-prefixrule matches:
curl -G "http://127.0.0.1:13013/cgi-bin/sendsms" \
--data-urlencode "username=app" \
--data-urlencode "password=APP_PASSWORD" \
--data-urlencode "to=+447700900123" \
--data-urlencode "from=MyBrand" \
--data-urlencode "text=Test from Kannel" \
--data-urlencode "dlr-mask=3" \
--data-urlencode "dlr-url=http://127.0.0.1/dlr?id=42&status=%d"unified-prefix replaces the leading + or 00 with TECH_PREFIX#, so the submit_sm leaves with destination_addr 80039#447700900123. A number sent without + or 00 doesn't match the rule and goes out plain, which TelecomsXchange sends through your account's default route.
Tip
To use a routing group instead of one route, put the group's prefix in the rule: unified-prefix = "444123#,+,00". To send through two different routes, define two smsc groups with different smsc-id values and prefixes and choose with smsc= per request.
How do I receive delivery receipts?#
Ask for a receipt with dlr-mask (1 delivered, 2 not delivered; 3 for both) and a dlr-url. Kannel sets registered_delivery on the submit_sm, stores the message_id from the submit_sm_resp, and when TelecomsXchange sends the deliver_sm with id:<message_id> and stat:DELIVRD on the same bind, it calls your dlr-url with %d set to the delivery state.
Keep the link up: receipts are relayed only to an open bind. If a receipt arrives that Kannel can't match, set msg-id-type on the smsc group to the number base the IDs use (see References).
How do I receive SMS from TelecomsXchange as a seller?#
Kannel's bearerbox only connects out to SMSCs; it doesn't accept SMPP binds. To let TelecomsXchange bind to you, install opensmppbox, a separate Kannel add-on that listens for SMPP clients and passes their messages to bearerbox, which delivers them through your own smsc links.
- In
kannel.conf, make sure thecoregroup hassmsbox-portset (for example13001) and a DLR store; opensmppbox connects to bearerbox on that port. - Create
opensmppbox.conf:
group = opensmppbox
opensmppbox-id = tcxc-in
opensmppbox-port = 2775 # the port you enter on your TelecomsXchange SMS route
bearerbox-host = 127.0.0.1
bearerbox-port = 13001 # bearerbox smsbox-port
our-system-id = MYSMSC
route-to-smsc = my-operator-link # smsc-id of the link that delivers the traffic
use-systemid-as-smsboxid = true # match logins on system ID and password only
smpp-logins = /etc/kannel/smpplogins.txt
log-file = /var/log/kannel/opensmppbox.log- Add TelecomsXchange to
/etc/kannel/smpplogins.txt: system ID, password, system type and the allowed source IP:
TCXC_SYSTEM_ID TCXC_PASSWORD tcxc 174.136.44.213Use the same SMPP System Id and SMPP Password you set on your SMS route under Routes → My Routes.
- Start opensmppbox, allow
174.136.44.213to port 2775 on your firewall, and on the route enter your server asIP:2775, SMPP Version 3.4, TLS No.
Warning
Without use-systemid-as-smsboxid = true, opensmppbox also compares the bind's system_type with the third column of smpplogins.txt, and a mismatch refuses the bind. Leave it on.
opensmppbox answers each submit_sm and sends receipts back to the bind as deliver_sm when the message was submitted with registered_delivery, which TelecomsXchange always sets.
Inbound SMS for numbers you sell: add a second smsc group with smsc-id = tcxc-did, the same host and port, smsc-username = did and smsc-password = did (or your custom DID credentials), no unified-prefix, and route messages for those numbers to it. Buying numbers works the other way round: TelecomsXchange binds to the SMPP Endpoint on your number, so it also needs opensmppbox.
How do I test it?#
- Open the bearerbox status page:
http://127.0.0.1:13000/status?password=STATUS_PASSWORD. Thetcxclink should show online. On TelecomsXchange, the account's Bind Status shows ONLINE. - Send the
curlrequest above to a test handset. - In the bearerbox log, find the
submit_smwithdestination_addr: "80039#447700900123"and itssubmit_sm_respwith status 0, then thedeliver_smreceipt. Uselog-level = 0while testing. - Go to Logs → SDR (SMS), choose All Messages and click Search SMS.
What if something goes wrong?#
| You see | What to do |
|---|---|
Link never goes online; log shows bind status 0x0D |
Check smsc-username and smsc-password, and that Kannel binds from the account's IP address or an additional allowed IP. |
submit_sm_resp status 0x45 (69) |
The message was refused: no route or rate for the prefix, blocked route, low balance, sender ID not allowed or rate limit. Check Failed Only in the SDR. Lower throughput if you hit the rate limit. |
| Messages go to the default route | destination_addr has no prefix: the number wasn't sent with + or 00, or unified-prefix is on another group. |
sendsms rejects the to number |
You put # in to, which isn't in the default sendsms-chars. Send +447700900123 and let unified-prefix add the prefix, or add # to sendsms-chars. |
Status 0x01 |
The route takes single messages only. Enable concatenation so Kannel sends UDH parts. |
Status 0xFE (254) or 0x08 |
The seller timed out or the platform failed to forward. Kannel retries according to its queue; use a routing group with a failover route. |
No DLR reaches your dlr-url |
Check dlr-mask, that the link stayed online, and msg-id-type. The SDR still shows the delivered status. |
| Selling: Test Bind "has FAILED" | The system ID or password don't match smpplogins.txt, or use-systemid-as-smsboxid is off. |
| Selling: "host/port is probably unreachable" | opensmppbox isn't listening on that port or 174.136.44.213 is blocked. |
References#
Common questions
Can I put 80039#447700900123 straight into the sendsms to parameter?
Only if you add # to sendsms-chars in the smsbox group; by default Kannel accepts only 0123456789+- in to. The unified-prefix rewrite avoids that and keeps your applications sending plain numbers.
Can Kannel sell SMS routes on TelecomsXchange?
Not on its own: bearerbox only connects out to SMSCs. To accept TelecomsXchange's SMPP bind you need opensmppbox, a separate Kannel add-on that listens for SMPP clients and hands their messages to bearerbox.
Which dlr-mask should I use?
3 (delivered plus non-delivered to phone) is enough. TelecomsXchange relays the seller's final receipt to your bind as stat:DELIVRD.
Does Kannel split long messages?
Yes, if the sendsms-user allows it: set max-messages above 1 and concatenation = true. Each part is billed as one segment.
- Can I put 80039#447700900123 straight into the sendsms to parameter?
- Only if you add # to sendsms-chars in the smsbox group; by default Kannel accepts only 0123456789+- in to. The unified-prefix rewrite avoids that and keeps your applications sending plain numbers.
- Can Kannel sell SMS routes on TelecomsXchange?
- Not on its own: bearerbox only connects out to SMSCs. To accept TelecomsXchange's SMPP bind you need opensmppbox, a separate Kannel add-on that listens for SMPP clients and hands their messages to bearerbox.
- Which dlr-mask should I use?
- 3 (delivered plus non-delivered to phone) is enough. TelecomsXchange relays the seller's final receipt to your bind as stat:DELIVRD.
- Does Kannel split long messages?
- Yes, if the sendsms-user allows it: set max-messages above 1 and concatenation = true. Each part is billed as one segment.
Finished this guide?
This guide matches platform build 83b4ebc9. Markdown version.