8/2/10

SETTING OR READING THE SERVICE CENTRE ADDRESS / SMSC ADDRESS (AT+CSCA)

To set the service centre address, perform a set operation with the +CSCA AT command using the following syntax: (Optional parameters are enclosed in square brackets.)
+CSCA=address[,address_type]
The address Parameter
The first parameter of the +CSCA AT command, address, specifies the SMSC address to be set. Usually it is a phone number formatted using the typical ISDN / telephony numbering plan (ITU E.164/E.163). For example "+85291234567" Note that the value assigned to the address parameter should be a string, which means you should use double quotes to enclose the phone number.
Reading the Service Centre Address
To read the service centre address, we can perform a read operation using the +CSCA read command "+CSCA?" The information response returned has the following format:
+CSCA: address,address_type
The definition of address and address_type is the same as above.
Example Demonstrating How to Use the +CSCA AT Command to Set and Read the Service Centre Address
As said earlier, sometimes a proper service centre address is in use by default and there is no need to make any changes. So first let's type the read command "+CSCA?" in a terminal program (for example, HyperTerminal in Microsoft Windows) to check if a proper service centre address is in use currently. The response returned from a GSM/GPRS modem or mobile phone should be something like this:
AT+CSCA? +CSCA: "+85291111111",145 OK
If you find that the service centre address is not correct, use the +CSCA AT command to change it, like this:
AT+CSCA="+85290000000",145 OK

The final result code OK indicates the service centre address was set successfully. If the execution of the command line fails, the final result code will be ERROR
SMS AND PDU FORMAT
Introduction

The SMS message, as specified by the ETSI organization (documents GSM 03.40 and GSM 03.38), can be up to 160 characters long, where each character is 7 bits according to the 7-bit default alphabet. Eight-bit messages (max 140 characters) are usually not viewable by the phones as text messages; instead they are used for data in e.g. smart messaging (images and ringing tones) and OTA provisioning of WAP settings. 16-bit messages (max 70 characters) are used for Unicode (UCS2) text messages, viewable by most phones.
The PDU format
The PDU string contains not only the message, but also a lot of meta-information about the sender, his SMS service centre, the time stamp etc. It is all in the form of hexa-decimal octets or decimal semi-octets. The following string is the example for understanding when sending the message containing "hellohello" from http://www.mtn.co.za/.
Table 3
07
917283010010F5
040BC87238880900F10000993092516195800AE8329BFD4697D9EC37
This octet sequence consists of three parts: An initial octet indicating the length of the SMSC information ("07"), the SMSC information itself ("917283010010F5"), and the SMS_DELIVER part (specified by ETSI in GSM03.40). Note: on some phones (e.g. Ericssson 888?) the first three (colored) parts are omitted when showing the message in PDU mode!
35
Table 4
Octet(s)
Description
07
Length of the SMSC information (in this case 7 octets)

Type-of-address of the SMSC. (91 means international format of the phone number)
72 83 01 00 10 F5
Service centre number(in decimal semi-octets). The length of the phone number is odd (11), so a trailing F has been added to form proper octets. The phone number of this service centre is "+27381000015". See below.
04
First octet of this SMS-DELIVER message.
0B
Address-Length. Length of the sender number (0B hex = 11 dec)
C8
Type-of-address of the sender number
72 38 88 09 00 F1
Sender number (decimal semi-octets), with a trailing F
00
TP-PID. Protocol identifier.
00
TP-DCS Data coding scheme
99 30 92 51 61 95 80
TP-SCTS. Time stamp (semi-octets)
0A
TP-UDL. User data length, length of message. The TP-DCS field indicated 7-bit data, so the length here is the number of septets (10). If the TP-DCS field were set to indicate 8-bit data or Unicode, the length would be the number of octets (9).
E8329BFD4697D9EC37
TP-UD. Message "hellohello" , 8-bit octets representing 7-bit data.
All the octets above are hexa-decimal 8-bit octets, except the Service centre number, the sender number and the timestamp; they are decimal semi-octets. The message part in the end of the PDU string consists of hexa-decimal 8-bit octets, but these octets represent 7-bit data. The semi-octets are decimal, and e.g. the sender number is obtained by performing internal swapping within the semi-octets from "72 38 88 09 00 F1" to "27 83 88 90 00 1F". The length of the phone number is odd, so a proper octet sequence cannot be formed by this
36
number. This is the reason why the trailing F has been added. The time stamp, when parsed, equals "99 03 29 15 16 59 08", where the 6 first characters represent date, the following 6 represents time, and the last two represents time-zone related to GMT.
3.6.3.1 PDU FORMAT EXPLANATION
The PDU mode can be understood by the following example. PDU string =
07911326040000F0040B911346610089F60000208062917314080CC8F71D14969741F9 77FD07 .The PDU string is been defined as per this table,
Figure 11
Explanation:
The first octet of the whole PDU data, tells the length of the SMSC (Short Message Service Center). Next octet tells that whether it’s been a local number or an international number. 91
37
is used for international number. Next 6 octets are telling the actual SMSC number. In this example its 13 26 04 00 00 FO (SMSC = 13 26 04 00 00 FO).
Figure 12
Interpreting 8-bit octets as 7-bit messages
This transformation is described in detail in GSM 03.38, and an example of the "hellohello" transformation is shown here. The transformation is based on the 7 bit default alphabet, but an application built on the PDU mode can use any character encoding.
EXAMPLE:
Sending a message in the PDU mode
The following example shows how to send the message "hellohello" in the PDU mode from a Nokia 6110.
AT+CMGF=0 //Set PDU mode
AT+CSMS=0 //Check if modem supports SMS commands
38
AT+CMGS=23 //Send message, 23 octets (excluding the two initial zeros)
>0011000B916407281553F80000AA0AE8329BFD4697D9EC37
There are 23 octets in this message (46 'characters'). The first octet ("00") doesn't count, it is only an indicator of the length of the SMSC information supplied (0). The PDU string consists of the following:
Table 5
Octet(s)
Description
00
Length of SMSC information. Here the length is 0, which means that the SMSC stored in the phone should be used. Note: This octet is optional. On some phones this octet should be omitted! (Using the SMSC stored in phone is thus implicit)
11
First octet of the SMS-SUBMIT message.
00
TP-Message-Reference. The "00" value here lets the phone set the message reference number itself.
TEXT MODE
The Short Message Service is a store and forward service, in other words, short messages are not sent directly from sender to recipient, but always via an SMS Center (SMSC) instead. Each mobile telephone network that supports SMS has one or more messaging centers to handle and manage the short messages. The Short Message Service SMS, as defined within the GSM 900 / 1800 / 1900 digital mobile phone standard has several unique features:
The SMS message, as specified by the ETS1 organization (documents GSM 03.40 and GSM 03.38), can be up to 160 characters long, where each character is 7 bits according to the 7-bit default alphabet. Or 140 characters (8 bit coded) of text in length. Those 140 / 160 characters can comprise of words or numbers or an alphanumeric combination.

1 comment:

  1. Thanks for effort to educate the world. Please I need to know how to send sms direct to another company's (like mtn) smsc. Thanks bonsoirval@gmail.com

    ReplyDelete