Setting Voicemail Waiting Indication via SMS

This entry is part 16 of 17 in the series Sending out an SMS

As shown in an earlier post, the Data Coding Scheme (DCS) octet in the SMS PDU can be used to turn a regular text message into a flash message.

Another feature of SMS that is enabled through use of the DCS is the Message Waiting Indication:

  • When someone leaves you a voicemail, the voicemail system communicates with the SMSC to send your phone a special SMS message that turns on the little icon on your phone that indicates that you have a new voicemail.
  • When you listen to your voicemail, the voicemail system also communicates with the SMSC to send your phone a SMS message that turns the little icon off again.

Using the DCS you can turn the voicemail icon on or off yourself.

This is an example PDU to set a voicemail indication:

AT+CMGS=27
0001AB0B915121551532F400C80F3190BB7C07D9DFE971B91D4EB301<Ctrl-Z>

Here is what the individual octets represent:

Read More…

References

This entry is part 15 of 17 in the series Sending out an SMS

I have added a page with references to the official 3GPP, Open Mobile Alliance (formerly WAP Forum) and other specifications that are relevant for the topics in this blog so far.

See here.

I’ll keep that page up-to-date.

How to pack GSM-7 characters into septets

This entry is part 14 of 17 in the series Sending out an SMS

Once we have our text in the GSM-7 character set, we’re ready to write the septets. As is show before, the mapping is kind of awkward, see 3GPP TS 23.038.

Here is the algorithm I use to achieve this: Read More…

GSM-7 Encoding with the GNU iconv library

This entry is part 13 of 17 in the series Sending out an SMS

To produce the GSM-7 encoded text that is needed for SMS text messages sent with a GSM modem in PDU mode we need 2 steps.

First we need to convert our text to the GSM-7 character set.

The GSM-7 character set is described in 3GPP TS 23.038.

I’ve always been a fan of the GNU iconv library (libiconv). This library lets you convert practically any character set to any other character set. It does this by internally:

  • converting the source character set to Unicode and
  • converting from Unicode to the destination character set

Unfortunately libiconv does not have support for the GSM-7 character set, so I have added it myself. Read More…

Combining SMS messages

This entry is part 6 of 17 in the series Sending out an SMS

As discussed in a previous post, many features of SMS messages become available if you can set the User Data Header (UDH) field.

When using a GSM modem in text mode you can’t sent a UDH, so you need to use PDU mode.

How do you add a UDH?

There are 2 things you need to do:

  • Set the UDH bit in the first octet of the PDU. For an SMS-SUBMIT PDU (the only one we’ve been using so far) the value is normally 0×01. To indicate that a UDH is present we need to set bit 6 (0×40). So for an SMS-SUBMIT with UDH present we set the PDU type to 0×41.
  • With the UDH bit set, this first octet of the payload (or User Data = UD) needs to indicate the length of the UDH in octets. This field is known as UDHL.

Read More…

What are EMS messages?

This entry is part 5 of 17 in the series Sending out an SMS

EMS stands for Enhance Message Services. EMS messages are just SMS messages with a twist.

EMS messages make use of the User Data Header to add some meta data to the SMS message being sent. This meta data is separate from the actual text and devices that don’t understand some or any of the EMS features will easily skip over them and just render the text.

The uses of EMS are many:

Read More…

Sending a flash SMS message

This entry is part 4 of 17 in the series Sending out an SMS

So far I’ve show how to send a text message in PDU mode. There is nothing special about this. There are a number of things you can do in PDU mode, that you can’t do in text mode.

A first example is a flash SMS message.

A flash SMS message is an SMS message that, instead of being stored in the SIM or memory of the receiving phone, pops-up on the receiving phone’s screen, without the user taking any action. When dismissed the message is usually gone.

Here is an example AT command to send a flash SMS message in PDU mode:

AT+CMGS=28<crlf>
> 0001010B915121551532F40010104190991D9EA341EDF27C1E3E9743<Ctrl-Z>
Here is what the individual octets represent:

Read More…

More on the SMS PDU

This entry is part 3 of 17 in the series Sending out an SMS

As discussed in an earlier post, you can connect to a GSM modem and use AT commands to send SMS messages. There are 2 possible methods: text mode and PDU mode.

It turns out that most devices support PDU mode, but only a few support text mode.

Here is an example AT command to submit a PDU:

AT+CMGS=24<crlf>
> 0001000B915121551532F400000CC8F79D9C07E54F61363B04<Ctrl-Z>
As explained before the size (24) is the number of octets in the PDU. he PDU itself is passed as a hex representation of those octets (48 characters). Here is what the individual octets represent:

Read More…

Sending out an SMS in PDU mode

This entry is part 1 of 17 in the series Sending out an SMS

PDU mode is a lot more interesting than text mode. There are all kinds of things that can be done with SMS messages, all leveraging special formatting that is only available if you use PDU mode:

The formatting of these PDU’s is a little more complicated and requires some bit manipulations that are hard to do by hand.

The GSM modem is put into PDU mode with the command ‘AT+CMGF=0’. Once in PDU mode a PDU can be sent using the ‘AT+CMGS’ command:
Read More…