3 Text Mode

27.0053GPPRelease 17TSUse of Data Terminal Equipment - Data Circuit terminating Equipment (DTE - DCE) interface for Short Message Service (SMS) and Cell Broadcast Service (CBS)

3.1 Parameter Definitions

The following parameters are used in the subsequent clauses which describe all commands. The formats of integer and string types referenced here are defined in V.25ter. The default values are for command parameters, not for result code parameters.

Message Storage Parameters

<index> integer type; value in the range of location numbers supported by the associated memory

<mem1> string type; memory from which messages are read and deleted (commands List Messages +CMGL, Read Message +CMGR and Delete Message +CMGD); defined values (others are manufacturer specific):

"BM" broadcast message storage

"ME" ME message storage

"MT" any of the storages associated with ME

"SM" (U)SIM message storage

"TA" TA message storage

"SR" status report storage

<mem2> string type; memory to which writing and sending operations are made (commands Send Message from Storage +CMSS and Write Message to Memory +CMGW) ); refer <mem1> for defined values

<mem3> string type; memory to which received SMs are preferred to be stored (unless forwarded directly to TE; refer command New Message Indications +CNMI); refer <mem1> for defined values; received CBMs are always stored in "BM" (or some manufacturer specific storage) unless directly forwarded to TE; received status reports are always stored in "SR" (or some manufacturer specific storage) unless directly forwarded to TE

<stat> integer type in PDU mode (default 0), or string type in text mode (default "REC UNREAD"); indicates the status of message in memory; defined values:

0 "REC UNREAD" received unread message (i.e. new message)

1 "REC READ" received read message

2 "STO UNSENT" stored unsent message (only applicable to SMs)

3 "STO SENT" stored sent message (only applicable to SMs)

4 "ALL" all messages (only applicable to +CMGL command)

<total1> integer type; total number of message locations in <mem1>

<total2> integer type; total number of message locations in <mem2>

<total3> integer type; total number of message locations in <mem3>

<used1> integer type; number of messages currently in <mem1>

<used2> integer type; number of messages currently in <mem2>

<used3> integer type; number of messages currently in <mem3>

Message Data Parameters

<ackpdu> 3GPP TS 23.040 [3] RP-User-Data element of RP-ACK PDU; format is same as for <pdu> in case of SMS, but without 3GPP TS 24.011 [6] SC address field and parameter shall be bounded by double quote characters like a normal string type parameter

<alpha> string type alphanumeric representation of <da> or <oa> corresponding to the entry found in MT phonebook; implementation of this feature is manufacturer specific; used character set should be the one selected with command Select TE Character Set +CSCS (see definition of this command in 3GPP TS 27.007 [9])

<cdata> 3GPP TS 23.040 [3] TP-Command-Data in text mode responses; ME/TA converts each 8-bit octet into two IRA character long hexadecimal number (e.g. octet with integer value 42 is presented to TE as two characters 2A (IRA 50 and 65))

<ct> 3GPP TS 23.040 [3] TP-Command-Type in integer format (default 0)

<da> 3GPP TS 23.040 [3] TP-Destination-Address Address-Value field in string format; BCD numbers (or GSM 7 bit default alphabet characters) are converted to characters of the currently selected TE character set (refer command +CSCS in3GPP TS 27.007 [9]); type of address given by <toda>

<data> In the case of SMS: 3GPP TS 23.040 [3] TP-User-Data in text mode responses; format:

– if <dcs> indicates that 3GPP TS 23.038 [2] GSM 7 bit default alphabet is used and <fo> indicates that 3GPP TS 23.040 [3] TP-User-Data-Header-Indication is not set:

– if TE character set other than "HEX" (refer command Select TE Character Set +CSCS in 3GPP TS 27.007 [9]): ME/TA converts GSM alphabet into current TE character set according to rules of Annex A

– if TE character set is "HEX": ME/TA converts each 7-bit character of GSM 7 bit default alphabet into two IRA character long hexadecimal number (e.g. character Ψ (GSM 7 bit default alphabet decimal 23) is presented as 17 (IRA 49 and 55))

– if <dcs> indicates that 8-bit or UCS2 data coding scheme is used, or <fo> indicates that 3GPP TS 23.040 [3] TP-User-Data-Header-Indication is set: ME/TA converts each 8-bit octet into two IRA character long hexadecimal number (e.g. octet with integer value 42 is presented to TE as two characters 2A (IRA 50 and 65))

In the case of CBS: 3GPP TS 23.041 [4] CBM Content of Message in text mode responses; format:

– if <dcs> indicates that 3GPP TS 23.038 [2] GSM 7 bit default alphabet is used:

– if TE character set other than "HEX" (refer command +CSCS in 3GPP TS 27.007 [9]): ME/TA converts GSM alphabet into current TE character set according to rules of Annex A

– if TE character set is "HEX": ME/TA converts each 7-bit character of the GSM 7 bit default alphabet into two IRA character long hexadecimal number

– if <dcs> indicates that 8-bit or UCS2 data coding scheme is used: ME/TA converts each 8-bit octet into two IRA character long hexadecimal number

<dcs> depending on the command or result code: 3GPP TS 23.038 [2] SMS Data Coding Scheme (default 0), or Cell Broadcast Data Coding Scheme in integer format

<dt> 3GPP TS 23.040 [3] TP-Discharge-Time in time-string format: "yy/MM/dd,hh:mm:ss±zz", where characters indicate year (two last digits), month, day, hour, minutes, seconds and time zone. E.g. 6th of May 1994, 22:10:00 GMT+2 hours equals to "94/05/06,22:10:00+08"

<fo> depending on the command or result code: first octet of 3GPP TS 23.040 [3] SMS-DELIVER, SMS-SUBMIT (default 17), SMS-STATUS-REPORT, or SMS-COMMAND (default 2) in integer format

<length> integer type value indicating in the text mode (+CMGF=1) the length of the message body <data> > (or <cdata>) in characters; or in PDU mode (+CMGF=0), the length of the actual TP data unit in octets (i.e. the RP layer SMSC address octets are not counted in the length)

<mid> 3GPP TS 23.041 [4] CBM Message Identifier in integer format

<mn> 3GPP TS 23.040 [3] TP-Message-Number in integer format

<mr> 3GPP TS 23.040 [3] TP-Message-Reference in integer format

<oa> 3GPP TS 23.040 [3] TP-Originating-Address Address-Value field in string format; BCD numbers (or GSM 7 bit default alphabet characters) are converted to characters of the currently selected TE character set (refer command +CSCS in TS 07.07); type of address given by <tooa>

<page> 3GPP TS 23.041 [4] CBM Page Parameter bits 4-7 in integer format

<pages> 3GPP TS 23.041 [4] CBM Page Parameter bits 0-3 in integer format

<pdu> In the case of SMS: 3GPP TS 24.011 [6] SC address followed by 3GPP TS 23.040 [3] TPDU in hexadecimal format: ME/TA converts each octet of TP data unit into two IRA character long hexadecimal number (e.g. octet with integer value 42 is presented to TE as two characters 2A (IRA 50 and 65))

In the case of CBS: 3GPP TS 23.041 [4] TPDU in hexadecimal format

<pid> 3GPP TS 23.040 [3] TP-Protocol-Identifier in integer format (default 0)

<ra> 3GPP TS 23.040 [3] TP-Recipient-Address Address-Value field in string format; BCD numbers (or GSM 7 bit default alphabet characters) are converted to characters of the currently selected TE character set (refer command +CSCS in 3GPP TS 27.007 [9]); type of address given by <tora>

<sca> 3GPP TS 24.011 [6] RP SC address Address-Value field in string format; BCD numbers (or GSM 7 bit default alphabet characters) are converted to characters of the currently selected TE character set (refer command +CSCS in 3GPP TS 27.007 [9]); type of address given by <tosca>

<scts> 3GPP TS 23.040 [3] TP-Service-Centre-Time-Stamp in time-string format (refer <dt>)

<sn> 3GPP TS 23.041 [4] CBM Serial Number in integer format

<st> 3GPP TS 23.040 [3] TP-Status in integer format

<toda> 3GPP TS 24.011 [6] TP-Destination-Address Type-of-Address octet in integer format (when first character of <da> is + (IRA 43) default is 145, otherwise default is 129)

<tooa> 3GPP TS 24.011 [6] TP-Originating-Address Type-of-Address octet in integer format (default refer <toda>)

<tora> 3GPP TS 24.011 [6] TP-Recipient-Address Type-of-Address octet in integer format (default refer <toda>)

<tosca> 3GPP TS 24.011 [6] RP SC address Type-of-Address octet in integer format (default refer <toda>)

<vp> depending on SMS-SUBMIT <fo> setting: 3GPP TS 23.040 [3] TP-Validity-Period either in integer format (default 167) or in time-string format (refer <dt>)

<vp> depending on SMS-SUBMIT <fo> setting: 3GPP TS 23.040 [3] TP-Validity-Period either in integer format (default 167), in time-string format (refer <dt>), or if EVPF is supported, in enhanced format (hexadecimal coded string with double quotes)

3.2 General Configuration Commands

3.2.1 Select Message Service +CSMS

Table 3.2.1-1: +CSMS Parameter Command Syntax

Command

Possible response(s)

+CSMS=<service>

+CSMS: <mt>,<mo>,<bm>

+CMS ERROR: <err>

+CSMS?

+CSMS: <service>,<mt>,<mo>,<bm>

+CSMS=?

+CSMS: (list of supported <service>s)

Description

Set command selects messaging service <service>. It returns the types of messages supported by the ME: <mt> for mobile terminated messages, <mo> for mobile originated messages and <bm> for broadcast type messages. If chosen service is not supported by the ME (but is supported by the TA), final result code +CMS ERROR: <err> shall be returned. See chapter Message Service Failure Result Code for a list of <err> values.

Also read command returns supported message types along the current service setting.

Test command returns a list of all services supported by the TA.

Defined Values

<service>: integer type

0 3GPP TS 23.040 [3] and 3GPP TS 23.041 [4]

1 3GPP TS 23.040 [3] and 3GPP TS 23.041 [4]the requirement of <service> setting 1 is mentioned under corresponding command descriptions)

2…127 reserved

128… manufacturer specific

<mt>, <mo>, <bm>: integer type

0 type not supported

1 type supported

Implementation

Mandatory if SMS is supported.

3.2.2 Preferred Message Storage +CPMS

Table 3.2.2-1: +CPMS Parameter Command Syntax

Command

Possible response(s)

+CPMS=<mem1>[,<mem2>[,<mem3>]]

+CPMS: <used1>,<total1>,<used2>,<total2>,<used3>,<total3>

+CMS ERROR: <err>

+CPMS?

+CPMS: <mem1>,<used1>,<total1>,<mem2>,<used2>,<total2>,

<mem3>,<used3>,<total3>

+CMS ERROR: <err>

+CPMS=?

+CPMS: (list of supported <mem1>s),(list of supported <mem2>s),

(list of supported <mem3>s)

Description

Set command selects memory storages <mem1>, <mem2> and <mem3> to be used for reading, writing, etc. If chosen storage is not appropriate for the ME (but is supported by the TA), final result code +CMS ERROR: <err> shall be returned. See chapter Message Service Failure Result Code for a list of possible <err> values.

Test command returns lists of memory storages supported by the TA.

Implementation

Mandatory if SMS is supported.

3.2.3 Message Format +CMGF

Table 3.2.3-1: +CMFG Parameter Command Syntax

Command

Possible response(s)

+CMGF=[<mode>]

+CMGF?

+CMGF: <mode>

+CMGF=?

+CMGF: (list of supported <mode>s)

Description

Set command tells the TA, which input and output format of messages to use. <mode> indicates the format of messages used with send, list, read and write commands and unsolicited result codes resulting from received messages. Mode can be either PDU mode (entire TP data units used) or text mode (headers and body of the messages given as separate parameters). Text mode uses the value of parameter <chset> specified by command Select TE Character Set +CSCS to inform the character set to be used in the message body in the TA-TE interface.

Test command returns supported modes as a compound value.

Defined Values

<mode>: integer type

0 PDU mode

1 text mode

Implementation

Mandatory if SMS is supported also when only one mode implemented.

3.2.4 Enter SMS Block Mode Protocol +CESP

Table 3.2.4-1: +CESP Action Command Syntax

Command

Possible response(s)

+CESP

+CESP=?

Description

Execution command sets the TA in SMS block protocol mode. The TA shall return OK (or 0) to confirm acceptance of the command prior to entering the block mode (see clause 2.1.1). The final result code OK (or 0) shall be returned when the block mode is exited.

NOTE: Commands following +CESP in the AT command line must not be processed by the TA.

Implementation

Mandatory when block mode implemented.

3.2.5 Message Service Failure Result Code +CMS ERROR

Final result code +CMS ERROR: <err> indicates an error related to mobile equipment or network. The operation is similar to ERROR final result code. None of the following commands in the same command line is executed. Neither ERROR nor OK final result code shall be returned. ERROR is returned normally when error is related to syntax or invalid parameters.

Defined Values

<err> values used by common messaging commands:

0…127 3GPP TS 24.011 [6] clause E.2 values

128…255 3GPP TS 23.040 [3] clause 9.2.3.22 values.

300 ME failure

301 SMS service of ME reserved

302 operation not allowed

303 operation not supported

304 invalid PDU mode parameter

305 invalid text mode parameter

310 (U)SIM not inserted

311 (U)SIM PIN required

312 PH-(U)SIM PIN required

313 (U)SIM failure

314 (U)SIM busy

315 (U)SIM wrong

316 (U)SIM PUK required

317 (U)SIM PIN2 required

318 (U)SIM PUK2 required

320 memory failure

321 invalid memory index

322 memory full

330 SMSC address unknown

331 no network service

332 network timeout

340 no +CNMA acknowledgement expected

500 unknown error

…511 other values in range 256…511 are reserved

512… manufacturer specific

Implementation

Mandatory if SMS is supported.

3.2.6 Informative Examples

Setting up a TA supporting SMS:

AT+CSMS=? (inquiry of available services in TA)

+CSMS: (0)

OK

AT+CSMS=0;+CPMS=? (set SMS; query available memories)

+CSMS: 1,1,1 (all MT, MO and CBM supported)

+CPMS: ("BM","ME","SM"),("ME","SM"),("ME","SM") (CBM, ME and (U)SIM memories for reading,)

OK ME and (U)SIM memories for writing)

AT+CPMS="ME","ME","ME";+CMGF=? (set ME memory; query available message formats)

+CPMS: "ME",5,99,"ME",5,99,"ME",5,99 (five messages in ME, 99 total space)

+CMGF: (0,1) (both text and PDU mode implemented)

OK

AT+CMGF=1;+CSCS=? (select text mode; query available TE character sets)

+CSCS: ("IRA","PCCP437","8859-1")

OK

AT+CSCS="PCCP437" (select PC code page 437)

OK

3.3 Message Configuration Commands

3.3.1 Service Centre Address +CSCA

Table 3.3.1-1: +CSCA Parameter Command Syntax

Command

Possible response(s)

+CSCA=<sca>[,<tosca>]

+CSCA?

+CSCA: <sca>,<tosca>

+CSCA=?

Description

Set command updates the SMSC address, through which mobile originated SMs are transmitted. In text mode, setting is used by send and write commands. In PDU mode, setting is used by the same commands, but only when the length of the SMSC address coded into <pdu> parameter equals zero.

Implementation

Mandatory if SMS is supported.

3.3.2 Set Text Mode Parameters +CSMP

Table 3.3.2-1: +CSMP Parameter Command Syntax

Command

Possible response(s)

+CSMP=[<fo>[,<vp>[,<pid>[,<dcs>]]]]

+CSMP?

+CSMP: <fo>,<vp>,<pid>,<dcs>

+CSMP=?

Description

Set command is used to select values for additional parameters needed when SM is sent to the network or placed in a storage when text format message mode is selected. It is possible to set the validity period starting from when the SM is received by the SMSC (<vp> is in range 0… 255) or define the absolute time of the validity period termination (<vp> is a string). The format of <vp> is given by <fo>. If TA supports the EVPF, see 3GPP TS 23.040 [3], it shall be given as a hexadecimal coded string (refer e.g. <pdu>) with double quotes.

NOTE: When storing a SMS-DELIVER from the TE to the preferred memory storage in text mode (refer command Write Message to Memory +CMGW), <vp> field can be used for <scts>.

Implementation

Mandatory when text mode implemented.

3.3.3 Show Text Mode Parameters +CSDH

Table 3.3.3-1: +CSDH Parameter Command Syntax

Command

Possible response(s)

+CSDH=[<show>]

+CSDH?

+CSDH: <show>

+CSDH=?

+CSDH: (list of supported <show>s)

Description

Set command controls whether detailed header information is shown in text mode result codes.

Test command returns supported values as a compound value.

Defined Values

<show>: integer type

0 do not show header values defined in commands +CSCA and +CSMP (<sca>, <tosca>, <fo>, <vp>, <pid> and <dcs>) nor <length>, <toda> or <tooa> in +CMT, +CMGL, +CMGR result codes for SMS-DELIVERs and SMS-SUBMITs in text mode; for SMS-COMMANDs in +CMGR result code, do not show <pid>, <mn>, <da>, <toda>, <length> or <cdata>

1 show the values in result codes

Implementation

Mandatory when text mode implemented.

3.3.4 Select Cell Broadcast Message Types +CSCB

Table 3.3.4-1: +CSCB Parameter Command Syntax

Command

Possible response(s)

+CSCB=[<mode>[,<mids>[,<dcss>]]]

+CSCB?

+CSCB: <mode>,<mids>,<dcss>

+CSCB=?

+CSCB: (list of supported <mode>s)

Description

Set command selects which types of CBMs are to be received by the ME.

Test command returns supported modes as a compound value.

Defined Values

<mode>: integer type

0 message types specified in <mids> and <dcss> are accepted

1 message types specified in <mids> and <dcss> are not accepted

<mids>: string type; all different possible combinations of CBM message identifiers (refer <mid>) (default is empty string); e.g. "0,1,5,320-478,922"

<dcss>: string type; all different possible combinations of CBM data coding schemes (refer <dcs>) (default is empty string); e.g. "0-3,5"

Implementation

Optional.

3.3.5 Save Settings +CSAS

Table 3.3.5-1: +CSAS Action Command Syntax

Command

Possible response(s)

+CSAS[=<profile>]

+CMS ERROR: <err>

+CSAS=?

+CSAS: (list of supported <profile>s)

Description

Execution command saves active message service settings to a non-volatile memory. A TA can contain several profiles of settings. Settings specified in commands Service Centre Address +CSCA, Set Message Parameters +CSMP and Select Cell Broadcast Message Types +CSCB (if implemented) are saved. Certain settings may not be supported by the storage (e.g. (U)SIM SMS parameters) and therefore can not be saved. See chapter Message Service Failure Result Code for <err> values.

Test command shall display the supported profile numbers for reading and writing of settings.

Defined Values

<profile>: integer type

0…255 manufacturer specific profile number where settings are to be stored

Implementation

Optional.

3.3.6 Restore Settings +CRES

Table 3.3.6-1: +CRES Action Command Syntax

Command

Possible response(s)

+CRES[=<profile>]

+CMS ERROR: <err>

+CRES=?

+CRES: (list of supported <profile>s)

Description

Execution command restores message service settings from non-volatile memory to active memory. A TA can contain several profiles of settings. Settings specified in commands Service Centre Address +CSCA, Set Message Parameters +CSMP and Select Cell Broadcast Message Types +CSCB (if implemented) are restored. Certain settings may not be supported by the storage (e.g. (U)SIM SMS parameters) and therefore can not be restored. See chapter Message Service Failure Result Code for <err> values.

Defined Values

<profile>: integer type

0…255 manufacturer specific profile number from where settings are to be restored

Implementation

Optional.

3.3.7 Informative Examples

Figure 3.3.7-1 illustrates an example setup of a TE-TA-ME system for SMS. Location of volatile and non-volatile parameter memories, and the operations to change the parameter values are shown. +CSMP is used to set the text mode header values of SMS-SUBMIT (or SMS-DELIVER when received message is written from TE to a storage). The volatile memory may as well be in the ME, or when no volatile memory is used, +CSMP, +CSCA and +CSCB settings are stored directly to non-volatile memory of ME.

Figure 3.3.7-1: Message service parameter procedures

In this example, the volatile parameter settings of TA are used to construct messages in text mode. SMSC address setting is used also in PDU mode. The next example illustrates a session to restore the message parameters from the ME to the TA, and to set up the CBM identifiers (and languages) which are wanted to be received:

AT+CRES (restore settings from non-volatile memory to volatile memory)

OK

AT+CSMP?;+CSCA? (query SM parameters)

+CSMP: 17,167,0,0 (default values for SMS-SUBMIT)

+CSCA: "+358501234567",145 (SMSC address)

OK

AT+CSDH=1 (show all headers in text mode)

OK

AT+CSCB=1 (all CBMs are accepted)

OK

3.4 Message Receiving and Reading Commands

3.4.1 New Message Indications to TE +CNMI

Table 3.4.1-1: +CNMI Parameter Command Syntax

Command

Possible response(s)

+CNMI=[<mode>[,<mt>[,<bm>[,<ds>[,

<bfr>]]]]]

+CMS ERROR: <err>

+CNMI?

+CNMI: <mode>,<mt>,<bm>,<ds>,<bfr>

+CNMI=?

+CNMI: (list of supported <mode>s),(list of supported <mt>s),(list of supported <bm>s),(list of supported <ds>s),(list of supported <bfr>s)

Description

Set command selects the procedure, how receiving of new messages from the network is indicated to the TE when TE is active, e.g. DTR signal is ON. If TE is inactive (e.g. DTR signal is OFF), message receiving should be done as specified in 3GPP TS 23.038 [2].

NOTE 1: When DTR signal is not available or the state of the signal is ignored (V.25ter command &D0), reliable message transfer can be assured by using +CNMA acknowledgement procedure.

<mode> controls the processing of unsolicited result codes specified within this command, <mt> sets the result code indication routing for SMS-DELIVERs, <bm> for CBMs and <ds> for SMS-STATUS-REPORTs. <bfr> defines the handling method for buffered result codes when <mode> 1, 2 or 3 is enabled. If ME does not support requested item (although TA does), final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values.

Test command gives the settings supported by the TA as compound values.

NOTE 2: Command Select Message Service +CSMS should be used to detect ME support of mobile terminated SMs and CBMs, and to define whether a message routed directly to TE should be acknowledged or not (refer command +CNMA).

Defined Values

<mode>: integer type (refer figure 3.4.1-1)

NOTE 3: The buffering mechanism may as well be located in the ME; the setting affects only to unsolicited result codes specified within this command):

0 Buffer unsolicited result codes in the TA. If TA result code buffer is full, indications can be buffered in some other place or the oldest indications may be discarded and replaced with the new received indications.

1 Discard indication and reject new received message unsolicited result codes when TA-TE link is reserved (e.g. in on-line data mode). Otherwise forward them directly to the TE.

2 Buffer unsolicited result codes in the TA when TA-TE link is reserved (e.g. in on-line data mode) and flush them to the TE after reservation. Otherwise forward them directly to the TE.

3 Forward unsolicited result codes directly to the TE. TA-TE link specific inband technique used to embed result codes and data when TA is in on-line data mode.

NOTE 4: It is possible that ME/TA result code buffer is in volatile memory. In this case messages may get lost if the power of ME/TA is switched off before codes are sent to TE. Thus, it is not recommended to use direct message routing (<mt>=2 or 3, <bm>=2 or 3, or <ds>=1) with <mode> value 0 or 2.

Figure 3.4.1-1: <mode> parameter

<mt>: integer type (the rules for storing received SMs depend on its data coding scheme (refer 3GPP TS 23.038 [2]), preferred memory storage (+CPMS) setting and this value; refer table 3.4.1-2;

NOTE 5: If AT command interface is acting as the only display device, the ME must support storing of class 0 messages and messages in the message waiting indication group (discard message); refer table 3.4.1-3):

0 No SMS-DELIVER indications are routed to the TE.

1 If SMS-DELIVER is stored into ME/TA, indication of the memory location is routed to the TE using unsolicited result code:

+CMTI: <mem>,<index>

2 SMS-DELIVERs (except class 2 messages and messages in the message waiting indication group (store message)) are routed directly to the TE using unsolicited result code:

+CMT: [<alpha>],<length><CR><LF><pdu> (PDU mode enabled); or

+CMT: <oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs>,<sca>,<tosca>,<length>]<CR><LF><data> (text mode enabled; about parameters in italics, refer command Show Text Mode Parameters +CSDH)

If ME has its own display device then class 0 messages and messages in the message waiting indication group (discard message) may be copied to both ME display and to TE. In this case, ME shall send the acknowledgement to the network (refer table 2).

Class 2 messages and messages in the message waiting indication group (store message) result in indication as defined in <mt>=1.

3 Class 3 SMS-DELIVERs are routed directly to TE using unsolicited result codes defined in <mt>=2. Messages of other data coding schemes result in indication as defined in <mt>=1.

Table 3.4.1-2: <mt> parameter

<mt>

Receiving procedure for different message data coding schemes (refer 3GPP TS 23.038 [2])

0

no class: as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory

class 0: as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory if message is tried to be stored

class 1: as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory

class 2: as in 3GPP TS 23.038 [2]

class 3: as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory

message waiting indication group (discard message): as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory if message is tried to be stored

message waiting indication group (store message): as in 3GPP TS 23.038 [2], but use <mem3> as preferred memory

1

as <mt>=0 but send indication if message stored successfully

2

no class: route message to TE

class 0: as in 3GPP TS 23.038 [2], but also route message to TE and do not try to store it in memory

class 1: route message to TE

class 2: as <mt>=1

class 3: route message to TE

message waiting indication group (discard message): as in 3GPP TS 23.038 [2], but also route message to TE and do not try to store it in memory

message waiting indication group (store message): as <mt>=1

3

class 3: route message to TE

others: as <mt>=1

Table 3.4.1-3: SMS-DELIVER result code and acknowledgement summary

<mt>

no class or class 1

class 0 or message waiting indication group (discard)

class 2 or message waiting indication group (store)

class 3

1

+CMTI

[+CMTI1)]

+CMTI

+CMTI

2

+CMT & +CNMA3)

+CMT [& +CNMA2)]

+CMTI

+CMT & +CNMA3)

3

+CMTI

[+CMTI1)]

+CMTI

+CMT & +CNMA3)

1) result code is sent when ME does not have other display device than AT interface.

2) acknowledgement command must be sent when +CSMS <service> value equals 1 and ME does not have other display device than AT interface.

3) acknowledgement command must be sent when +CSMS <service> value equals 1.

<bm> integer type (the rules for storing received CBMs depend on its data coding scheme (refer 3GPP TS 23.038 [2]), the setting of Select CBM Types (+CSCB) and this value; refer table 3.4.1-4):

0 No CBM indications are routed to the TE.

1 If CBM is stored into ME/TA, indication of the memory location is routed to the TE using unsolicited result code:

+CBMI: <mem>,<index>

2 New CBMs are routed directly to the TE using unsolicited result code:

+CBM: <length><CR><LF><pdu> (PDU mode enabled); or

+CBM: <sn>,<mid>,<dcs>,<page>,<pages><CR><LF><data> (text mode enabled)

If ME supports data coding groups which define special routing also for messages other than class 3 (e.g. (U)SIM specific messages), ME may choose not to route messages of such data coding schemes into TE (indication of a stored CBM may be given as defined in <bm>=1).

3 Class 3 CBMs are routed directly to TE using unsolicited result codes defined in <bm>=2. If CBM storage is supported, messages of other classes result in indication as defined in <bm>=1.

Table 3.4.1-4: <bm> parameter

<bm>

Receiving procedure for different message data coding schemes (refer 3GPP TS 23.038 [2])

0

all schemes: as in 3GPP TS 23.038 [2]; if CBM storage is supported, store message to "BM" (or some manufacturer or data coding scheme specific memory)

1

all schemes: as <bm>=0 but send indication if message stored successfully

2

all schemes: route message to TE unless ME has detected a special routing to somewhere else (e.g. to (U)SIM; an indication may be sent if message stored successfully)

3

class 3: route message to TE

others: as <bm>=1 (if CBM memory storage is supported)

<ds>: integer type

0 No SMS-STATUS-REPORTs are routed to the TE.

1 SMS-STATUS-REPORTs are routed to the TE using unsolicited result code:

+CDS: <length><CR><LF><pdu> (PDU mode enabled); or

+CDS: <fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st> (text mode enabled)

2 If SMS-STATUS-REPORT is stored into ME/TA, indication of the memory location is routed to the TE using unsolicited result code:

+CDSI: <mem>,<index>

Table 3.4.1-5: SMS-STATUS-REPORT result code and acknowledgement summary

<ds>

result codes and commands

1

+CDS & +CNMA1)

2

+CDSI

1) acknowledgement command must be sent when +CSMS <service> value equals 1

<bfr>: integer type

0 TA buffer of unsolicited result codes defined within this command is flushed to the TE when <mode> 1…3 is entered (OK response shall be given before flushing the codes).

1 TA buffer of unsolicited result codes defined within this command is cleared when <mode> 1…3 is entered.

Implementation

Mandatory when any of the new message indications implemented.

3.4.2 List Messages +CMGL

Table 3.4.2-1: +CMGL Action Command Syntax

Command

Possible response(s)

+CMGL[=<stat>]

if text mode (+CMGF=1), command successful and SMS-SUBMITs and/or SMS-DELIVERs:

+CMGL: <index>,<stat>,<oa/da>,[<alpha>],[<scts>][,<tooa/toda>,

<length>]<CR><LF><data>[<CR><LF>

+CMGL: <index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,

<length>]<CR><LF><data>[…]]

if text mode (+CMGF=1), command successful and SMS-STATUS-REPORTs:

+CMGL: <index>,<stat>,<fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st>

[<CR><LF>

+CMGL: <index>,<stat>,<fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st>

[…]]

if text mode (+CMGF=1), command successful and SMS-COMMANDs:

+CMGL: <index>,<stat>,<fo>,<ct>[<CR><LF>

+CMGL: <index>,<stat>,<fo>,<ct>[…]]

if text mode (+CMGF=1), command successful and CBM storage:

+CMGL: <index>,<stat>,<sn>,<mid>,<page>,<pages>

<CR><LF><data>[<CR><LF>

+CMGL: <index>,<stat>,<sn>,<mid>,<page>,<pages>

<CR><LF><data>[…]]

otherwise:

+CMS ERROR: <err>

+CMGL=?

+CMGL: (list of supported <stat>s)

Description

Execution command returns messages with status value <stat> from message storage <mem1> to the TE. About text mode parameters in italics, refer command Show Text Mode Parameters +CSDH. If status of the message is ‘received unread’, status in the storage changes to ‘received read’. If listing fails, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for <err> values.

NOTE: If the selected <mem1> can contain different types of SMs (e.g. SMS-DELIVERs, SMS-SUBMITs, SMS-STATUS-REPORTs and SMS-COMMANDs), the response may be a mix of the responses of different SM types. TE application can recognize the response format by examining the third response parameter.

Test command shall give a list of all status values supported by the TA.

Implementation

Optional.

3.4.3 Read Message +CMGR

Table 3.4.3-1: +CMGR Action Command Syntax

Command

Possible response(s)

+CMGR=<index>

if text mode (+CMGF=1), command successful and SMS-DELIVER:

+CMGR: <stat>,<oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs>, <sca>,<tosca>,<length>]<CR><LF><data>

if text mode (+CMGF=1), command successful and SMS-SUBMIT:

+CMGR: <stat>,<da>,[<alpha>][,<toda>,<fo>,<pid>,<dcs>,[<vp>], <sca>,<tosca>,<length>]<CR><LF><data>

if text mode (+CMGF=1), command successful and SMS-STATUS-REPORT:

+CMGR: <stat>,<fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st>

if text mode (+CMGF=1), command successful and SMS-COMMAND:

+CMGR: <stat>,<fo>,<ct>[,<pid>,[<mn>],[<da>],[<toda>],<length>

<CR><LF><cdata>]

if text mode (+CMGF=1), command successful and CBM storage:

+CMGR: <stat>,<sn>,<mid>,<dcs>,<page>,<pages><CR><LF><data>

otherwise:

+CMS ERROR: <err>

+CMGR=?

Description

Execution command returns message with location value <index> from message storage <mem1> to the TE. About text mode parameters in italics, refer command Show Text Mode Parameters +CSDH. If status of the message is ‘received unread’, status in the storage changes to ‘received read’. If reading fails, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for <err> values.

Implementation

Optional.

3.4.4 New Message Acknowledgement to ME/TA +CNMA

Table 3.4.4-1: +CNMA Action Command Syntax

Command

Possible response(s)

if text mode (+CMGF=1):

+CNMA

+CMS ERROR: <err>

+CNMA=?

Description

Execution command confirms correct reception of a new message (SMS-DELIVER or SMS-STATUS-REPORT) which is routed directly to the TE (refer command +CNMI table 3.4.1-3 and table 3.4.1-5). This acknowledgement command (causing ME to send RP-ACK to the network) shall be used when +CSMS parameter <service> equals 1. TA shall not send another +CMT or +CDS result code to TE before previous one is acknowledged.

If ME does not get acknowledgement within required time (network timeout), ME should respond as specified in 3GPP TS 24.011 [6] to the network. ME/TA shall automatically disable routing to TE by setting both <mt> and <ds> values of +CNMI to zero.

If command is executed, but no acknowledgement is expected, or some other ME related error occurs, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values.

NOTE: In case that a directly routed message must be buffered in ME/TA (possible when +CNMI parameter <mode> equals 0 or 2) or AT interpreter remains too long in a state where result codes cannot be sent to TE (e.g. user is entering a message using +CMGS), acknowledgement (RP-ACK) must be sent to the network without waiting +CNMA command from TE. Later, when buffered result codes are flushed to TE, TE must send +CNMA acknowledgement for each result code. In this way, ME/TA can determine if message should be placed in non-volatile memory and routing to TE disabled (+CNMA not received). Refer command +CNMI for more details how to use <mode> parameter reliably.

Implementation

Mandatory when <service> value 1 of command Select Message Service +CSMS is supported.

3.4.5 Informative Examples

Message forwarding is done as illustrated in figure 3.4.5-1. Optional +CNMA acknowledgement procedure is not presented. In this example, there is no TA memory for messages and result code buffer is situated in TA. The routing of message waiting indication group (discard message) SMS-DELIVERs equal to class 0 messages, and the routing of message waiting indication group (store message) SMS-DELIVERs equal to class 2 messages.

Figure 3.4.5-1: Message receiving procedures

Setting new message indications:

AT+CNMI=? (query new message unsolicited result code modes)

+CNMI: (0-2),(0-3),(0-3),(0,1),(0,1)

OK

AT+CNMI=2,1,0,1,0 (send SM and status report indications to TE when TA in command mode, otherwise buffer)

OK

In this example, the TA is set so that it should send an unsolicited result code +CMTI: <mem>,<index> to the TE when a new SMS-DELIVER is received from the network and stored successfully to storage <mem>, and an unsolicited result code +CDS:… when a SMS-STATUS-REPORT is received. These result codes are routed to the TE when TA is in command mode, but buffered when in on-line data mode. Now, if new SM is received, it can be read as follows (text mode with no detailed header information; GSM 7 bit default alphabet used in message body):

+CMTI: "ME",2 (new message received in index 2)

AT+CMGR=2 (read the message)

+CMGR: "REC UNREAD","+358507654321","Mr. Jones","95/07/03,17:38:15+04"

This is the Mr. Jones testing

OK

In the next example all messages of storage <mem1> are listed (text mode with no detailed header information; GSM 7 bit default alphabet used in message bodies):

AT+CMGL="ALL" (read all SMs)

+CMGL: 1,"REC READ","+358501234567","Mr. Smith","95/07/03,17:45:03+04"

This is the body of the message.

+CMGL: 2,"STO UNSENT","+358501234567","Mr. Smith",

This is the body of the reply.

OK

The next example shows a method to read new CBMs received from the network (text mode; GSM 7 bit default alphabet used in message bodies):

AT+CNMI=2,,2,,0 (CBMs will be sent to the TE)

OK

AT+CPMS="BM";+CMGL (select CBM memory for reading; list all unread CBMs)

+CMGL: 1,"REC UNREAD",100,40,1,3 (first page of three page weather information)

Weather in Finland 3rd of July 1995

+CMGL: 2,"REC UNREAD",100,40,2,3 (second page of three page weather information)

Helsinki: cloudy, snow storms, -20 degrees Celsius, wind -14 m/s NE

+CMGL: 3,"REC UNREAD",100,40,3,3 (third page of three page weather information)

Tampere: sunny, 40 degrees Celsius, wind 1 m/s SW

OK

3.5 Message Sending and Writing Commands

3.5.1 Send Message +CMGS

Table 3.5.1-1: +CMGS Action Command Syntax

Command

Possible response(s)

if text mode (+CMGF=1):

+CMGS=<da>[,<toda>]<CR>

text is entered<ctrl-Z/ESC>

if text mode (+CMGF=1) and sending successful:

+CMGS: <mr>[,<scts>]

if sending fails:

+CMS ERROR: <err>

+CMGS=?

Description

Execution command sends message from a TE to the network (SMS-SUBMIT). Message reference value <mr> is returned to the TE on successful message delivery. Optionally (when +CSMS <service> value is 1 and network supports) <scts> is returned. Values can be used to identify message upon unsolicited delivery status report result code. If sending fails in a network or an ME error, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values. This command should be abortable.

Description

Execution command sends message from a TE to the network (SMS-SUBMIT). Message reference value <mr> is returned to the TE on successful message delivery. Value can be used to identify message upon unsolicited delivery status report result code. If sending fails in a network or an ME error, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values. This command should be abortable.

– entered text (3GPP TS 23.040 [3] TP-Data-Unit) is sent to address <da> and all current settings (refer Set Text Mode Parameters +CSMP and Service Centre Address +CSCA) are used to construct the actual PDU in ME/TA.

– the TA shall send a four character sequence <CR><LF><greater_than><space> (IRA 13, 10, 62, 32) after command line is terminated with <CR>; after that text can be entered from TE to ME/TA.

– the DCD signal shall be in ON state while text is entered.

– the echoing of entered characters back from the TA is controlled by V.25ter echo command E.

– the entered text should be formatted as follows:

– if <dcs> (set with +CSMP) indicates that 3GPP TS 23.038 [2] GSM 7 bit default alphabet is used and <fo> indicates that 3GPP TS 23.040 [3] TP-User-Data-Header-Indication is not set:

– if TE character set other than "HEX" (refer command Select TE Character Set +CSCS in 3GPP TS 27.007 [9]): ME/TA converts the entered text into the GSM 7 bit default alphabet according to rules of Annex A; backspace can be used to delete last character and carriage returns can be used (previously mentioned four character sequence shall be sent to the TE after every carriage return entered by the user);

– if TE character set is "HEX": the entered text should consist of two IRA character long hexadecimal numbers which ME/TA converts into the GSM 7 bit default alphabet characters. (e.g. 17 (IRA 49 and 55) will be converted to character Π (GSM 7 bit default alphabet 23)).

– if <dcs> indicates that 8-bit or UCS2 data coding scheme is used or <fo> indicates that 3GPP TS 23.040 [3] TP-User-Data-Header-Indication is set: the entered text should consist of two IRA character long hexadecimal numbers which ME/TA converts into 8-bit octet (e.g. two characters 2A (IRA 50 and 65) will be converted to an octet with integer value 42).

– sending can be cancelled by giving <ESC> character (IRA 27).

– <ctrl-Z> (IRA 26) must be used to indicate the ending of the message body.

Implementation

Optional.

3.5.2 Send Message from Storage +CMSS

Table 3.5.2-1: +CMSS Action Command Syntax

Command

Possible response(s)

+CMSS=<index>[,<da>[,<toda>]]

if text mode (+CMGF=1) and sending successful:

+CMSS: <mr>[,<scts>]

if sending fails:

+CMS ERROR: <err>

+CMSS=?

Description

Execution command sends message with location value <index> from preferred message storage <mem2> to the network (SMS-SUBMIT or SMS-COMMAND). If new recipient address <da> is given given for SMS-SUBMIT, it shall be used instead of the one stored with the message. Reference value <mr> is returned to the TE on successful message delivery. Optionally (when +CSMS <service> value is 1 and network supports) <scts> is returned. Values can be used to identify message upon unsolicited delivery status report result code. If sending fails in a network or an ME error, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values. This command should be abortable.

Implementation

Optional.

3.5.3 Write Message to Memory +CMGW

Table 3.5.3-1: +CMGW Action Command Syntax

Command

Possible response(s)

if text mode (+CMGF=1):

+CMGW[=<oa/da>[,<tooa/toda>[,<stat>]]]<CR>

text is entered<ctrl-Z/ESC>

+CMGW: <index>

+CMS ERROR: <err>

+CMGW=?

Description

Execution command stores message (either SMS-DELIVER or SMS-SUBMIT) to memory storage <mem2>. Memory location <index> of the stored message is returned. By default message status will be set to ‘stored unsent’, but parameter <stat> allows also other status values to be given. The entering of text is done similarly as specified in command Send Message +CMGS. If writing fails, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for <err> values.

NOTE: SMS-COMMANDs and SMS-STATUS-REPORTs can not be stored in text mode.

Implementation

Optional.

3.5.4 Delete Message +CMGD

Table 3.5.4-1: +CMGD Action Command Syntax

Command

Possible response(s)

+CMGD=<index>[,<delflag>]

+CMS ERROR: <err>

+CMGD=?

+CMGD: (list of supported <index>s)[,(list of supported <delflag>s)]

Description

Execution command deletes message from preferred message storage <mem1> location <index>. If <delflag> is present and not set to 0 then the ME shall ignore <index> and follow the rules for <delflag> shown below. If deleting fails, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for <err> values.

Test command shows the valid memory locations and optionally the supported values of <delflag>.

<delflag>: integer type, indicating multiple message deletion request as follows:

0 Delete the message specified in <index>

1 Delete all read messages from preferred message storage, leaving unread messages and stored mobile originated messages (whether sent or not) untouched

2 Delete all read messages from preferred message storage and sent mobile originated messages, leaving unread messages and unsent mobile originated messages untouched

3 Delete all read messages from preferred message storage, sent and unsent mobile originated messages leaving unread messages untouched.

4 Delete all messages from preferred message storage including unread messages.

Implementation

Optional.

3.5.5 Send Command +CMGC

Table 3.5.5-1: +CMGC Action Command Syntax

Command

Possible response(s)

if text mode (+CMGF=1):

+CMGC=<fo>,<ct>[,<pid>[,<mn>[,<da>[,<toda>]]]]<CR>

text is entered<ctrl-Z/ESC>

if text mode (+CMGF=1) and sending successful:

+CMGC: <mr>[,<scts>]

if sending fails:

+CMS ERROR: <err>

+CMGC=?

Description

Execution command sends a command message from a TE to the network (SMS-COMMAND). The entering of text (3GPP TS 23.040 [3] TP-Command-Data) is done similarly as specified in command Send Message +CMGS, but the format is fixed to be a sequence of two IRA character long hexadecimal numbers which ME/TA converts into 8-bit octets (refer +CMGS). Message reference value <mr> is returned to the TE on successful message delivery. Optionally (when +CSMS <service> value is 1 and network supports) <scts> is returned. Values can be used to identify message upon unsolicited delivery status report result code. If sending fails in a network or an ME error, final result code +CMS ERROR: <err> is returned. See chapter Message Service Failure Result Code for a list of <err> values. This command should be abortable.

Implementation

Optional.

3.5.6 More Messages to Send +CMMS

Table 3.5.6-1: +CMMS Parameter Command Syntax

Command

Possible response(s)

+CMMS=[<n>]

+CMMS?

+CMMS: <n>

+CMMS=?

+CMMS: (list of supported <n>s)

Description

Set command controls the continuity of SMS relay protocol link. When feature is enabled (and supported by network) multiple messages can be sent much faster as link is kept open.

Test command returns supported values as a compound value.

Defined Values

<n>: integer type

0 disable

1 keep enabled until the time between the response of the latest message send command (+CMGS, +CMSS, etc.) and the next send command exceeds 1-5 seconds (the exact value is up to ME implementation), then ME shall close the link and TA switches <n> automatically back to 0

2 enable (if the time between the response of the latest message send command and the next send command exceeds 1-5 seconds (the exact value is up to ME implementation), ME shall close the link but TA shall not switch automatically back to <n>=0)

Implementation

Optional.

3.5.7 Informative Examples

Figure 3.5.7-1 is an example of a TE-TA-ME setup when messages are sent to network or stored to ME. The volatile memory may as well be in the ME, or a non-volatile memory may be used instead when constructing messages.

Figure 3.5.7-1: Message service send and write procedures

An example of sending a GSM 7 bit default alphabet message in text mode and a SMS-STATUS-REPORT is wanted:

AT+CNMI? (check that status reports are routed to TE)

+CNMI: 2,1,0,1,0

OK

AT+CSMP=49,167,0,0 (status report wanted; otherwise default settings)

OK

AT+CMGS="+358501234567" (start editing a message)

> This the first line. (edit first line and press carriage return)

> This is the last line.^Z (edit second line and send message by pressing control-Z)

+CMGS: 10 (success: message reference 10 returned from SMSC)

OK

+CDS: 2,10,"+358501234567",145,"95/07/04/13:12:14+04",

"95/07/04/13:12:20+04",0 (status report of successful message delivery received)

Storing an unsent message in memory, sending it from there, and deleting it:

AT+CPMS? (check memory settings)

+CPMS: "ME",4,10,"ME",4,10,"ME",4,10

OK

AT+CMGW="9501231234" (write message)

> This is the message body^Z

+CMGW: 7 (index number in storage returned)

OK

AT+CMSS=7 (send from storage)

+CMSS: 12 (success: reference value 12 sent from SC)

OK

AT+CMGD=7 (delete message)

OK