22.5. Finding the Message Storage Areas Currently Used, Number of Messages Currently Stored and Maximum Number of Messages Allowed
To find out the message storage areas currently used, the number of messages currently stored in a certain message storage area, and the maximum number of messages that are allowed to be stored in a certain message storage area, you can perform a read operation with the +CPMS AT command using the command line below:
AT+CPMS?
If the GSM/GPRS modem or mobile phone executes the above command line successfully, it will return an information response to the computer / PC. The +CPMS information response has the following format:
+CPMS: message_storage1,used_space1,max_space1,message_storage2,used_space2,max_space2,message_storage3,used_space3,max_space3
The message_storage1 Field
The first field of the information response of the +CPMS AT command, message_storage1, contains a string that indicates the message storage area to be used when reading or deleting SMS messages. (For details about reading SMS messages, see AT commands +CMGR and +CMGL. For details about deleting SMS messages, see the AT command +CMGD.)
The used_space1 Field
The second field of the information response of the +CPMS AT command, used_space1, contains an integer that indicates the number of messages currently stored in the message storage area message_storage1.
The max_space1 Field
The third field of the information response of the +CPMS AT command, max_space1, contains an integer that indicates the maximum number of messages that can be stored in the message storage area message_storage1.
The message_storage2 Field
The fourth field of the information response of the +CPMS AT command, message_storage2, contains a string that indicates the message storage area to be used when sending SMS messages from message storage or writing SMS messages. (For details about sending SMS messages from message storage, see the AT command +CMSS. For details about writing SMS messages, see the AT command +CMGW.)
The used_space2 Field
The fifth field of the information response of the +CPMS AT command, used_space2, contains an integer that indicates the number of messages currently stored in the message storage area message_storage2.
The max_space2 Field
The sixth field of the information response of the +CPMS AT command, max_space2, contains an integer that indicates the maximum number of messages that can be stored in the message storage area message_storage2.
The message_storage3 Field
The seventh field of the information response of the +CPMS AT command, message_storage3, contains a string that indicates the preferred message storage area to be used for storing newly received SMS messages.
The used_space3 Field
The eighth field of the information response of the +CPMS AT command, used_space3, contains an integer that indicates the number of messages currently stored in the message storage area message_storage3.
The max_space3 Field
The ninth field of the information response of the +CPMS AT command, max_space3, contains an integer that indicates the maximum number of messages that can be stored in the message storage area message_storage3.
22.5.1. Example
The example below shows the response returned by my Nokia 6021 mobile phone to Windows' HyperTerminal program after the read command "+CPMS?" has been executed:
AT+CPMS?
+CPMS:
"ME",2,150,"SM",2,10,"MT",4,160
OK
As you can see, there are nine values in the information response of the +CPMS AT command. Following is a description of them.
The First, Second and Third Fields: "ME",2,150
The string value "ME" indicates that the phone message storage area will be used for SMS reading and deleting. The value 2 indicates that there are currently two messages stored in the phone message storage area. 150 is the maximum number of messages that can be stored in the phone message storage area.
The Fourth, Fifth and Sixth Fields: "SM",2,10
The string value "SM" indicates the SIM message storage area will be used for SMS writing and sending. The value 2 tells us that there are currently two messages stored in the SIM message storage area. 10 is the maximum number of messages that can be stored in the SIM message storage area.
The Seventh, Eighth and Ninth Fields: "MT",4,160
The string value "MT" indicates that both the phone message storage area and SIM message storage area will be used for storing inbound SMS messages. The value 4 tells us that there are currently four messages stored in the phone message storage area and SIM message storage area. 160 is the maximum number of messages that can be stored in the phone message storage area and SIM message storage area.
Previous Page | Page 38 of 65 | Next Page |
- 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)
- 27. Appendix A: How to Choose an SMS Service Provider (SMS Gateway Provider, SMS Reseller, SMS Broker)?
- 28. Appendix B: Comparison Table of SMS Service Providers (SMS Gateway Providers, SMS Resellers, SMS Brokers)
- 29. Appendix C: Free Software/Tools and Libraries for Sending and Receiving SMS Messages with a Computer / PC
- 30. Appendix D: GSM 7-bit Default Alphabet Table (with Character Codes of ISO 8859 Latin 1)