Creating MMS Message Files – MMSCOMP
The over-the-air MMS message file format is a binary file format, and special tools are required to create MMS message files. The MMSCOMP utility is provided to assist in the creation of MMS message files. The MMSCOMP utility accepts text input files to create a binary MMS Message file.
Please note that it is not necessary to create binary MMS message files in order to send MMS messages. NowSMS supports a variety of APIs for sending MMS messages., and only the MM1 interface uses the binary MMS message file format created by MMSCOMP. The binary MMS message file format is what is used for the actual over-the-air delivery of MMS messages to a mobile phone. Please refer to the article MMS Messages and How MMS Works for further background and discussion of MMS protocols and formats.
When creating a binary MMS message file with the MMSCOMP utility, you are creating an MMS message that is pre-packaged for direct MMSC delivery. This file is placed on a standard web server, with the .MMS file extension mapped to the MIME content-type application/vnd.wap.mms-message. To send the MMS message, an MMS Notification message is sent to the recipient, referencing the URL from which the MMS message can be retrieved.
A standard format is not defined for a text version of an MMS message file, however a format can easily be derived based upon the OMA MMS Encapsulation Protocol Specification. The MMSCOMP utility accepts as input a file that contains text representations of the MMS header, and one or more files (image, sound, text, etc.) to comprise the multipart message content.
MMSCOMP is a command-line utility that accepts the following command-line format:
MMSCOMP [–ccharset] header.file [data1.file [data2.file [data3.file …]]]
-ccharset is used to specify a character set for the text components of the input files. This parameter is not required. The default character set is iso-8859-1. Other supported character sets include big5, iso-10646-ucs-2, iso-8859-1, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, shift_JIS, us-ascii, and utf-8.
header.file is a text file that contains text representations of the MMS message header. Supported MMS message headers include:
X-Mms-Message-Type: m-retrieve-conf (required) X-Mms-Transaction-Id: text-string X-Mms-Version: 1.0 Message-Id: text-string (usually x@x format) Date: HTTP-date-format From: address@domain or +InternationalPhoneNumber/TYPE=PLMN (Address-present-token is assumed) To: address@domain or +InternationalPhoneNumber/TYPE=PLMN (use multiple headers for multiple recipients) Cc: (optional, same format as To) Bcc: (optional, same format as To) Subject: text-string X-Mms-Message-Class: Personal, Advertisement, Informational or Auto (default is Personal) X-Mms-Priority: Low, Normal or High (default is Normal) X-Mms-Delivery-Report: Yes or No (default is No) X-Mms-Read-Reply: Yes or No (default is No) Content-type: MIME-Type (default is application/vnd.wap.multipart.related, override default with caution!) X-NowMMS-Content-Location: filename;content-type (optional, use multiple headers for multiple files)
Only the X-Mms-Message-Type header is required, other headers are optional. It is recommended that From and Subject headers always be included.
Note that while the message may contain multiple recipients in the To, Cc and Bcc headers, the gateway itself will only send the MMS notification message to one recipient at a time, as specified in the PhoneNumber parameter passed in a URL request.
At least one data file must be specified to provide the content of the MMS message. This data file can be specified on the command line (e.g., data1.file, data2.file, data3.file, …), or it may be specified in the MMS header file with one or more X-NowMMS-Content-Location headers.
If the first data file is a SMIL (Synchronized Multimedia Integration Language) file, then MMSCOMP will automatically parse all “src” references in the SMIL file and include any referenced files in the MMS multipart message file automatically.
If a SMIL file is to be included for presentation of the MMS message, it is recommended that the SMIL file always be specified as the first data file to the MMSCOMP command.
MMSCOMP determines the MIME type of each file based on the file extension, or when using the “X-NowMMS-Content-Type” header, the content type can be specified following the file name. File extensions of .jpg, .jpeg (image/jpeg), .gif (image/gif), .txt (text/plain), .wbmp (image/vnd.wap.wbmp) and .smil (application/smil) are recognized automatically. Other file extensions are read from the MMSCTYPE.INI file, or the Windows registry, under the registry key HKEY_CLASSES_ROOT\.extension, where “.extension” is the extension of the file. For best results, please ensure that any file types that you are using with MMSCOMP are defined in the MMSCTYPE.INI file.
The output of the MMSCOMP command will be stored in a file that matches the name of the input header file, but with “.MMS” as the file extension.
- You have created an MMS message header file named “test.hdr”.
- You have created a SMIL file named “testfile.smil”. The “testfile.smil” file references three external files through the following references in the SMIL file:
<img src=”image.jpg” region=”Image”/>
<text src=”text.txt” region=”region1_1″/>
- The “image.jpg”, “sound.amr” and “text.txt” files referenced by the “testfile.smil” file are located in the same directory as the “testfile.smil” file.
To create a binary MMS file, run:
MMSCOMP test.hdr testfile.smil
MMSCOMP test.hdr testfile.smil image.jpg sound.amr text.txt
If you want to specify a character set for the text file, include the –cCHARSET parameter:
MMSCOMP -cUTF-8 test.hdr testfile.smil
The output of the MMSCOMP file will be “test.mms” (e.g., the same filename as “test.hdr”, but with a “.mms” file extension).
To send the compiled MMS file, you can either:
- Submit it as a content file to the Send MMS Message option in the Web Menu Interface.
- Store the file on a web server using a MIME content type of “application/vnd.wap.mms-message”, and use the gateway to send an MMS Notification Message.
- If the message recipient is defined to the MMSC built into the gateway, attach the file to an e-mail message and send the message to username@mmsdomainname, where “username” is the alias name defined for the user on the “MMSC Users” dialog, and “mmsdomainname” is the “Domain Name for MMS E-Mail” defined on the “MMSC” dialog. Please refer to the section titled MMSC Messaging Server for information on configuring the MMSC to send and receive e-mail messages.
The MMSCOMP utility works well in conjunction with tools such as the SonyEricsson MMS Composer. The SonyEricsson MMS Composer creates SMIL (Synchronized Multimedia Integration Language) files, which are often used in MMS messages, but it does not create the complete binary MMS message file. To use the output of the SonyEricsson MMS Composer, use File/Export to export your MMS message to a specified directory. The composer will output a SMIL file and any included MMS message components to the directory specified. Create an MMS message header file, and then run MMSCOMP passing the name of the MMS message header file and the name of the SMIL file output by the SonyEricsson MMS Composer.