基于WSP/WTP的MMS传输(7)——MMS Notification 解析

来源:互联网 发布:淘宝哪些店铺女装好看 编辑:程序博客网 时间:2024/05/17 17:43

 MMS Notification 解析

 

    之所以把MMS Notification 放在单独的一节是由于它的特殊性,前面提到过,MMS Notification 是由SMSC (短息服务中心)以PUSH 通知的方式发给接收方的,即MMS Notification 是一条短息,不同于普通的短息,MMS Notification 的编码是WSPMMS PDU Header 的结构,里面最重要的信息就是Content-Location ,它指出了彩信所在的Uri 地址,接收时从该地址下载彩信到客户端,这个Uri 地址前面我们看到过,类似于 http://xxx.xxx.xxx.xxx//abcd efghijkl 的样子,不同的彩信,中间的IP 是不一样的,如果是移动帐号,后面的字符一般是12 个的长度,但是也不保证一定是这个长度,对我们来说,它们是随机生成的。当然,MMS Notification 里面还包括发送方的手机号码等信息。

    下面是 MMS Notification Short Message 结构:


20 MMS Notification 结构


    说明一点,对应用层来说,SM-TLTP-UDP 是不可见的,在wince 平台上,这部分由驱动层来完成,通过WIN API 实际接收到的是WSP PDUMMS PDU Header 部分。下面提供一个从网上摘抄的例子来说明MMS Notification 的结构。

 

十六进制编码如下

08 91 68 31 08 10 00 05 F0 44 04 A1 33 25 00 04 60 01 52 32 95 35 23 88 06 05 04 0B 84 23 F0 A 5 06 24 61 70 70 6C 69 63 61 74 69 6F 6E 2F 76 6E 64 2E 77 61 70 2E 6D 6D 73 2D 6D 65 73 73 61 67 65 00 B4 87 AF 84 8C 82 98 5A 58 37 32 68 63 4D 41 6C 71 37 41 00 8D 90 83 68 74 74 70 3A 2F 2F 32 31 38 2E 32 30 30 2E 32 34 39 2E 33 38 2F 5A 58 37 32 68 63 4D 41 6C 71 37 41 00 88 05 81 03 02 A3 00 89 16 80 35 35 35 35 31 36 30 31 30 33 2F 54 59 50 45 3D 50 4C 4D 4E 00 8A 82 8E 01 0D

08 91 68 31 08 10 00 05 F0

 

Octet(s)

Description

08

Length of the SMSC info

91

international format

683108100005F 0

Service center number, +8613800100500

参考ETSI TS 123 040 Technical realization of SMS

9.1.2 .5 Address fields

9.2.2 .1 SMS-DELIVER type

        相关网站:http://webapp.etsi.org/key/queryform.asp

44 04 A1 33 25 00 04 60 01 52 32 95 35 23 88

Octet(s)

Description

44

First octet of this SMS-DELIVER message.

04

Length Of the Sender info

A1

National format

3325

Sender number, 3352

00

TP-PID

04

TP-DCS ( 8 bit data)

60015232953523

Timestamp: Wed Oct 25 23:59:53 CST 2006

88

TP-UDL

参考ETSI TS 123 040 Technical realization of SMS

9.1.2 .5 Address fields

9.2.2 .1 SMS-DELIVER type

        相关网站:http://webapp.etsi.org/key/queryform.asp

下面是 TP-UD 部分(WDP Header :

06 05 04 0B 84 23 F0

Octet(s)

Description

06

UDHL (user data header length)

05

Information Element identifier:

Application port addressing 16 bit.

04

Information element length

0B84

Destination port

23F 0

Originating port

参考 Wireless Datagram Protocol Specification

6.3 Mapping of WDP for GSM SMS

Appendix B. Port Number Definitions

相关网站:http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html

 

A5 06 24 61 70 70 6C 69 63 61 74 69 6F 6E 2F 76 6E 64 2E 77 61 70 2E 6D 6D 73 2D 6D 65 73 73 61 67 65 00 B4 87 AF 84

Octet(s)

Description

A5

Transaction ID

06

PDU Type: Push

24

Length of Content type + Header

6170706C 69636174696F 6E2F766E642E7761702E6D6D732D6D65737361676500

Content type: (8 bit encoding of)
application/vnd.wap.mms-message

B4 87

Push Flag: 87

AF 84

X-Wap-Application-Id: 84

参考Wireless Session Protocol Specification

8.2.1 P DU Common Fields

Appendix A Assigned Numbers

8.2.4 .1 Push and Confirmed Push

8.4.2 Header syntax

 

8C 82 98 5A 58 37 32 68 63 4D 41 6C 71 37 41 00 8D 90 83 68 74 74 70 3A 2F 2F 32 31 38 2E 32 30 30 2E 32 34 39 2E 33 38 2F 5A 58 37 32 68 63 4D 41 6C 71 37 41 00 88 05 81 03 02 A3 00 89 16 80 35 35 35 35 31 36 30 31 30 33 2F 54 59 50 45 3D 50 4C 4D 4E 00 8A 82 8E 01 0D

Octet(s)

Description

8C 82

X-Mms-Message-Type: m-notification-ind

98 5A 58 37 32 68 63 4D 41 6C 71 37 41 00

Transaction-ID: ZX72hcMAlq7A

8D 90

MMS-Version: 1.0

83687474703A 2F 2F 3231382E3230302E3234392E33382F5A58373268634D416C71374100

Content-Location:
http://218.200.249.38/ZX72hcMAlq7A

88 05 81 03 02 A3 00

Expiry + Length + Relative-token + Delta-secs:

54.8 hour?

891680353535353136303130332F545950453D504C4D4E00

From + Length + Address-Present-token:
5555160103/TYPE=PLMN

8A 82

Msg-Class: Info

8E 01 0D

Msg-Size: 269

参考WAP 209 MMS Encapsulation Protocol

7. Binary Encoding of PDU


    到此完整的mms notification 解析结束。从这个Push 通知中,我们应当保存Uri 信息。然后再给MMSC 发送一个M-Notifyresp.ind 以确认接收到了Push 通知。前面提到过,M-Notifyresp.ind 可以在接受完MMS 后再发,或者立即发出M-Notifyresp.ind ,然后再从MMSC 下载MMS 。而M-Notifyresp.ind 里面指明了是马上接收还是延迟接收。关于M-Notifyresp.ind 的格式可以参考MMS Encapsulation6.2Multimedia Message Notification ,它只有几个很少的域需要填写。

 

 

转载请注明出处

<------------ 未完待续 ------------>

 

原创粉丝点击