代码改变世界

MMS调试-PDU分析

2014-04-03 15:33  东山冰雪  阅读(1468)  评论(0编辑  收藏  举报

彩信的接收,总是先收到一个以短信形式下发的push消息,然后去下载的。下面来看看push消息里面都含有哪些内容。相关协议OMA-MMS-ENC-V1_2-20050301-A.pdf

 

本文主要介绍notification部分。

首先通过modem上报的是一个二进制内容转换过来的字符串,比如本文接收的push消息是8c829861714e344930347047394130008d9089178031383235343230353737362f545950453d504c4d4e008a808e04000050008805810303f48083687474703a2f2f3132302e3139322e3133372e3133353a3138332f635a4e35483100

 

下面打开协议Multimedia Message Notification,开表3

Field                                Name  Field Value                                                      Description  
X-Mms-Message-Type       Message-type-value = m-notification-ind  Mandatory. Specifies the PDU type.  
X-Mms-Transaction-ID     Transaction-id-value  Mandatory. This transaction ID identifies the M-Notification.ind and the corresponding M-NotifyResp.ind  
X-Mms-MMS-Version  MMS-version-value  Mandatory. The MMS version number. According to this specification, the version is 1.2  
From  From-value  Optional. Address of the last MMS Client that handled the MM, i.e. that sent or forwarded the MM. If hiding the address of the sender from the recipient is requested by the originating MMS Client and supported and accepted by the MMS Proxy-Relay, the MMS Proxy-Relay MUST NOT add this field to the M-Notification.ind PDU. The insert-address-token MUST NOT be used as the value of the field.  

第一个字段是8C,这个是字段标识,请参考Header Field Names and Assigned Numbers中的定义。

Name  Assigned Number 
Bcc  0x01 
Cc  0x02 
X-Mms-Content-Location  0x03 
Content-Type  0x04 
Date  0x05 
X-Mms-Delivery-Report  0x06 
X-Mms-Delivery-Time  0x07 
X-Mms-Expiry  0x08 
From  0x09 
X-Mms-Message-Class  0x0A 
Message-ID  0x0B 
X-Mms-Message-Type  0x0C 
X-Mms-MMS-Version  0x0D 
X-Mms-Message-Size  0x0E 
X-Mms-Priority  0x0F 
X-Mms-Read-Report  0x10 
X-Mms-Report-Allowed  0x11 
X-Mms-Response-Status  0x12 
X-Mms-Response-Text  0x13 
X-Mms-Sender-Visibility  0x14 
X-Mms-Status  0x15 
Subject  0x16 
To  0x17 
X-Mms-Transaction-Id  0x18 
X-Mms-Retrieve-Status  0x19 
X-Mms-Retrieve-Text  0x1A 
X-Mms-Read-Status  0x1B 
X-Mms-Reply-Charging  0x1C 
X-Mms-Reply-Charging-Deadline  0x1D 
X-Mms-Reply-Charging-ID  0x1E 
X-Mms-Reply-Charging-Size  0x1F 
X-Mms-Previously-Sent-By  0x20 
X-Mms-Previously-Sent-Date  0x21 
X-Mms-Store  0x22 
X-Mms-MM-State  0x23 
X-Mms-MM-Flags  0x24 
X-Mms-Store-Status  0x25 
X-Mms-Store-Status-Text  0x26 
X-Mms-Stored  0x27 
X-Mms-Attributes  0x28 
X-Mms-Totals  0x29 
X-Mms-Mbox-Totals  0x2A 
X-Mms-Quotas  0x2B 
X-Mms-Mbox-Quotas  0x2C 
X-Mms-Message-Count  0x2D 
Content  0x2E 
X-Mms-Start  0x2F 
Additional-headers  0x30 
X-Mms-Distribution-Indicator  0x31 
X-Mms-Element-Descriptor  0x32 
X-Mms-Limit  0x33 

从上可以看出这个字段是X-Mms-Message-Type ,然后我们在看看value表示什么含义,请看7.2.23. X-Mms-Message-Type field。

m-send-req = <Octet 128>
m-send-conf = <Octet 129>
m-notification-ind = <Octet 130>

从上可以看出是个notification。

 

继续往下分析

9861714e34493034704739413000 // 98表示X-Mms-Transaction-ID ,这是个Text-string。值是aqN4I04pG9A0

8d90 //X-Mms-MMS-Version 类型Short-integer value是90,解析方法是高四位中的最后三位表示主版本号,第四位为次版本号,所以版本号为1.0

89 17 80 3138323534323035373736 //89表示From, value是18254205776

2f545950453d504c4d4e00 // /TYPE=PLMN 表示收件人类型是device-address

8a80 //class
8e 04 00005000 //信息大小:size 20k,有时候下载前和下载后大小不一样,就是这个值不对。
88 05 81 03 03f480 //有效期:259200
83 687474703a2f2f3132302e3139322e3133372e3133353a3138332f635a4e35483100 //X-Mms-Content-Location 下载地址http://120.192.137.135:183/cZN5H1