Quicklinks
A MMS notification is an indication on your mobile phone, that tells you that a new MMS message for you has arrived at the MMSC (Multimedia Message Service Centre). Depending on your phone's settings, it will automatically download the MMS message from the MMSC, if there is a GPRS or UMTS connection configured.
The MMS notification message is encoded according to the MMS encapsulation protocol.
There are eight types of PDU's described in this protocol:
For MMS notification messages the 'M-Notification.ind' PDU is used. This PDU contains the following fields:
| Name | Content | Description |
|---|---|---|
| X-Mms-Message-Type | m-notification-ind | specify the pdu type |
| X-Mms-Transaction-ID | Transaction-id-value | Unique ID to identify the transaction |
| X-Mms-MMS-Version | MMS-version-value | MMS Version: 1.0 |
| From | From-value | Address of the sender, if left blank, this address will be added by the MMSC |
| Subject | Subject-value | Optional: subject of the MMS message |
| X-Mms-Message-Class | Message-class-value | Message Class: private, informational, advertising or auto |
| X-Mms-Message-Size | Message-size-value | Size of the MMS message in bytes |
| X-Mms-Expiry | Expiry-value | Expiration date of the MMS message on the MMSC |
| X-Mms-Content-Location | Content-location-value | The location of the MMS message (for instance http://mmsc.com/mmsc/133/145a.mms) |
Sample of a MMS notification message in binary encoding:
0x8C X-Mms-Message-Type 0x82 'm-notification-ind' 0x98 X-Mms-Transaction-ID 0x34 '4' 0x35 '5' 0x41 'A' 0x36 '6' 0x37 '7' 0x32 '2' 0x33 '3' 0x37 '7' 0x00 Terminating Zero 0x8D X-Mms-MMS-Version 0x90 '1.0' 0x89 From 0x0F FieldSize 0x80 Field is present ( 0x81 when no From address is specified ) 0x2B '+' 0x33 '3' 0x31 '1' 0x36 '6' 0x33 '3' 0x38 '8' 0x37 '7' 0x34 '4' 0x30 '0' 0x31 '1' 0x36 '6' 0x30 '0' 0x00 Terminating Zero 0x96 Subject 0x4D 'M' 0x4D 'M' 0x53 'S' 0x00 Terminating Zero 0x8A X-Mms-Message-Class 0x80 'Personal' 0x8E X-Mms-Message-Size 0x04 4 bytes 0x00 0x00 0x1E 0xD3 7891 Bytes 0x88 X-Mms-Expiry 0x06 Field Size 0x80 Absolute Date Format ( 0x81 = Relative Date Format ) 0x04 Size of Time field 0x45 0xA7 0xC3 0xB7 1168622519 Seconds from 1-1-1970 0x83 X-Mms-Content-Location 0x68 'h' 0x74 't' 0x74 't' 0x70 'p' 0x3A ':' 0x6D '/' 0x6D '/' ... 0x00 Terminating Zero
The SMS and MMS Toolkit makes it easy to generate and deliver MMS notification messages.
You can send MMS notification messages using a GSM modem (or GSM phone), or using an SMPP provider.
Use the SmsDataMmsNotification object to format the message of the SMS, and use the regular SmsProtocolGsm, SmsProtocolSmpp or SmsProtocolHttp functions to send the MMS notification formatted message.
The following code snippet shows how to encode the MMS notification message as shown above:
Set objNotification = CreateObject ( "ActiveXperts.SmsDataMmsNotification" ) Set objConstants = CreateObject ( "ActiveXperts.SmsConstants" ) objNotification.Expiration = 24 ' Message expires after 1 day objNotification.Subject = "MMS notification Demo" objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b" objNotification.From = "+31638740161" objNotification.Class = objConstants.asMMS_CLASS_PERSONAL objNotification.MessageSize = 7891 objNotification.Encode
The URL of the message on the MMSC.
The maximum length of this URL is 255 characters.
For instance: http://mmsc.activexperts-labs.com/200601/a6789bc.mms.
After this time the message expires and will be deleted from the MMSC.
This value has to be specified in hours. When the expiry time is 4 days, specify '96'.
This value is optional. You can use it to set the subject of the MMS message on the MMSC.
Specifies the message class of the message. Some phones have the ability to filter certain classes such as advertising. When no class is specified, 'personal' will be used.
The following values are valid:
| Value | Constant |
|---|---|
| "personal" | asMMS_CLASS_PERSONAL |
| "advertisement" | asMMS_CLASS_ADVERTISEMENT |
| "informational" | asMMS_CLASS_INFORMATIONAL |
| "automatic" | asMMS_CLASS_AUTO |
Set to the sender of the message. Most networks will add the sender automatically when this field is left blank. You can set this value to a phone number or email-address.
This field indicates the messagesize of the message on the MMSC. This field has nothing to do with the size of the notification message itself.
After all parameters has been set, you have to call the "Encode" function. This function does the actual encoding and stores the encoded data into the 'EncodedMessage' property. Most of the times a MMS notification message will fit into a single SMS message, unless the description or URL is very long. In case of multiple message parts, the encoded data is splitted into multiple messages automatically while sending through one of the SMS protocol objects.
The encoded data can be send using the SmsProtocolSmpp, SmsProtocolHttp or SmsProtocolGsm object. Sending MMS notification messages using the SmsProtocolDialUp object is not supported.
Please note that you have to set the messagetype to "asMESSAGEFORMAT_DATA_UDH" because the WAP Push data is encoded as 8 bit message data and includes UDH information for application port addressing. The samples below demonstrates how to send the messagedata using the SmsProtocolSmpp and SmsProtocolGsm objects:
SmsProtocolSmpp:
objSmsMessage = CreateObject ( "ActiveXperts.SmsMessage" )
objSmsProtocol = CreateObject ( "ActiveXperts.SmsProtocolSmpp" )
objSmsConstants = CreateObject ( "ActiveXperts.SmsConstants" )
objNotification.Encode
objSmsProtocol.Server = "smpp.activexperts-labs.com"
objSmsProtocol.SystemID = "AX008"
objSmsProtocol.SystemPassword = "812056"
objSmsProtocol.Connect
If ( objSmsProtocol.LastError = 0 ) Then
objMessage.Recipient = "+31624225229"
objMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
objMessage.Data = objNotification.EncodedMessage
objSmsProtocol.Send ( objMessage )
End If
objSmsProtocol.Disconnect
SmsProtocolGsm:
objSmsMessage = CreateObject ( "ActiveXperts.SmsMessage" )
objSmsProtocol = CreateObject ( "ActiveXperts.SmsProtocolGsm" )
objSmsConstants = CreateObject ( "ActiveXperts.SmsConstants" )
objNotification.Encode
objSmsProtocol.Device = "COM1"
objMessage.Recipient = "+31624225229"
objMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
objMessage.Data = objNotification.EncodedMessage
objSmsProtocol.Send ( objMessage )