You are here:

ActiveXperts.com > SMS and MMS Toolkit > About SMS > MMS notification

ActiveXperts Mobile Messaging Toolkit Add SMS capabilities to any Windows or .NET application

Quicklinks


Sending MMS notification messages through GSM or SMPP provider.

MMS notification message introduction

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:

  • M-Send.req
  • M-Send.conf
  • GET.req
  • M-Retrieve.conf
  • M-Notification.ind
  • M-NotifyResp.ind
  • M-Delivery.ind
  • M-Acknowledge.req

MMS notification message encoding

For MMS notification messages the 'M-Notification.ind' PDU is used. This PDU contains the following fields:

NameContentDescription
X-Mms-Message-Typem-notification-indspecify the pdu type
X-Mms-Transaction-IDTransaction-id-valueUnique ID to identify the transaction
X-Mms-MMS-VersionMMS-version-valueMMS Version: 1.0
FromFrom-valueAddress of the sender, if left blank, this address will be added by the MMSC
SubjectSubject-valueOptional: subject of the MMS message
X-Mms-Message-ClassMessage-class-valueMessage Class: private, informational, advertising or auto
X-Mms-Message-SizeMessage-size-valueSize of the MMS message in bytes
X-Mms-ExpiryExpiry-valueExpiration date of the MMS message on the MMSC
X-Mms-Content-LocationContent-location-valueThe 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

Sending MMS notification messages using the ActiveXperts MMS API

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.

Sample code to encode a MMS notification 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

MMS notification message parameters

ContentLocation

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.

Expiration

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'.

Subject

This value is optional. You can use it to set the subject of the MMS message on the MMSC.

Class

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:

ValueConstant
"personal"asMMS_CLASS_PERSONAL
"advertisement"asMMS_CLASS_ADVERTISEMENT
"informational"asMMS_CLASS_INFORMATIONAL
"automatic"asMMS_CLASS_AUTO

From

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.

MessageSize

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.

Sample code to send the MMS notification messages through GSM or SMPP provider

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 )

MMS  Download SMPP MMS Notification Sample  (4 KB - .vbs file)
MMS  Download GSM MMS Notification Sample  (4 KB - .vbs file)