The MMS Postal Plug-in provides services for Multimedia Messaging Service (MMS) messages.
Supported Transactions
Types of transactions that can be sent from the MMS plug-in:
- Send request transaction: the originator sends an MMS
- Delivery Acknowledgement transaction: sent when the deferred option is set (explained below)
- Read Report transaction: to confirm that an MMS has been read by the destination.
Types of transactions that can arrive to the MMS plug-in:
- Transaction Notification WAP Push; a new MMS has arrived
- Transaction Send-confirmation
- Transaction Retrieve-confirmation
- Transaction Read Originator, which corresponds to a Read Report confirmation
- Transaction Delivery Indicator, which corresponds to a Delivery Report confirmation.
MMS depends on the SMS plug-in for certain features, including the PDU library and WAP-Push support.
HTTP Get and SMIL Parsing
The MMS plug-in first gets the whole content received by the HTTP get and stores it temporarily into a .pdu file. The whole content is composed by the concatenation of each of the successive get responses (the HTTP get keeps on retrieving data in a loop until the result http_ok is received).
If there is SMIL-related content, followed by the possible image, audio and text parts, the plug-in parses these 3 parts from the received pdu, and stores them in separate image/audio/text files on the disk. This information is assigned to the different body parts of an envelope. When the plug-in sends a new envelope notification to its client application, it sends the ID of this envelope. Then the client can retrieve the envelope and its body parts by using this ID.
Example: MMS Session
Most of the features of a service rely on a session. A session is a temporary object created by the Service object, which requires an Account.
If the creation of the session succeeds (some security could be introduced in this process), the session can be connected.
Using the session, you can send and receive envelopes, enumerate folders, and store envelopes.
The following example illustrates how to create an MMS session, connect to the session, and send an envelope.
Listing 6.1 Create an MMS session, connect to it, and send an envelope
// Create the session using an existing account alp_postal_session_id_t sessionId; alp_postal_service_create_session(ALP_POSTAL_SERVICE_ID_MMS, account_id, Â Â Â Â Â &sessionId); // Connect the session (asynchronous call) // This may pop up a dialog: 'Turn phone on?' alp_postal_session_connect(ALP_POSTAL_SERVICE_ID_MMS, sessionId, NULL, NULL, Â Â Â NULL); // Build an envelope AlpPostalEnvelope env; build_sample_envelope(&env); // Send the envelope alp_postal_session_send_envelope(ALP_POSTAL_SERVICE_ID_MMS, sessionId, &env, Â Â Â NULL); // Free the envelope alp_postal_envelope_free(&env);










