MMS PDU question

MMS PDU question SearchSearch
Author Message
Jian . Zhang
New member
Username: Mark_zhang

Post Number: 1
Registered: 11-2008
Posted on Thursday, November 27, 2008 - 01:26 pm:   

Hi,guys:

I've encode http header and MMS PDU.And when I'm attempting to "POST" data to wap gatewap , I'll always recieve the "400 Bad Request".Why?

[STEPS]
1. set APN="CMWAP" //CMCC CHINA
2. connect wap gateway //10.0.0.172:80
3. if success, transfer data to wap gateway

[http header]

POST mmsc.monternet.com HTTP1.1<CR><LF>
Content-type: application/vnd.wap.mms-message<CR><LF>
Accept: application/vnd.wap.mms-message,text/plain,*/*<CR><LF>
User-Agent: Nokia6681/2.0 (4.00.15) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1<CR><LF>
Content-Length: xxx<CR><LF>
Connection: close<CR><LF><CR><LF>

ps. Content-Length = MMS PDU's length.

[MMS PDU]

80 8C //X-Mms-Message-Type = m-send-req
98 31 32 33 00 //X-Mms-Transaction-ID=123
8D 90 //X-Mms-Version=1.0
89 1A 80 2B 38 36 31 33 34 36 39 30 37 32 34 30 34 2F 54 59 50 45 3D 50 4C 4D 4E 00 //From:+8613469072404/TYPE=PLMN
97 2B 38 36 31 35 38 37 34 32 38 39 37 36 36 2F 54 59 50 45 3D 50 4C 4D 4E 00 //TO:+8615874289766/TYPE=PLMN
96 4D 79 20 66 69 72 73 74 20 74 65 73 74 20 6D 65 73 73 61 67 65 21 00 //Subject:My first test message!
84 A3 //Content-Type = application/vnd wap.multipart.mixed

013E81479D8E6D6D73312E67696600436F6E74656E742D4944003C434944313E00B0687474703A2F 2F6F7269672E686F73742F6D6D73312E676966009204492E67E2 //filename , content-id,date... optional!

47494638396132003200800000D72542FFFFFF2C00000000320032000002A68C8FA9CBED0FA39CB4 DA8BB3DEBCFB0984A1312222097C67599A29EA8D62DA1EF35D63780E277C966BAD6E2ADA4BF88BED 902C6207677B0564D2E22CEA9A4237576A550BEE018D58DF519AB46CCDA8EBE70D8FCBE7F4BAFD8E CFEBF7FCBEFF8FE796D570C2B12316169556E1558848A5D1B8E6E214B9E4B8B0C848E42888697939 58C97559D59468A9755673AA29D158D6B6440A76AAD8E5FAE036EA900BF80B1C2C3C1C5100003B //mms1.gif

ps. Actually, the MMS PUD is created by NMIT. I think it should be correct.BUT why I always get 400 bad request? And if I just send http header to wap gateway(content-length=0),I can recieve the "200 OK" response .
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 271
Registered: 08-2008
Posted on Friday, November 28, 2008 - 03:19 pm:   

I don't know about the PDU itself ...

But from an HTTP perspective, this is an invalid request:

POST mmsc.monternet.com HTTP1.1<CR><LF>

There are a number of things wrong ...

You need to specify an absolute URI when sending an HTTP transaction via a proxy.

So instead of mmsc.monternet.com, you would need to specify http://mmsc.monternet.com/

Also, HTTP1.1 is not a valid string for the HTTP version. It should be HTTP/1.1

For example:

POST http://mmsc.monternet.com/ HTTP/1.1<CR><LF>


--
Des
NowSMS Support
shabbir hasan khan
New member
Username: Shabbirhasankhan

Post Number: 1
Registered: 01-2009
Posted on Tuesday, January 20, 2009 - 11:19 am:   

In read report why two PDU are there one from the reciever and one from the sender proxy.Can't they be same or one
shabbir hasan khan
New member
Username: Shabbirhasankhan

Post Number: 2
Registered: 01-2009
Posted on Tuesday, January 20, 2009 - 11:21 am:   

Why we OR the well known field in the MMS encoding with 0x80
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7734
Registered: 10-2002
Posted on Tuesday, January 20, 2009 - 07:42 pm:   


quote:

In read report why two PDU are there one from the reciever and one from the sender proxy.Can't they be same or one




Because, that's the way the MMS encapsulation specification defines the protocol.

One of the PDUs is sent from the receiver to the MMSC (or proxy).

The other PDU is then sent by the MMSC (or proxy) to the original sender.

I assume the reason for this is to ensure that the read report always gets routed through an MMSC or proxy so that additional routing or tracking information can be added by the MMSC or proxy.


quote:

Why we OR the well known field in the MMS encoding with 0x80




Because that is what the WSP specification says must be done.

If you follow the definitions in the WSP specification, you will find that the various well-known values are always encoded using the basic rule for "Short-Integer", which specifies "Integers in range 0-127 shall be encoded as a one octet value with the most significant bit set to one (1xxx xxxx) and with the value in the remaining least significant bits."

-bn
shabbir hasan khan
New member
Username: Shabbirhasankhan

Post Number: 3
Registered: 01-2009
Posted on Wednesday, January 21, 2009 - 04:17 am:   

1)In read report why two PDU are there one from the reciever and one from the sender proxy.Can't they be same or one


2)Why we OR the well known field in the MMS encoding with 0x80
For the above two question what i posted can you give a detailed explanation as I am just a starter
I got an overall idea by the answer provided by you but if possible provide explanation.I shall be higly thankful
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 376
Registered: 08-2008
Posted on Wednesday, January 21, 2009 - 06:21 pm:   

Hi,

I think you should read the specficiations that Bryce is referring to.

You can find them on the Open Mobile Alliance web site (http://www.openmobilealliance.org).

The MMS Encapsulation specfication defines the PDUs in your question 1. To find this specification, go to http://www.openmobilealliance.org/Technical/released_enablers.aspx and look for OMA Multimedia Messaging Service ... MMS Encapsulation is one of the specfications that is part of this particular enabler.

For question 2, you should note that the MMS Encapsulation specification refers back to the WAP WSP (Wireless Session Protocol) specification, which defines binary header encoding (and defines the "well-known" and "Short-Integer" encoding rules that Bryce references above). To find this specification, go to http://www.openmobilealliance.org/Technical/wapindex.aspx and look for the Wireless Session Protocol.

Happy reading!

--
Des
NowSMS Support
shabbir hasan khan
New member
Username: Shabbirhasankhan

Post Number: 4
Registered: 01-2009
Posted on Thursday, January 22, 2009 - 04:31 am:   

Thanks for your over whelming response.Looking forward for same kind of help
Thilani Abeysinghe
New member
Username: Thilani

Post Number: 1
Registered: 02-2009
Posted on Monday, February 16, 2009 - 08:24 am:   

How to decode the body of the mms pdu . I have gone through the WAP-203-WSP document.In section 8.5.2 .. explains the decoding format.
In body, first entry specify the number of multipart entries ,I have successfully identified it in original mms
then specify the HeadersLen,
(Length of the ContentType and Headers
fields combined).
But I was unable to identify the HeadersLen

0000 50 4f 53 54 20 68 74 74 70 3a 2f 2f 77 77 77 2e POST http://www.
0010 64 69 61 6c 6f 67 77 61 70 2e 63 6f 6d 2f 20 48 dialogwap.com/ H
0020 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 77 TTP/1.1..Host: w
0030 77 77 2e 64 69 61 6c 6f 67 77 61 70 2e 63 6f 6d ww.dialogwap.com
0040 0d 0a 41 63 63 65 70 74 3a 20 2a 2f 2a 2c 20 61 ..Accept: */*, a
0050 70 70 6c 69 63 61 74 69 6f 6e 2f 76 6e 64 2e 77 pplication/vnd.w
61 70 2e 6d 6d 73 2d 6d 65 73 73 61 67 65 2c 20 ap.mms-message,
61 70 70 6c 69 63 61 74 69 6f 6e 2f 76 6e 64 2e application/vnd.
74 2d wap.sic..Accept-
43 68 61 72 73 65 74 3a 20 75 74 66 2d 38 0d 0a Charset: utf-8..
41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 65 3a Accept-Language:
20 65 6e 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a en..User-Agent:
20 4e 6f 6b 69 61 36 36 30 30 2f 31 2e 30 20 28 Nokia6600/1.0 (
35 2e 35 33 2e 30 29 20 53 79 6d 62 69 61 6e 4f 5.53.0) SymbianO
53 2f 37 2e 30 73 20 53 65 72 69 65 73 36 30 2f S/7.0s Series60/
32 2e 30 20 50 72 6f 66 69 6c 65 2f 4d 49 44 50 2.0 Profile/MIDP
2d 32 2e 30 20 43 6f 6e 66 69 67 75 72 61 74 69 -2.0 Configurati
6f 6e 2f 43 4c 44 43 2d 31 2e 30 0d 0a 43 6f 6e on/CLDC-1.0..Con
74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 37 30 32 tent-Length: 702
34 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 4..Content-Type:
20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 76 6e 64 application/vnd
2e 77 61 70 2e 6d 6d 73 2d 6d 65 73 73 61 67 65 .wap.mms-message
0d 0a 78 2d 77 61 70 2d 70 72 6f 66 69 6c 65 3a ..x-wap-profile:
20 22 68 74 74 70 3a 2f 2f 6e 64 73 31 2e 6e 64 "http://nds1.nd
73 2e 6e 6f 6b 69 61 2e 63 6f 6d 2f 75 61 70 72 s.nokia.com/uapr
6f 66 2f 4e 36 36 30 30 72 31 30 30 2e 78 6d 6c of/N6600r100.xml
22 0d 0a 0d 0a 8c 80 98 45 31 33 46 32 30 44 44 ".......E13F20DD
45 34 42 43 44 41 00 8d 90 89 01 81 97 30 37 37 E4BCDA.......077
32 30 30 31 35 31 34 2f 54 59 50 45 3d 50 4c 4d 2001514/TYPE=PLM
4e 00 8a 80 8f 81 86 80 90 81 84 1f 21 b3 8a 3c N...........!..<
32 31 30 38 39 39 31 31 37 37 3e 00 89 61 70 70 2108991177>..app
6c 69 63 61 74 69 6f 6e 2f 73 6d 69 6c 00 (03) 2e lication/smil...
82 76 1e 61 70 70 6c 69 63 61 74 69 6f 6e 2f 73 .v.application/s
6d 69 6c 00 81 ea 85 70 72 65 73 2e 73 6d 69 6c mil....pres.smil
00 c0 22 3c 32 31 30 38 39 39 31 31 37 37 3e 00 .."<2108991177>.
0d 0a 3c 73 6d 69 6c 3e 0d 0a 3c 68 65 61 64 3e ..<smil>..<head>
0d 0a 3c 6c 61 79 6f 75 74 3e 0d 0a 3c 72 6f 6f ..<layout>..<roo
74 2d 6c 61 79 6f 75 74 20 77 69 64 74 68 3d 22 t-layout width="
31 37 36 22 20 68 65 69 67 68 74 3d 22 32 30 38 176" height="208
22 2f 3e 0d 0a 3c 72 65 67 69 6f 6e 20 69 64 3d "/>..<region id=}}


here I have displayed with in brackets(03) which indicates the number of multiparts in the message.Thereafter HeadersLen,DataLen,should come
I want to know how to interpret those details.
Thanks
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 475
Registered: 08-2008
Posted on Monday, February 16, 2009 - 05:29 pm:   

Some hints ...

HeadersLen = 2E (uintvar encoding)
Data Len = 82 76 (uintvar encoding)
Content Type = 1E (content type len) application/smil 00 81 EA 85 pres.smil 00

--
Des
NowSMS Support