SMS MTM Overview

SMS MTM provides APIs for sending SMS text messages. This section provides an overview of the SMS MTM component.

Description

The Messaging Application module provides a SMS MTM for handling SMS messages in the Message Store. For further SMS support available on the Symbian platform, see Cellular Baseband Services Guide documentation.

Supported functionality

SMS MTM provides functionality to create, store and retrieve an SMS message entry in the Message Store, send an SMS, reply to a received SMS and forward existing SMS. A reply to a received SMS may include the original message text, including any EMS components.

SMS that are received by SMS MTM are stored in the Message Store. The type and class of the received SMS affects the storage of a message. All received class 2 SMS are stored in a non-Symbian platform store.

Storing SMS

SMS messages that are received by SMS MTM are stored in both the Message Store and a non-Symbian platform store. Messages can be moved, copied to, from the non-Symbian platform store and the Message Store. The non-Symbian platform store can be enumerated so that its contents can be reflected in the folder in the Message Store, except any of the standard folders (for example, the global inbox).

The type and class of the received SMS affects message storage. All received class 2 SMS message are stored in the class 2 folder in a non-Symbian platform store. The class 2 folder is a configurable location in the Message Store and may be set to be the global inbox. All received non-class 2 SMS messages are stored in the global inbox folder of the Message Store.

Sending SMS

SMS MTM can send the message immediately or schedule it for a specific time. Before SMS MTM sends an SMS, it checks the global outbox in the Message Store for any SMS that are waiting to be sent (these can also be scheduled for sending). If an SMS failed to be sent, then the MTM may re-schedule that SMS to be sent at a later time. A re-schedule is configurable against the failure error code. The schedule send functionality handles this configuration. A SMS that is successfully sent is moved to the sent folder in the Message Store by SMS MTM.

This MTM supports multiple recipients for an SMS message. An outgoing SMS message may have multiple recipients. When this message is being sent, one message is sent for each recipient.

BIO messages

SMS MTM is aware of BIO messages and uses the BIO Framework to tag SMS with the appropriate BIO type. This includes support for WAP messages.

Unsupported functionality

SMS MTM does not support sending and receiving OTA (Over The Air) SMS messages.

Architecture

The Messaging Middleware architecture defines a framework in which modules (MTMs) can be implemented that provide support for particular messaging protocols. A client MTM provides the API for application engines to use the protocol. SMS MTM API provides the client MTM API, server MTM API, and supporting classes for SMS.

SMS MTM integrates SMS into the Messaging architecture, so that SMS can be used by a messaging client program in a similar way to other message types such as email. SMS MTM uses the SMS interface provided by the Telephony sub-system. This provides support for 7, 8, and 16-bit text messages, and message concatenation.

The following figure shows the SMS architecture:

Figure 1. SMS MTM architecture

SMS Client MTM

The SMS Client MTM implements the standard set of Client MTM APIs described in Client MTM. In addition, it provides the following functionality:

  • Access to the CSmsHeader object that is used to represent the SMS message.

  • Access to the SMS settings stored in the associated SMS service centre.

  • Provides the APIs required by SendAs to allow SendAs to create SMS, including setting the BIO type message to allow clients of SendAs to send BIO messages, such as vCards and vCals. The data of the BIO message is stored in the body text of the SMS.

  • Simple check for valid SMS addresses; an SMS address is considered valid if it contains at least one digit.

  • Reading and writing SIM parameters.

Note: MS receiving is normally done automatically by the Cellular Baseband and messaging components, with received SMS messages placed in the Inbox. Generic message receiving operations are not supported by the MTM. Also, UI functionality, such as SMS message viewing and editing, is not provided by the Symbian platform.

The SMS Client MTM class is CSmsClientMtm.

SMS Server MTM

SMS Server MTM implements the Server-side MTM interface, and primarily provides functionality to handle requests from the client MTM to send SMS messages. Incoming SMS messages are handled by a group of components called SMS watchers.

These components provide a layer over the SMS support provided in the Narrow Band Protocols Stack subsystem. This has SMS stacks for GSM which offer an encapsulation of an SMS message, together with the ability to send and receive messages. At the lowest level, below the SMS stacks, is the ETel multimode API, which provides low-level access to the phone drivers.

The SMS Server MTM provides access to messages under remote services. It is loaded in the Message Server’s process space and handles the following tasks:

  • Connecting to remote servers to handle updating the cache of SMS messages.

  • Sending messages that are copied to remote services when messages are copied to a remote service.

    The SMS Server MTM handles sending of SMS and WAP messages through the SMS stack and the WAP stack respectively. To support this, it implements the CBaseServerMtm::CopyFromLocal() function inherited from the Server MTM base class. It implements this for sending SMS and moving the successfully sent messages to the Sent folder. When sending the SMS, the Server MTM checks the BIO type of the message and uses the BIO database to check the transport type for the BIO message. The MTM supports ENbs that is sent through the SMS stack and EWap, EWapSecure that are sent through the WAP stack. The MTM does not support EWsp or EWspSecure although the watchers do support receiving them.

  • Scheduling messages

    The SMS Server MTM implements scheduled sending API by sub-classing from the Schedule send Server MTM. It accepts requests from client applications either through the SMS Client MTM's CBaseMtm::InvokeAsyncFunctionL() API or through the CMsvSession::TransferCommand() API to schedule messages to be sent or to delete existing schedules. When it receives a request to schedule a message, it packages the command and uses the Scheduled Send functionality to request that the task scheduler ask it to send the messages at a future point in time.

  • Managing phone store

    The phone store is a storage for SMS outside the Message Store. For example, for GSM phones it is the SIM. The SMS Server MTM accepts requests from client applications to copy or move messages to and from the SIM and delete messages from the SIM. For example, when copying to the SIM, it packages SMS and passes it to the SMS stack with a request to write it to the SIM. If the class2 folder is set in the SMS settings class, the Server MTM copies the SMS to the SIM and then updates the SMS in the message store. The Server MTM also provides the details of the space used to store on the SIM and the reason for storing on the SIM.

  • Providing SIM parameters

    The Server MTM provides functions to read and write SIM parameters.

The SMS Server MTM class is CSmsServerMtm.

SMS Utilities

SMS Utilities provide the following:

  • Classes to represent and store SMS (CSmsHeader), and SMS settings (CSmsSettings, CSmsMessageSettings) and a SMS number (CSmsNumber).

  • Functions to generate descriptions and details fields to store with SMS. The details includes decoding special messages (such as, message indication and status report messages), reading resource file for descriptions strings of special messages, and using the contacts database to replace phone numbers with names.

  • Function to validate a GSM number.

  • Mode to find the TMsvId of the SMS service entry.

SMS Watchers

SMS Watchers are made up of two watchers, the nbswatcher.dll and the wapwatcher.dll, and some common base classes in biowatcher.dll. The watchers listen for incoming messages from the SMS Stack, part of Cellular Baseband Services, and the WAP stack, part of High-level Internet Protocols.

SMS Stack

SMS Stack is one of a number of protocol stacks that is supported by the ESock Server client-server framework. The SMS Stack’s principal clients are the messaging applications, WAP Stack and third party applications. The Messaging Application and the third party applications access the stack as clients of the ESock Server, while the WAP Stack accesses directly the SMS Stack. For more information on SMS Stack, see SMS Stack for GSM Networks.

SMS service settings

Settings for SMS connections, such as service centre addresses, are stored in the Message Store (CMsvStore) for the SMS service entry. Encapsulation of service settings is provided by CSmsSettings.

Progress information

The progress information can be obtained for messaging operations. For SMS operations, progress information includes such things as type of operation, and number of messages processed. Progress information is provided by TSmsProgress.

APIs

The following are the important classes for SMS Client MTM:

Class

Purpose

CSmsClientMtm

Implements the messaging architecture client MTM interface for SMS. It allows messages to be created, replied to, and forwarded, and MTM-specific commands to be given.

It provides an accessor function SmsHeader() to get the CSmsHeader for a message.

CSmsHeader

Encapsulates an SMS message in a message store.

It provides information about message recipients as an array of CSmsNumber objects, and access to the family of classes derived from TMsvMessageBio, which allow fields of a message to be set and accessed.

For compatibility with the API of the v8 (GSM only) SMS MTM, it also provides access to the GSM SMS stack's message class CSmsMessage.

TMsvMessageGsm

Provides access to GSM-specific fields.

TMsvSmsEntry

Provides a specialisation of the message server index class TMsvEntry for SMS message entries.

Putting selected SMS-specific fields in the index entry allows message clients to quickly get important message properties without having to create a message object.

CSmsNumber

Encapsulates recipient information for an SMS message.

CSmsSettings

Defines settings for the SMS service.

It contains some GSM-specific functions to maintain compability with the GSM SMS MTM.

It also provides access to CSmsMessageSettingsProxy for outgoing message defaults.

CSmsAccount

Stores SMS service and Schedule Send settings to Central Repository.

CSmsServiceCenter

Used to store Service Centre numbers and their associated name.

Related information
SMS Tutorial