WSP Encoding: Content Type Tag in binary MMS file

WSP Encoding: Content Type Tag in binary MMS file SearchSearch
Author Message
zafir
Unregistered guest
Posted on Tuesday, July 06, 2004 - 08:43 am:   

We have purchased NOW SMS license.
------------------------------------------
MMS file of M-Send.req generated.The Content-Type filed of the header is encoded as 84h according to WSP Encoding.After 84h the next byte should be the length of Content type and related values and then binary values starts.Other tools does the same thing.But when MMS file is generated from Now SMS MMSComp exe it writes two bytes after Content-Type code(84h) and then the correct information.Can you tell what are thses two bytes ?.
Other tools only writes only one byte which is the exact length of rest of data.
Snap shot of the MMS file is attached and the problem area is marked.
Thanks in Advance
image/bmpbinary header
contentType.bmp (71.1 k)
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3064
Registered: 10-2002
Posted on Wednesday, July 14, 2004 - 11:01 pm:   

That is a content type header. The two bytes that follow are the length header. When the length is larger than 0x1E, a quote must be included.

See the WSP specification. Specifically, the following two pieces of information explain the encoding.


8.4.2.24 Content type field

The following rules are used to encode content type values. The short form of the Content-type-value MUST only be used when the well-known media is in the range of 0-127 or a text string. In all other cases the general form MUST be used.

Content-type-value = Constrained-media | Content-general-form

Content-general-form = Value-length Media-type

Media-type = (Well-known-media | Extension-Media) *(Parameter)


8.4.2.2 Length

The following rules are used to encode length indicators.

Value-length = Short-length | (Length-quote Length)

; Value length is used to indicate the length of the value to follow

Short-length = <Any octet 0-30>

Length-quote = <Octet 31>

Length = Uintvar-integer