Short Message Service / SMS Tutorial

SMS (Short Message Service) has achieved huge success in the wireless world. Billions of SMS messages are sent every day. SMS is now a major revenue generator for wireless carriers. A lot of innovative applications are now built on top of the SMS technology and more are being developed.

This SMS tutorial provides information about SMS application development. It begins with an introduction of mobile messaging technologies like SMS, concatenated SMS and EMS. You will learn what SMS is, what causes SMS messaging to be so popular worldwide, what applications can be developed with the SMS technology, what SMS center and SMS gateway are, and some other basic concepts of SMS messaging.

After that, we will discuss in detail various ways to send and receive SMS messages from a computer, the advantages and disadvantages of each way, what SMS service providers are, the hardware (e.g. GSM / GPRS modem) and software (e.g. HyperTerminal) required to send and receive SMS messages from a computer, and where to find some free SMS messaging libraries and tools.

Note to non-developers:
This SMS tutorial contains technical information that non-developers may not interested in. If you are an ordinary user who do not want to develop SMS software or applications but just want to send and receive SMS messages from a PC, you may want to go directly to our quick guide for non-developers.


Table of Contents

1. Introduction to SMS Messaging

1.1. What is SMS (Short Message Service)?

1.2. Concatenated SMS Messages / Long SMS Messages

1.3. EMS (Enhanced Messaging Service)

2. What Makes SMS Messaging So Successful Worldwide?

2.1. SMS Messages can be Sent and Read at Any Time

2.2. SMS Messages can be Sent to an Offline Mobile Phone

2.3. SMS Messaging is Less Disturbing While You can Still Stay in Touch

2.4. SMS Messages are Supported by 100% GSM Mobile Phones and They can be Exchanged between Different Wireless Carriers

2.5. SMS is a Suitable Technology for Wireless Applications to Build on

3. Example Applications of SMS Messaging

3.1. Person-to-Person Text Messaging

3.2. Provision of Information

3.3. Downloading

3.4. Alerts and Notifications

3.4.1. Email, Fax and Voice Message Notifications

3.4.2. E-commerce and Credit Card Transaction Alerts

3.4.3. Stock Market Alerts

3.4.4. Remote System Monitoring

3.5. Two-way Interactive Text Messaging Applications

3.6. SMS Marketing

4. What is an SMS Center / SMSC?

5. Basic Concepts of SMS Technology

5.1. Validity Period of an SMS Message

5.2. Message Status Reports

5.3. Message Submission Reports

5.4. Message Delivery Reports

6. Intra-operator SMS Messages

6.1. Transmission Process of Intra-operator SMS Messages

7. Inter-operator SMS Messages

7.1. Transmission Process of Inter-operator SMS Messages

8. International SMS Messages

9. What is an SMS Gateway?

9.1. Open Source and Free SMS Gateway Software

10. How to Send SMS Messages from a Computer / PC?

10.1. The 1st Way: Sending SMS Messages from a Computer Using a Mobile Phone or GSM/GPRS Modem

10.1.1. Major Drawback of Sending SMS Messages through a Mobile Phone or GSM/GPRS Modem -- Low SMS Sending Rate

10.2. The 2nd Way: Sending SMS Messages from a Computer through a Connection to the SMSC or SMS Gateway of a Wireless Carrier or SMS Service Provider

10.2.1. Difficulties in Getting a Direct Connection to the SMSC or SMS Gateway of a Wireless Carrier

10.2.2. SMS Service Providers (SMS Gateway Providers, SMS Resellers, SMS Brokers)

10.2.3. Sending SMS Messages Using a Protocol / Interface Supported by an SMSC or SMS Gateway

11. How to Receive SMS Messages Using a Computer / PC?

11.1. The 1st Way: Using a Computer to Receive SMS Messages through a Mobile Phone or GSM/GPRS Modem

11.2. The 2nd Way: Using a Computer to Receive SMS Messages through a Connection to the SMSC or SMS Gateway of a Wireless Carrier

11.3. The 3rd Way: Using a Computer to Receive SMS Messages through a Connection to the SMS Gateway of an SMS Service Provider

11.3.1. SIM Hosting

11.3.1.1. Cost of SIM Hosting Service

11.3.2. Shared Phone Number

11.3.2.1. Registering Keywords

11.3.2.2. Cost of Shared Phone Number Service

11.4. Receiving SMS Messages Using a Protocol / Interface Supported by an SMSC or SMS Gateway

12. Introduction to GSM / GPRS Wireless Modems

12.1. What is a GSM Modem?

12.2. What is a GPRS Modem?

12.3. Which is Better: Mobile Phone or GSM / GPRS Modem?

13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?

13.1. What is Microsoft HyperTerminal?

13.2. The Procedure for Sending AT Commands to a Mobile Phone or GSM/GPRS Modem Using MS HyperTerminal

14. Introduction to AT Commands

14.1. Basic Commands and Extended Commands

15. General Syntax of Extended AT Commands

15.1. Information Response and Final Result Code

15.2. Case Sensitivity of AT Commands

16. Result Codes of AT Commands

16.1. Final Result Codes of AT Commands

16.1.1. The OK Final Result Code

16.1.2. The ERROR Final Result Code

16.2. Final Result Code Specific to SMS AT Commands

16.2.1. The +CMS ERROR Final Result Code -- Notifies the Occurrences and Causes of Message Service Failures

16.2.1.1. Table of +CMS Error Codes and Their Meanings

16.3. Unsolicited Result Codes of AT Commands

17. AT Command Operations: Test, Set, Read and Execution

17.1. Test Command -- Checks Whether a Certain AT Command is Supported

17.2. Set Command -- Changes the Settings Used for Certain Tasks

17.3. Read Command -- Retrieves the Current Settings Used for Certain Tasks

17.4. Execution Command -- Performs an Action or Retrieve Information/Status about the GSM/GPRS Modem or Mobile Phone

18. Testing the Communication between the PC and GSM/GPRS Modem or Mobile Phone

19. Checking if the GSM/GPRS Modem or Mobile Phone Supports the Use of AT Commands to Send, Receive and Read SMS Messages

19.1. Using the AT Command +CSMS to Check if Mobile-originated SMS Messages and Mobile-terminated SMS Messages are Supported

19.2. Checking if the AT Commands Required for Sending, Receiving and Reading SMS Messages are Supported

19.2.1. Overview of the AT Commands Required

19.2.2. Beginning the Check

20. Operating Mode: SMS Text Mode and SMS PDU Mode

20.1. Comparison of SMS Text Mode and SMS PDU Mode

20.2. Selecting the Operating Mode (AT+CMGF)

21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)

21.1. Syntax of the +CSCA AT Command

21.1.1. Setting the Service Center Address

21.1.2. Reading the Service Center Address

21.2. Example Demonstrating How to Use the +CSCA AT Command to Set and Read the Service Center Address

22. Preferred Message Storage (AT+CPMS)

22.1. Selecting the Message Storage Areas to be Used for SMS Reading, Writing, Deleting, Sending or Receiving

22.2. Format of the Information Response of the +CPMS AT Command

22.3. Finding the Message Storage Areas Supported by a GSM/GPRS Modem or Mobile Phone

22.4. Example Demonstrating How to Use the +CPMS AT Command to Select the Message Storage Areas to be Used

22.5. Finding the Message Storage Areas Currently Used, Number of Messages Currently Stored and Maximum Number of Messages Allowed

22.5.1. Example

23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)

23.1. Syntax of the +CMGW AT Command in SMS Text Mode

23.2. SMSC Number Stored with the SMS Message (SMS Text Mode)

23.3. Format of the Information Response of the +CMGW AT Command in SMS Text Mode

23.4. Example Demonstrating How to Use the +CMGW AT Command to Write SMS Text Messages to Message Storage in SMS Text Mode

23.5. Syntax of the +CMGW AT Command in SMS PDU Mode

23.6. SMSC Number Stored with the SMS Message (SMS PDU Mode)

23.7. Format of the Information Response of the +CMGW AT Command in SMS PDU Mode

23.8. Example Demonstrating How to Use the +CMGW AT Command to Write SMS Text Messages to Message Storage in SMS PDU Mode

24. Deleting SMS Messages from Message Storage (AT+CMGD)

24.1. Syntax of the +CMGD AT Command

24.2. Finding the Supported Indexes and Flag Values

24.3. Example Demonstrating How to Use the +CMGD AT Command to Delete SMS Text Messages

25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)

25.1. Comparison Table of the AT Commands +CMGS and +CMSS

25.2. Syntax of the +CMGS AT Command in SMS Text Mode

25.3. Format of the Information Response of the +CMGS AT Command in SMS Text Mode

25.4. Example Demonstrating How to Use the +CMGS AT Command to Send SMS Text Messages in SMS Text Mode

25.5. Syntax of the +CMGS AT Command in SMS PDU Mode

25.5.1. Some Explanation about the Coding of the SMSC_number_and_TPDU Parameter Value of the +CMGS AT Command

25.5.1.1. The SMSC Part

25.5.1.2. The TPDU Part (SMS-SUBMIT TPDU)

25.6. Format of the Information Response of the +CMGS AT Command in SMS PDU Mode

25.7. Example Demonstrating How to Use the +CMGS AT Command to Send SMS Text Messages in SMS PDU Mode

25.8. Syntax of the +CMSS AT Command in SMS Text Mode and PDU Mode

25.9. Format of the Information Response of the +CMSS AT Command in SMS Text Mode and PDU Mode

25.10. SMSC Number to be Used by the +CMSS AT Command to Send SMS Messages

25.10.1. SMS Text Mode

25.10.2. SMS PDU Mode

25.10.2.1. Case 1: SMSC Part is Not "00"

25.10.2.2. Case 2: SMSC Part is "00"

25.10.3. Reading the SMSC Number Saved with an SMS Message

25.10.3.1. SMS Text Mode

25.10.3.2. SMS PDU Mode

25.11. Example Demonstrating How to Use the +CMSS AT Command to Send Text Messages from a Message Storage Area (SMS Text Mode and SMS PDU Mode)

26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

26.1. Comparison Table of the AT Commands +CMGR and +CMGL

26.2. Using the +CMGR AT Command to Read an SMS Message from a Message Storage Area

26.2.1. Syntax of the +CMGR AT Command in SMS Text Mode

26.2.2. Format of the Information Response of the +CMGR AT Command in SMS Text Mode

26.2.2.1. Incoming SMS Messages and Outgoing SMS Messages

26.2.2.2. Details of the Fields that Appear in the +CMGR Information Response

26.2.3. Example Demonstrating How to Use the +CMGR AT Command to Read SMS Text Messages from a Message Storage Area (SMS Text Mode)

26.2.4. Syntax of the +CMGR AT Command in SMS PDU Mode

26.2.5. Format of the Information Response of the +CMGR AT Command in SMS PDU Mode

26.2.6. Some Explanation about the Decoding of the SMSC_number_and_TPDU Field Value of the +CMGR AT Command

26.2.6.1. Incoming SMS Messages and Outgoing SMS Messages

26.2.6.2. The SMSC Part

26.2.6.3. The TPDU Part (SMS-DELIVER TPDU)

26.2.7. Example Demonstrating How to Use the +CMGR AT Command to Read SMS Text Messages from a Message Storage Area (SMS PDU Mode)

26.3. Using the +CMGL AT Command to List SMS Messages of a Certain Status from a Message Storage Area

26.3.1. Syntax of the +CMGL AT Command in SMS Text Mode

26.3.2. Format of the Information Response of the +CMGL AT Command in SMS Text Mode

26.3.3. Finding the Message Status Values Supported by the +CMGL AT Command in SMS Text Mode

26.3.4. Example Demonstrating How to Use the +CMGL AT Command to List SMS Text Messages from a Message Storage Area (SMS Text Mode)

26.3.5. Syntax of the +CMGL AT Command in SMS PDU Mode

26.3.6. Format of the Information Response of the +CMGL AT Command in SMS PDU Mode

26.3.7. Finding the Message Status Values Supported by the +CMGL AT Command in SMS PDU Mode

26.3.8. Example Demonstrating How to Use the +CMGL AT Command to List SMS Text Messages from a Message Storage Area (SMS PDU Mode)


Appendix A: How to Choose an SMS Service Provider (SMS Gateway Provider, SMS Reseller, SMS Broker)?
This article discusses 13 factors you have to consider when choosing an SMS service provider (also known as SMS gateway provider, SMS reseller and SMS broker) for your mobile messaging application.
Page 1 - Page 2 - Page 3

Appendix B: Comparison Table of SMS Service Providers (SMS Gateway Providers, SMS Resellers, SMS Brokers)
The links to the web site of some SMS service providers (also known as SMS gateway providers, SMS resellers and SMS brokers) are listed in this comparison table. You can find a comparison of different SMS service providers' SMS cost, payment options, network coverage, protocols supported, 2-way SMS messaging service, SMS reverse billing (premium SMS) service, etc.

Appendix C: Free Software/Tools and Libraries for Sending and Receiving SMS Messages with a Computer / PC
The links to some free software, tools and libraries for sending and receiving SMS messages with a computer are provided in this article. This article should be useful to both developers and non-developers.

Appendix D: GSM 7-bit Default Alphabet Table (with Character Codes of ISO 8859 Latin 1)
A reference table that lists all characters and their decimal and hexadecimal codes as defined in the "GSM 7-bit default alphabet" text coding scheme. The corresponding character codes defined in ISO 8859 Latin 1 are also provided in the table for ease of reference.


Quick Guide for Non-Developers

Typing text messages with a mobile phone is difficult -- usually the screen and keypad are small and it has only 12 keys. If you have a PC beside you, no matter it is a desktop or notebook computer, you can use it to send or receive SMS text messages to take advantage of the QWERTY keyboard and big screen of the PC.

In the following guide, we will discuss how to send and receive SMS messages from a PC that runs Microsoft Windows. The guide is aimed at ordinary users who are not interested in developing SMS software or applications.

1. How to Use a Windows PC to Send and Receive SMS Messages (Non-Developer's Perspective)

1.1. Requirements

1.2. Using Microsoft SMS Sender to Send SMS Messages from a Windows PC

1.2.1. Introduction

1.2.2. Installing the Modem Driver of a Mobile Phone on a PC

1.2.2.1. Example 1: Connecting Sony Ericsson T68i to a PC via Infrared and Installing the Modem Driver on Windows XP

1.2.2.2. Example 2: Connecting Sony Ericsson T68i to a PC via Bluetooth and Installing the Modem Driver on Windows XP

1.2.3. Sending SMS Text Messages with SMS Sender

1.2.4. Sending SMS Text Messages in Other Languages

1.2.5. Logging SMS Text Messages Sent

1.2.6. Importing Phone Book Entries

In the following guide, we will discuss how to send and receive SMS messages from a PC that runs Linux. This guide is aimed at ordinary Linux users who are not interested in developing SMS software or applications. However, SMS application developers who plan to use Gnokii to handle low-level details of SMS messaging in their Linux applications should also benefit from this guide, especially from the sections that detail how to install and configure Gnokii on Linux.

1. How to Use a Linux PC to Send and Receive SMS Messages (Non-Developer's Perspective)

1.1. Requirements for Sending and Receiving SMS Messages from a Linux PC via a Mobile Phone

1.2. Using Gnokii to Send and Receive SMS Messages from a Linux PC

1.2.1. Introduction

1.2.2. Mobile Phone Models Supported by Gnokii

1.2.3. Installing Gnokii / XGnokii

1.2.3.1. Installing Gnokii / XGnokii on Linux

1.2.3.2. Installing Gnokii's gnapplet on Symbian OS

1.2.4. Configuring Gnokii / XGnokii on Linux

1.2.4.1. The port Parameter -- Specifying the Port on the PC that the Mobile Phone is Connected to

1.2.4.1.1. Serial Connection (RS-232 Connection)

1.2.4.1.2. Bluetooth / RFCOMM Connection

1.2.4.1.3. Infrared (IrDA) Connection

1.2.4.1.4. USB Connection

1.2.4.2. The model Parameter -- Specifying the Model of the Mobile Phone

1.2.4.3. The connection Parameter -- Specifying the Connection Type between the PC and the Mobile Phone

1.2.4.3.1. AT Command Mode

1.2.4.3.2. Serial Connection (RS-232 Connection)

1.2.4.3.3. Bluetooth / RFCOMM Connection

1.2.4.3.4. Infrared (IrDA) Connection

1.2.4.3.5. USB Connection

1.2.4.4. The rfcomm_channel Parameter -- Specifying the Channel Number of the RFCOMM Connection between the PC and Mobile Phone

1.2.5. Examples

1.2.5.1. Using Gnokii with Nokia 6021 and Bluetooth on Fedora Core 5

1.2.5.1.1. For Non-AT Mode

1.2.5.1.2. For AT Mode without RFCOMM Connection

1.2.5.1.3. For AT Mode with RFCOMM Connection

1.2.6. Testing Gnokii on Linux

1.2.6.1. Common Causes of Errors

1.2.7. Sending SMS Text Messages with XGnokii on Linux

1.2.8. Receiving SMS Text Messages with XGnokii on Linux

1.2.9. Importing and Exporting Phone Book Entries with XGnokii on Linux



A button for going back to the top of this page