Sunday, February 3, 2008

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

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

In general, there are two ways to send SMS messages from a computer / PC to a mobile phone:

1.

Connect a mobile phone or GSM/GPRS modem to a computer / PC. Then use the computer / PC and AT commands to instruct the mobile phone or GSM/GPRS modem to send SMS messages.
2.

Connect the computer / PC to the SMS center (SMSC) or SMS gateway of a wireless carrier or SMS service provider. Then send SMS messages using a protocol / interface supported by the SMSC or SMS gateway.

If you do not want to develop SMS software or applications but just want to use your computer / PC to send text messages, you may want to read our Quick Guide for Non-Developers.


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


Preferences - Do not show ads

The SMS specification has defined a way for a computer to send SMS messages through a mobile phone or GSM/GPRS modem. A GSM/GPRS modem is a wireless modem that works with GSM/GPRS wireless networks. A wireless modem is similar to a dial-up modem. The main difference is that a wireless modem transmits data through a wireless network whereas a dial-up modem transmits data through a copper telephone line. More information about GSM/GPRS modems will be provided in the section "Introduction to GSM / GPRS Wireless Modems". Most mobile phones can be used as a wireless modem. However, some mobile phones have certain limitations comparing to GSM/GPRS modems. This will be discussed in the section "Which is Better: Mobile Phone or GSM / GPRS Modem" later.

To send SMS messages, first place a valid SIM card from a wireless carrier into a mobile phone or GSM/GPRS modem, which is then connected to a computer. There are several ways to connect a mobile phone or GSM/GPRS modem to a computer. For example, they can be connected through a serial cable, a USB cable, a Bluetooth link or an infrared link. The actual way to use depends on the capability of the mobile phone or GSM/GPRS modem. For example, if a mobile phone does not support Bluetooth, it cannot connect to the computer through a Bluetooth link.

After connecting a mobile phone or GSM/GPRS modem to a computer, you can control the mobile phone or GSM/GPRS modem by sending instructions to it. The instructions used for controlling the mobile phone or GSM/GPRS modem are called AT commands. (AT commands are also used to control dial-up modems for wired telephone system.) Dial-up modems, mobile phones and GSM/GPRS modems support a common set of standard AT commands. In addition to this common set of standard AT commands, mobile phones and GSM/GPRS modems support an extended set of AT commands. One use of the extended AT commands is to control the sending and receiving of SMS messages.

The following table lists the AT commands that are related to the writing and sending of SMS messages:


AT command


Meaning

+CMGS


Send message

+CMSS


Send message from storage

+CMGW


Write message to memory

+CMGD


Delete message

+CMGC


Send command

+CMMS


More messages to send


One way to send AT commands to a mobile phone or GSM/GPRS modem is to use a terminal program. A terminal program's function is like this: It sends the characters you typed to the mobile phone or GSM/GPRS modem. It then displays the response it receives from the mobile phone or GSM/GPRS modem on the screen. The terminal program on Microsoft Windows is called HyperTerminal. More details about the use of Microsoft HyperTerminal can be found in the "How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem" section of this SMS tutorial.

Below shows a simple example that demonstrates how to use AT commands and the HyperTerminal program of Microsoft Windows to send an SMS text message. The lines in bold type are the command lines that should be entered in HyperTerminal. The other lines are responses returned from the GSM / GPRS modem or mobile phone.


AT
OK
AT+CMGF=1
OK
AT+CMGW="+85291234567"
> A simple demo of SMS text messaging.
+CMGW: 1

OK
AT+CMSS=1
+CMSS: 20

OK


Here is a description of what is done in the above example:

*

Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code "OK" (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.
*

Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code "OK" is returned (line 4), which indicates the command line "AT+CMGF=1" has been executed successfully. If the result code "ERROR" is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0,1)" (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is "+CMGF: (0)", then SMS text mode is not supported.
*

Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. "+85291234567" is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message "A simple demo of SMS text messaging.". When finished, press Ctrl+z of the keyboard.
*

Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.
*

Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful.
*

Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. "1" is the index of the SMS text message obtained from line 7.
*

Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20.
*

Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successful.

To send SMS messages from an application, you have to write the source code for connecting to and sending AT commands to the mobile phone or GSM/GPRS modem, just like what a terminal program does. You can write the source code in C, C++, Java, Visual Basic, Delphi or other programming languages you like. However, writing your own code has a few disadvantages:

*

You have to learn how to use AT commands.
*

You have to learn how to compose the bits and bytes of an SMS message. For example, to specify the character encoding (e.g. 7-bit encoding and 16-bit Unicode encoding) of an SMS message, you need to know which bits in the message header should be modified and what value should be assigned.
*

Sending SMS messages with a mobile phone or GSM/GPRS modem has a drawback -- the SMS transmission speed is low. As your SMS messaging application becomes more popular, it has to handle a larger amount of SMS traffic and finally the mobile phone or GSM/GPRS modem will not be able to take the load. To obtain a high SMS transmission speed, a direct connection to an SMSC or SMS gateway of a wireless carrier or SMS service provider is needed. However, AT commands are not used for communicating with an SMS center or SMS gateway. This means your have to make a big change to your SMS messaging application in order to move from a wireless-modem-based solution to a SMSC-based solution.

In most cases, instead of writing your own code for interacting with the mobile phone or GSM/GPRS modem via AT commands, a better solution is to use a high-level SMS messaging API (Application programming interface) / SDK (Software development kit) / library. The API / SDK / library encapsulates the low-level details. So, an SMS application developer does not need to know AT commands and the composition of SMS messages in the bit-level. Some SMS messaging APIs / SDKs / libraries support SMSC protocols in addition to AT commands. To move from a wireless-modem-based SMS solution to a SMSC-based SMS solution, usually you just need to modify a configuration file / property file or make a few changes to your SMS messaging application's source code.


Preferences - Do not show ads

The links to some open source and free SMS messaging libraries can be found in the article "Free Libraries/Tools for Sending/Receiving SMS with a Computer".

Another way to hide the low-level AT command layer is to place an SMS gateway between the SMS messaging application and the mobile phone or GSM/GPRS modem. (This has been described in the section "What is an SMS Gateway?" earlier.) Simple protocols such as HTTP / HTTPS can then be used for sending SMS messages in the application. If an SMSC protocol (e.g. SMPP, CIMD, etc) is used for communicating with the SMS gateway instead of HTTP / HTTPS, an SMS messaging API / SDK / library can be very helpful to you since it encapsulates the SMSC protocol's details.

Usually a list of supported / unsupported mobile phones or wireless modems is provided on the web site of an SMS messaging API / SDK / library or an SMS gateway software package. Remember to check the list if you are going to use an SMS messaging API / SDK / library or an SMS gateway software package.


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

Using a mobile phone or GSM/GPRS modem to send SMS messages has a major drawback, that is the SMS sending rate is too low. Only 6-10 SMS messages can be sent per minute (when the "SMS over GSM" mode is used). The performance is not affected by the connection between the computer and the mobile phone or GSM/GPRS modem (i.e. the SMS sending rate is about the same no matter the mobile phone or GSM/GPRS modem is connected to the computer through a serial cable, USB cable, Bluetooth link or infrared link) and does not depend on whether a mobile phone or GSM/GPRS modem is used (i.e. the SMS sending rate is about the same no matter a mobile phone or a GSM/GPRS modem is used). The determining factor for the SMS sending rate is the wireless network.


Page 10 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

9. What is an SMS Gateway?

9. What is an SMS Gateway?


Preferences - Do not show ads

One problem of SMS messaging is that SMSCs developed by different companies use their own communication protocol and most of these protocols are proprietary. For example, Nokia has an SMSC protocol called CIMD whereas another SMSC vendor, CMG, has an SMSC protocol called EMI. We cannot connect two SMSCs if they do not support a common SMSC protocol. To deal with this problem, an SMS gateway is placed between two SMSCs. This is illustrated in the following figure. The SMS gateway acts as a relay between the two SMSCs. It translates one SMSC protocol to another one. This way can be used by two different wireless carriers to interconnect their SMSCs for purposes such as enabling the exchange of inter-operator SMS messages.


Figure 1. An SMS gateway acts as a relay between two SMS centers.




Besides wireless carriers, content providers and SMS application developers may also find an SMS gateway useful. Let's consider the following situation. Suppose you are the developer of an SMS text messaging application. To send and receive SMS text messages on your server, one way is to connect to the SMSCs of the wireless carriers. Different wireless carriers may use SMSCs from different vendors, which means your SMS text messaging application may need to support multiple SMSC-specific protocols. (This is illustrated in the following figure). As a result, the SMS text messaging application's complexity and development time increases.


Figure 2. An SMS text messaging application connects to SMSCs without an SMS gateway.




To deal with the above problem, an SMS gateway can be set up to handle the connections to the SMSCs. Now the SMS text messaging application only needs to know how to connect to the SMS gateway. To support more SMSCs, you just need to modify the settings of the SMS gateway. No change to the source code of the SMS text messaging application is required. The use of an SMS gateway can greatly shorten the SMS text messaging application's development time.

To connect to an SMS gateway, you can use an SMSC protocol such as SMPP and CIMD. Some SMS gateways support an HTTP / HTTPS interface. HTTP / HTTPS is easier to use than SMSC protocols. The drawback is that there may be fewer SMS features to use. For example, an SMS gateway may not support the sending of picture messages through the HTTP / HTTPS interface.


Figure 3. An SMS text messaging application connects to SMSCs through an SMS gateway.





Preferences - Do not show ads

Besides using a direct connection to the SMSC of a wireless carrier, another way to send and receive SMS text messages on a computer is to use a mobile phone or GSM/GPRS modem. To do this, your SMS text messaging application has to know how to communicate with the mobile phone or GSM/GPRS modem using AT commands.

Some SMS gateways are capable of handling the connections to mobile phones and GSM/GPRS modems. To send and receive SMS text messages with a mobile phone or GSM/GPRS modem, the SMS text messaging application only needs to know how to talk to the SMS gateway and does not need to know anything about AT commands. More details about GSM/GPRS modems and AT commands will be provided in later sections of this SMS tutorial.


Figure 4. An SMS text messaging application connects to a pool of mobile phones or GSM/GPRS modems through an SMS gateway.




9.1. Open Source and Free SMS Gateway Software

As you can see in the above sections, an SMS gateway has a lot of responsibilities in an SMS messaging system. So, SMS gateway software can be very complex and complex software is usually expensive. Fortunately, there are open source SMS gateway software packages that can be downloaded free of charge over the web. One high-quality free SMS gateway software package is Kannel, which is written in the C programming language. Kannel can handle connections to SMSCs, mobile phones and GSM/GPRS modems. It has an HTTP / HTTPS interface for the sending and receiving of SMS messages. More information about Kannel can be found on its web site http://www.kannel.org/.


Page 9 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

8. International SMS Messages

8. International SMS Messages


Preferences - Do not show ads

Inter-operator SMS messages can be further divided into two categories -- local inter-operator SMS messages and international inter-operator SMS messages (international SMS messages). A local inter-operator SMS message is an SMS message that is sent from one wireless network operator to another wireless network operator in the same country, while an international SMS message is an SMS message that is sent from a wireless network operator in one country to a wireless network operator in another country.

Usually the cost for sending an international SMS message from a mobile phone is higher than that for sending a local inter-operator SMS message. Hence, the cost for sending an intra-operator SMS message <= the cost for sending a local inter-operator SMS message <= the cost for sending an international SMS message.

The interoperability of SMS messaging between two wireless networks locally and even internationally is undoubtedly a main factor that contributes to the success of SMS worldwide.


Page 8 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

7. Inter-operator SMS Messages

7. Inter-operator SMS Messages


Preferences - Do not show ads

Suppose you and your friend are using the mobile phone service of wireless network operator A and wireless network operator B respectively. The transmission of an SMS message from you to your friend involves two wireless networks. This SMS message is called an inter-operator SMS message.

Typically, the cost for sending an inter-operator SMS message from a mobile phone is higher than that for sending an intra-operator SMS message.


7.1. Transmission Process of Inter-operator SMS Messages

The transmission of an inter-operator SMS message involves one or more SMS centers. Generally, there are two different ways for the transmission of inter-operator SMS messages. In the first way, signaling interconnections are set up between two wireless networks. When the originator SMS center receives an inter-operator SMS message, it gets the routing information from the recipient wireless network and delivers the SMS message to the recipient mobile phone directly. The following figure illustrates the transmission process:





The first way can be used if the two wireless networks involved in the transmission of the inter-operator SMS message are based on similar technologies. However, if this is not true, the second way has to be used. For example, when an SMS message is sent from a GSM network to a CDMA network. In the second way, the originator SMS center and the recipient SMS center are interconnected through an SMS gateway or with a communication protocol that is supported by both SMS centers. The SMS message first reaches the originator SMS center, which will then forward the SMS message towards the recipient SMS center. The recipient SMS center will be responsible for sending the SMS message to the recipient mobile phone and storing the SMS message if the recipient mobile phone is offline. The following figure illustrates the transmission process:





Page 7 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

6. Intra-operator SMS Messages

6. Intra-operator SMS Messages


Preferences - Do not show ads

If both you and your friend are using the mobile phone service of the same wireless network operator, the transmission of an SMS message from you to your friend will involve only one wireless network operator. This SMS message is called an intra-operator SMS message.

Typically, the cost for sending an intra-operator SMS message from a mobile phone is lower than that for sending other kinds of SMS messages such as inter-operator SMS messages. Some wireless network operators allow their subscribers to send unlimited intra-operator SMS messages free of charge.


6.1. Transmission Process of Intra-operator SMS Messages

The transmission of an intra-operator SMS message involves only one SMS center. After leaving the sender, the intra-operator SMS message reaches the SMS center. The SMS center then delivers the SMS message to the recipient mobile phone. If the recipient mobile phone is offline, the SMS center stores the SMS message. It will deliver the SMS message when the recipient mobile phone is online. If the SMS message's validity period expires and the recipient mobile phone is still offline, the SMS center will remove the SMS message.

When the SMS center receives the message delivery report from the recipient mobile phone or removes the SMS message (for example, when the validity period expires), it sends a status report to the sender if the sender requested one earlier.

The following figure illustrates the transmission process of an intra-operator SMS message:





Page 6 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

5. Basic Concepts of SMS Technology

5. Basic Concepts of SMS Technology

In the following sections, we will introduce to you some basic concepts of the SMS technology.


5.1. Validity Period of an SMS Message


Preferences - Do not show ads

An SMS message is stored temporarily in the SMS center if the recipient mobile phone is offline. It is possible to specify the period after which the SMS message will be deleted from the SMS center so that the SMS message will not be forwarded to the recipient mobile phone when it becomes online. This period is called the validity period.

Here is an example that illustrates how validity period can be used. Suppose you find a very interesting program that is showing on TV now. You think your friend may want to watch it. So, you send a text message to tell your friend about the TV program. Let's say the TV program lasts for an hour. Your SMS text message will not be useful to your friend if his mobile phone is not available before the program finishes. In this situation, you may want to send a text message with a validity period of one hour to your friend. The wireless carrier will not deliver the SMS text message to your friend if his mobile phone is not available before the validity period ends.

A mobile phone should have a menu option that can be used to set the validity period. After setting it, the mobile phone will include the validity period in the outbound SMS messages automatically.


5.2. Message Status Reports

Sometimes you may want to know whether an SMS message has reached the recipient mobile phone successfully. To get this information, you need to set a flag in the SMS message to notify the SMS center that you want a status report about the delivery of this SMS message. The status report is sent to you in the form of an SMS message.

A mobile phone should have a menu option that can be used to set whether the status report feature is on or off. After setting it, the mobile phone will set the corresponding flag in the outbound SMS messages for you automatically. The status report feature is turned off by default on most mobile phones and GSM / GPRS modems.


5.3. Message Submission Reports

After leaving the mobile phone, an SMS message goes to the SMS center. When it reaches the SMS center, the SMS center will send back a message submission report to the mobile phone to inform whether there are any errors or failures (e.g. incorrect SMS message format, busy SMS center, etc). If there is no error or failure, the SMS center sends back a positive submission report to the mobile phone. Otherwise it sends back a negative submission report to the mobile phone. The mobile phone may then notify the user that the message submission was failed and what caused the failure.

If the mobile phone does not receive the message submission report after a period of time, it concludes that the message submission report has been lost. The mobile phone may then re-send the SMS message to the SMS center. A flag will be set in the new SMS message to inform the SMS center that this SMS message has been sent before. If the previous message submission was successful, the SMS center will ignore the new SMS message but send back a message submission report to the mobile phone. This mechanism prevents the sending of the same SMS message to the recipient multiple times.

Sometimes the message submission report mechanism is not used and the acknowledgement of message submission is done in a lower layer.


5.4. Message Delivery Reports

After receiving an SMS message, the recipient mobile phone will send back a message delivery report to the SMS center to inform whether there are any errors or failures (example causes: unsupported SMS message format, not enough storage space, etc). This process is transparent to the mobile user. If there is no error or failure, the recipient mobile phone sends back a positive delivery report to the SMS center. Otherwise it sends back a negative delivery report to the SMS center.

If the sender requested a status report earlier, the SMS center sends a status report to the sender when it receives the message delivery report from the recipient.

If the SMS center does not receive the message delivery report after a period of time, it concludes that the message delivery report has been lost. The SMS center then re-sends the SMS message to the recipient.

Sometimes the message delivery report mechanism is not used and the acknowledgement of message delivery is done in a lower layer.


Page 5 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

4. What is an SMS Center / SMSC?

4. What is an SMS Center / SMSC?


Preferences - Do not show ads

An SMS center (SMSC) is responsible for handling the SMS operations of a wireless network. When an SMS message is sent from a mobile phone, it will reach an SMS center first. The SMS center then forwards the SMS message towards the destination. An SMS message may need to pass through more than one network entity (e.g. SMSC and SMS gateway) before reaching the destination. The main duty of an SMSC is to route SMS messages and regulate the process. If the recipient is unavailable (for example, when the mobile phone is switched off), the SMSC will store the SMS message. It will forward the SMS message when the recipient is available.

Very often an SMSC is dedicated to handle the SMS traffic of one wireless network. A network operator usually manages its own SMSC(s) and locates them inside its wireless network system. However, it is possible for a network operator to use a third-party SMSC that is located outside the wireless network system.

You must know the address of the wireless network operator's SMSC in order to use SMS messaging with your mobile phone. Typically an SMSC address is an ordinary phone number in the international format. A mobile phone should have a menu option that can be used to configure the SMSC address. Normally, the SMSC address is pre-set in the SIM card by the wireless network operator, which means you do not need to make any changes to it.


Page 4 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

3.1. Person-to-Person Text Messaging

3. Example Applications of SMS Messaging


Preferences - Do not show ads

There are many different kinds of SMS applications on the market today and many others are being developed. Applications in which SMS messaging can be utilized are virtually unlimited. We will describe some common examples of SMS applications below to give you some ideas of what can be done with SMS messaging.


3.1. Person-to-Person Text Messaging

Person-to-person text messaging is the most commonly used SMS application and it is what the SMS technology was originally designed for. In these kinds of text messaging applications, a mobile user types an SMS text message using the keypad of his/her mobile phone, then he/she inputs the mobile phone number of the recipient and clicks a certain option on the screen, such as "Send" or "OK", to send the text message out. When the recipient mobile phone receives the SMS text message, it will notify the user by giving out a sound or vibrating. The user can read the SMS text message some time later or immediately and can send a text message back if he/she wants.

A chat application is another kind of person-to-person text messaging application that allows a group of people to exchange SMS text messages interactively. In a chat application, all SMS text messages sent and received are displayed on the mobile phone's screen in order of date and time. SMS text messages written by different mobile users may be displayed in different colors for better readability, like this:


Me: Let's have a meeting at 10 am tomorrow to discuss the details of our next SMS text messaging application.

Tom: OK.

Alan: I have another meeting at 10 am. I suggest having the meeting at 11:30 am tomorrow. What do you think?



3.2. Provision of Information

A popular application of the SMS technology other than person-to-person text messaging is the provision of information to mobile users. Many content providers make use of SMS text messages to send information such as news, weather report and financial data to their subscribers. Many of these information services are not free. Reverse billing SMS is a common way used by content providers to bill their users. The user is charged a certain fee for each reverse billing SMS message received. The fee will either be included in the monthly mobile phone bill or be deducted from prepaid card credits.


3.3. Downloading

SMS messages can carry binary data and so SMS can be used as the transport medium of wireless downloads. Objects such as ringtones, wallpapers, pictures and operator logos can be encoded in one or more SMS messages depending on the object's size. Like information services, wireless download services are usually not free and reverse billing SMS is a common way used by content providers to bill their customers. The object to be downloaded is encoded in one or more reverse billing SMS messages. The mobile user who requests the object will be charged a certain fee for each reverse billing SMS message received. If the mobile user is using a monthly mobile phone service plan, the download fee will be included in his/her next monthly bill; if the mobile user is using a prepaid SIM card, the download fee will be deducted from the prepaid credits.


3.4. Alerts and Notifications

SMS is a very suitable technology for delivering alerts and notifications of important events. This is because of two reasons:

1.

A mobile phone is a device that is carried by its owner most of the time. Whenever an SMS text message is received, the mobile phone will notify you by giving out a sound or by vibrating. You can check what the SMS text message contains immediately.
2.

SMS technology allows the "push" of information. This is different from the "pull" model where a device has to poll the server regularly in order to check whether there is any new information. The "pull" model is less suitable for alert and notification applications, since it wastes bandwidth and increases server load.

Some common examples of SMS alert and notification applications are described below.


3.4.1. Email, Fax and Voice Message Notifications

In an email notification system, a server sends a text message to the user's mobile phone whenever an email arrives at the inbox. The SMS text message can include the sender's email address, the subject and the first few lines of the email body. An email notification system may allow the user to customize various filters so that an SMS alert is sent only if the email message contains certain keywords or if the email sender is an important person. The use cases for fax or voice message are similar.


3.4.2. E-commerce and Credit Card Transaction Alerts

Whenever an e-commerce or credit card transaction is made, the server sends a text message to the user's mobile phone. The user can know immediately whether any unauthorized transactions have been made.


3.4.3. Stock Market Alerts

In a stock market alert application, a program is constantly monitoring and analyzing the stock market. If a certain condition is satisfied, the program will send a text message to the user's mobile phone to notify him/her of the situation. For example, you can configure the alert system such that if the stock price of a company is lower than a certain value or drops by a certain percentage, it will send an SMS alert to you.


3.4.4. Remote System Monitoring

In a remote system monitoring application, a program (sometimes with the help of a group of sensors) is constantly monitoring the status of a remote system. If a certain condition is satisfied, the program will send a text message to the system administrator to notify him/her of the situation. For example, a program may be written to "ping" a server regularly. If no response is received from the server, the program can send an SMS alert to the system administrator to notify him/her that the server may be hanged.


3.5. Two-way Interactive Text Messaging Applications


Preferences - Do not show ads

SMS messaging technology can be used as the underlying communication medium between wireless devices and servers in a two-way interactive text messaging application. For example, search engines are two-way interactive text messaging applications. Let's say there is a dictionary search engine that supports queries in SMS text messages. It may operate like this:

*

To find out the meaning of the term "SMS text messaging", you can type "find: SMS text messaging" in an SMS text message and send it to the search engine's phone number. After receiving your SMS text message, the search engine parses it and finds that it begins with the command "find" and follows by the words "SMS text messaging". The search engine then knows you want to find out the meaning of the term "SMS text messaging". So, it sends a text message, which contains the meaning of the term "SMS text messaging", back to your mobile phone.
*

If the search result is very long and it cannot contain within a single SMS text message, the search engine adds "Page 1 of 2", "Page 1 of 3", etc, at the end of the reply SMS text message. The search engine also creates a session using your mobile phone number as the session ID and stores the term that you searched for (i.e. "SMS text messaging") in the session object.
*

To request the second page, you can send a text message with the content "page: 2" to the search engine's phone number. After receiving your SMS text message, the search engine parses it and finds that it begins with the command "page" and follows by "2". The search engine then knows you want the second page of the search result. It retrieves the term that you searched for last time from the session object and finds that it is "SMS text messaging". The search engine then sends a text message that contains the second page of the search result for the term "SMS text messaging" back to your mobile phone.

Many other two-way interactive text messaging applications can be built using a similar way. For example, a company may want to build an SMS messaging application to enable its employees to query the corporate database while they are working outdoors.


3.6. SMS Marketing

SMS messaging can be used as a marketing tool. An example is an SMS newsletter system. After signing up, the user will receive SMS text messages about the latest discounts and products of the company. If the user has any questions or comments, he/she can send a text message back with the questions or comments in it. The company may include its phone number in the SMS newsletter so that the user can talk to the customer service staff directly if he/she wants to do so.


Page 3 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

2. What Makes SMS Messaging So Successful Worldwide?

2. What Makes SMS Messaging So Successful Worldwide?


Preferences - Do not show ads

SMS is a success all over the world. The number of SMS messages exchanged every day is enormous. SMS messaging is now one of the most important revenue sources of wireless carriers. What is so special about SMS that makes it so popular worldwide? Some of the reasons are discussed below.


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

Nowadays, almost every person has a mobile phone and carries it most of the time. With a mobile phone, you can send and read SMS messages at any time, no matter you are in your office, on a bus or at home.


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

Unlike a phone call, you can send an SMS message to your friend even when he/she has not switched on the mobile phone or when he/she is in a place where the wireless signal is temporarily unavailable. The SMS system of the mobile network operator will store the SMS message and later send it to your friend when his/her mobile phone is online.


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

Unlike a phone call, you do not need to read or reply an SMS message immediately. Besides, writing and reading SMS messages do not make any noise. While you have to run out of a theater or library to answer a phone call, you do not need to do so if SMS messaging is used.


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

SMS messaging is a very mature technology. All GSM mobile phones support it. Not only that you can exchange SMS messages with mobile users of the same wireless carrier, but you can also exchange SMS messages with mobile users of many other wireless carriers worldwide.


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

Here are some of the reasons that make SMS a suitable technology for wireless applications to build on:

*

Firstly, SMS messaging is supported by 100% GSM mobile phones. Building wireless applications on top of the SMS technology can maximize the potential user base.
*

Secondly, SMS messages are capable of carrying binary data besides text. They can be used to transfer ringtones, pictures, operator logos, wallpapers, animations, VCards, VCals (calendar entries), etc.
*

Thirdly, SMS supports reverse billing, which enables payment to be made conveniently. For example, suppose you want to develop a commercial ringtone download application that charges a fee from the user for each ringtone downloaded. One way to accept payment is to use a reverse billing phone number obtained from a wireless carrier. To buy a ringtone, the user will write an ordinary SMS text message that contains the ID of the ringtone he/she wants to buy and send it to your SMS application's reverse billing phone number. Your SMS application will then send back one or more reverse billing SMS messages that carry the ringtone. The user will be charged a fee for the reverse billing SMS messages he/she received. The fee will be included in the user's monthly mobile phone bill or be deducted from his/her prepaid card credits. Depending on the agreement between you and the wireless carrier, all or part of the money received will be given to you.


Page 2 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

1. Introduction to SMS Messaging

1. Introduction to SMS Messaging


1.1. What is SMS (Short Message Service)?


Preferences - Do not show ads

SMS stands for Short Message Service. It is a technology that enables the sending and receiving of messages between mobile phones. SMS first appeared in Europe in 1992. It was included in the GSM (Global System for Mobile Communications) standards right at the beginning. Later it was ported to wireless technologies like CDMA and TDMA. The GSM and SMS standards were originally developed by ETSI. ETSI is the abbreviation for European Telecommunications Standards Institute. Now the 3GPP (Third Generation Partnership Project) is responsible for the development and maintenance of the GSM and SMS standards.

As suggested by the name "Short Message Service", the data that can be held by an SMS message is very limited. One SMS message can contain at most 140 bytes (1120 bits) of data, so one SMS message can contain up to:

*

160 characters if 7-bit character encoding is used. (7-bit character encoding is suitable for encoding Latin characters like English alphabets.)
*

70 characters if 16-bit Unicode UCS2 character encoding is used. (SMS text messages containing non-Latin characters like Chinese characters should use 16-bit character encoding.)

SMS text messaging supports languages internationally. It works fine with all languages supported by Unicode, including Arabic, Chinese, Japanese and Korean.

Besides text, SMS messages can also carry binary data. It is possible to send ringtones, pictures, operator logos, wallpapers, animations, business cards (e.g. VCards) and WAP configurations to a mobile phone with SMS messages.

One major advantage of SMS is that it is supported by 100% GSM mobile phones. Almost all subscription plans provided by wireless carriers include inexpensive SMS messaging service. Unlike SMS, mobile technologies such as WAP and mobile Java are not supported on many old mobile phone models.


1.2. Concatenated SMS Messages / Long SMS Messages

One drawback of the SMS technology is that one SMS message can only carry a very limited amount of data. To overcome this drawback, an extension called concatenated SMS (also known as long SMS) was developed. A concatenated SMS text message can contain more than 160 English characters. Concatenated SMS works like this: The sender's mobile phone breaks down a long message into smaller parts and sends each of them as a single SMS message. When these SMS messages reach the destination, the recipient mobile phone will combine them back to one long message.

The drawback of concatenated SMS is that it is less widely supported than SMS on wireless devices.


1.3. EMS (Enhanced Messaging Service)

Besides the data size limitation, SMS has another major drawback -- an SMS message cannot include rich-media content such as pictures, animations and melodies. EMS (Enhanced Messaging Service) was developed in response to this. It is an application-level extension of SMS. An EMS message can include pictures, animations and melodies. Also, the formatting of the text inside an EMS message is changeable. For example, the message sender can specify whether the text in an EMS message should be displayed in bold or italic, with a large font or a small font.

The drawback of EMS is that it is less widely supported than SMS on wireless devices. Also, many EMS-enabled wireless devices only support a subset of the features defined in the EMS specification. A certain EMS feature may be supported on one wireless device but not on the other.


Page 1 of 65 Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

AT Commands

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

The SMS specification has defined two modes in which a GSM/GPRS modem or mobile phone can operate. They are called SMS text mode and SMS PDU mode. (PDU stands for Protocol Data Unit.) The mode that a GSM/GPRS modem or mobile phone is operating in determines the syntax of some SMS AT commands and the format of the responses returned after execution. Below are the SMS AT commands affected:

*

+CMGS (Send Message)
*

+CMSS (Send Message from Storage)
*

+CMGR (Read Message)
*

+CMGL (List Messages)
*

+CMGW (Write Message to Memory)
*

+CNMA (New Message Acknowledgement to ME/TA)
*

+CMGC (Send Command)

The syntax of the unsolicited result codes below also depends on the mode in which the GSM/GPRS modem or mobile phone is operating:

*

+CMT (Used to forward received SMS messages to the computer / PC.)
*

+CBM (Used to forward received cell broadcast messages to the computer / PC.)
*

+CDS (Used to forward received status reports to the computer / PC.)

These two AT commands are useful to you only if SMS text mode is used:

*

+CSMP (Set Text Mode Parameters)
*

+CSDH (Show Text Mode Parameters)


20.1. Comparison of SMS Text Mode and SMS PDU Mode

Below we compare SMS text mode and SMS PDU mode from various aspects. The comparison should help you learn the differences between these two modes and decide which mode should be used by your SMS messaging application.


Syntax of SMS AT Commands and Responses

When the GSM/GPRS modem or mobile phone is operating in different modes, the syntax of certain SMS AT commands and the responses returned after command execution is different. Here's an example for illustration. Let's say you would like to send the SMS message "It is easy to send text messages." to the mobile phone number +85291234567. In SMS text mode, this is the command line that you should enter:


AT+CMGS="+85291234567"It is easy to send text messages.


However, if the GSM/GPRS modem or mobile phone is operating in SMS PDU mode, executing the above command line will cause an error to occur. This is because the syntax of the +CMGS AT command is different in SMS PDU mode. To do the same task, the following command line should be used instead:


AT+CMGS=4207915892000000F001000B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


Defined Values for Certain Parameters

When the GSM/GPRS modem or mobile phone is operating in different modes, the defined values for certain parameters are different. Usually string values are defined for text mode while numeric values are defined for PDU mode. For example, the +CMGL AT command is used to list SMS messages stored in message storage. It takes one parameter that specifies the status of the SMS messages to be retrieved. The following table lists the defined values for the parameter in text mode and PDU mode:


Message status


Defined values in text mode


Defined values in PDU mode

Received unread


"REC UNREAD"


0

Received read


"REC READ"


1

Stored unsent


"STO UNSENT"


2

Stored sent


"STO SENT"


3

All messages


"ALL"


4


Suppose you would like to list all SMS messages from message storage. If the GSM/GPRS modem or mobile phone is operating in SMS text mode, you should assign the string value "ALL" to the +CMGL AT command, like this:


AT+CMGL="ALL"


In SMS PDU mode, the numeric value 4 should be assigned to the +CMGL AT command instead:


AT+CMGL=4


Input/Output Format of SMS Messages Used by SMS AT Commands

When the GSM/GPRS modem or mobile phone is operating in different modes, the input/output format of SMS messages used by SMS AT commands is different. In SMS text mode, headers and body of SMS messages are inputted/outputted as separate parameters/fields. In SMS PDU mode, TPDUs (Transport Protocol Data Units) in hexadecimal format are inputted and outputted. Headers and body of SMS messages are encoded in the TPDUs.

Here is an example for illustration. To send the SMS message "It is easy to send text messages." to the mobile phone number +85291234567, the following command line should be used in SMS text mode. As you can see below, the destination phone number header and message body are provided to the +CMGS AT command as separate parameters.


AT+CMGS="+85291234567"It is easy to send text messages.


To send the same SMS text message in SMS PDU mode, the following command line should be used instead. The message body, destination phone number header and some other headers are encoded in the hexadecimal sequence.


AT+CMGS=4207915892000000F001000B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E



Preferences - Do not show ads

Ease of Use

As you can see in the previous example, it is easier to use AT commands in SMS text mode. You do not have to learn about the structure of different types of TPDUs in the bit level and the encoding and decoding of the hexadecimal sequence.


Supported Features of SMS Messaging

Although it is easier to use AT commands in SMS text mode, it supports fewer features of SMS messaging than SMS PDU mode. This is because you do not have complete control over the header values and message body in SMS text mode. Some tasks, although can be done in text mode, require the programmer to have knowledge about PDU mode and TPDU. For example, to request a status report from SMSC in SMS text mode, you have to set bit 5 of the first octet of the SMS-SUBMIT TPDU to 1 by the AT command +CSMP (command name in text: Set Text Mode Parameters). Similar tasks include setting the message validity period and sending a flash SMS message that immediately pops up on the phone screen when it arrives at the destination.


Level of Support

SMS PDU mode is more commonly supported by GSM/GPRS modems and mobile phones than SMS text mode.


Page 33 of 65 Previous Page | Next Page
Table of Contents
Contents at a Glance

* 1. Introduction to SMS Messaging
* 2. What Makes SMS Messaging So Successful Worldwide?
* 3. Example Applications of SMS Messaging
* 4. What is an SMS Center / SMSC?
* 5. Basic Concepts of SMS Technology
* 6. Intra-operator SMS Messages
* 7. Inter-operator SMS Messages
* 8. International SMS Messages
* 9. What is an SMS Gateway?
* 10. How to Send SMS Messages from a Computer / PC?
* 11. How to Receive SMS Messages Using a Computer / PC?
* 12. Introduction to GSM / GPRS Wireless Modems
* 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
* 14. Introduction to AT Commands
* 15. General Syntax of Extended AT Commands
* 16. Result Codes of AT Commands
* 17. AT Command Operations: Test, Set, Read and Execution
* 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
* 20. Operating Mode: SMS Text Mode and SMS PDU Mode
* 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
* 22. Preferred Message Storage (AT+CPMS)
* 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
* 24. Deleting SMS Messages from Message Storage (AT+CMGD)
* 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
* 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)

Print this Web Page | Email Your Friends | Back to Top
Google Enter your search terms Submit search form

Web DevelopersHome.com

Feedback Form (ExpandCollapse)

What do you think about this web page?
It is very helpful.
It is helpful, but some information I wanted is missing.
It is not helpful.
It has broken links.
It has typos / grammatical mistakes.
It has incorrect information.
Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.

SMS Tutorial Table of Contents SMS Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page

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.

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


Preferences - Do not show ads

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.

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

Requirements

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

Introduction

Installing the Modem Driver of a Mobile Phone on a PC

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

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

Sending SMS Text Messages with SMS Sender

Sending SMS Text Messages in Other Languages

Logging SMS Text Messages Sent

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.

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

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

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

Introduction

Mobile Phone Models Supported by Gnokii

Installing Gnokii / XGnokii

Installing Gnokii / XGnokii on Linux

Installing Gnokii's gnapplet on Symbian OS

Configuring Gnokii / XGnokii on Linux

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

Serial Connection (RS-232 Connection)

Bluetooth / RFCOMM Connection

Infrared (IrDA) Connection

USB Connection

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

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

AT Command Mode

Serial Connection (RS-232 Connection)

Bluetooth / RFCOMM Connection

Infrared (IrDA) Connection

USB Connection

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

Examples

Using Gnokii with Nokia 6021 and Bluetooth on Fedora Core 5

For Non-AT Mode

For AT Mode without RFCOMM Connection

For AT Mode with RFCOMM Connection

Testing Gnokii on Linux

Common Causes of Errors

Sending SMS Text Messages with XGnokii on Linux

Receiving SMS Text Messages with XGnokii on Linux

Importing and Exporting Phone Book Entries with XGnokii on Linux


Disclaimer Notice

We have made an effort to ensure the accuracy of information available on this web site. However, we do not warrant the correctness of these materials and assume no responsibility for errors or omissions in these materials. Please refer to Terms of Use for the details before using this web site.