Skip to content

Limitations

Protocol Limitations

The protocols underpinning the SMS ecosystem have some years behind them, as such there is some limitations that seems strange in a modern tech stack.

SMS Length

A SMS message has a maximum size of 140 bytes, messages larger than 140 bytes are chained together using some of these bytes, leaving 134 bytes for the message on each “page”.

Using GSM 03.38 the length is extended by only using 7 bits per character instead of the normal 8 bits used by UTF-8 this gives 160 characters for one page messages, if a messages is longer than those 160 charcters, 7 bits will be used to chain the messages together as pages giving a total of 153 characters per page.

Using UCS2 encoding will enable to use a wide range of different characters that is not available in GSM 03.38, this is achieved by using 2 bytes per character. giving you 70 characters for one page messages, if you go above 70 characters the messages will be chained giving you 134 bytes or 67 characters for your message.

In short:

  • GSM 03.38 (default)
    • Uses 7 bits per character (with a few exceptions), to extend the 140 bytes max length of a SMS
    • 160 normal characters for one page.
    • Messages longer than 160 characters are chained and gives a length of 153 characters per page.
  • UCS2
    • Allows the use of a lot of different special characters by using 2 bytes per character
    • 70 characters for one page.
    • Messages longer then 70 characters are chained and gives a leaves 67 characters per page.

SMS Sender

The originator of the SMS message. The SMS standards limit the length up to 15 digits if it is digits and up to 11 characters if it is text. You can use spaces in the sender, but most modern smartphones do not display the space.

For some destinations there may be country/network specific restrictions on the senders, and the sender may be automatically replaced or you may need to use a special sender for the destination/network.

We recommend you stick with characters in the range a-zA-Z0-9, however if you do use Latin-1 characters ie. (æøå) we will support it on connections where it is available. If the mobile network connection do not support these characters, we will automatically replace them with basic latin chracters according to the table below.

The Missing Encoding

While a text message can be sent via multiple different encodings the SMS sender, does not have a mechanism to specify the encoding, nor does it have one specified in the specifications.

This means that it has been up to each designer of the software powering the SMS system to pick an encoding. Which has led to the current situation where the character set available to use in the SMS sender text is quite limited.

If the replacement results in a too long sender, we try to reduce certain multi character replacements with just their most signficant character before reducing the rest of the multi character to just the first character.

Code Char Replacement Note
00A0 Non-breaking space to normal space
00A1 ¡ !
00A2 ¢ C/
00A3 £ PS
00A4 ¤ $?
00A5 ¥ Y=
00A6 ¦ |
00A7 § SS
00A8 ¨ "
00A9 © (c) Short version c
00AA ª a
00AB « <<
00AC ¬ !
00AD ­ - Soft hyphen to normal minus-hyphen
00AE ® (r) Short version r
00AF ¯ -
00B0 ° deg Short version d
00B1 ± +-
00B2 ² 2
00B3 ³ 3
00B4 ´ '
00B5 µ u
00B6 P
00B7 · *
00B8 ¸ ,
00B9 ¹ 1
00BA º o
00BB » >>
00BC ¼ 1/4
00BD ½ 1/2
00BE ¾ 3/4
00BF ¿ ?
00C0 À A
00C1 Á A
00C2 Â A
00C3 Ã A
00C4 Ä A
00C5 Å Aa
00C6 Æ Ae
00C7 Ç C
00C8 È E
00C9 É E
00CA Ê E
00CB Ë E
00CC Ì I
00CD Í I
00CE Î I
00CF Ï I
00D0 Ð D
00D1 Ñ N
00D2 Ò O
00D3 Ó O
00D4 Ô O
00D5 Õ O
00D6 Ö O
00D7 × x
00D8 Ø Oe
00D9 Ù U
00DA Ú U
00DB Û U
00DC Ü U
00DD Ý Y
00DE Þ Th
00DF ß ss
00E0 à a
00E1 á a
00E2 â a
00E3 ã a
00E4 ä a
00E5 å aa
00E6 æ ae
00E7 ç c
00E8 è e
00E9 é e
00EA ê e
00EB ë e
00EC ì i
00ED í i
00EE î i
00EF ï i
00F0 ð d
00F1 ñ n
00F2 ò o
00F3 ó o
00F4 ô o
00F5 õ o
00F6 ö o
00F7 ÷ /
00F8 ø oe
00F9 ù u
00FA ú u
00FB û u
00FC ü u
00FD ý y
00FE þ th
00FF ÿ y

We route the traffic to the best connection regardless of their support of special characters, so you may experience the sender is replaced. With that said, if you have a special need for these characters in your sender fields, contact support and we can work something out.

Message Filtering

As SMS is a very widespread form of communication is it sadly also functions as a good way to reach people for illegitimate purposes, such as phishing, spamming, and harrasment.

Therefore it is becomming increasingly normal that providers in the SMS ecosystem perform some kind of filtering on messages that travel through their systems to prevent or at least limit malicious use.

GatewayAPI is no exception, we have some of our own, but in certain markets we are subject to requirements by law or contract.

Some messages contain links that due to phishing attacks and generally unwanted spam cannot be accepted. Each account has a whitelist of links that are allowed, unique to that account, and approved by our staff. Any links found in the messages are checked against the whitelist, using the following method:

  • A bare domain (such as gatewayapi.com) allows all links pointing to that domain.
  • A specific link (such as gatewayapi.com/docs) only allows exactly that link to be allowed through the whitelist check.

Some certain accounts are marked as especially trusted and are excempt from having their messages checked.

You can submit new links, as well as check the current whitelist on the dashboard under Settings.

To learn more about the our efforts to stopping malicious messages, go read the blog post about message filtering.

Tip

Since all links in SMSes are just text be careful where you put dots (.) in the message text when using our APIs, as text such as hello.world will be identified as containing a link.

This happens because the processing to find links happens on the device that receives the SMS, and therefor our systems have to match those systems.

Blocked Senders

Using a specific sender is frequently used when phishing, we maintain a list of senders that we limit the use of.

Country Restrictions

Many countries apply restrictions on what content can be sent via SMS. Such as not allowing custom sender at all, which in most cases manifest via automatic sender override with a random number.

For more information about that please check the section about country restrictions on our support page.