彩信的通知短信PDU数据分析
目录
一、数据采集... 1
1、采集数据方法... 1
2、样品数据... 1
3、关键解码函数... 3
二、MMS Notification 的 Short Message 结构说明... 4
1、MMS Notification 的 Short Message 结构... 4
2、SMSC号码... 4
3、TPDU. 5
4、WDP Header (TP-UD) 6
5、WSP PDU. 6
6、MMS Header PDU. 7
硬件:GPRS 短彩信MODEM(EDGE上网卡也可)
软件:串口监听工具和短彩信收发软件(EDGE上网卡附带或者购买的短彩信收发控件)
彩信MODEM连接串口,打开串口前,设置好监听串口的工具软件(AccessPort、free-serial-port-monitor等),然后开始监听。通过彩信接收软件接收彩信,监听软件可以获取数据。
主分析数据:
0891683108200005F0640CA80156184591500004012121010050238A0605040B8423F0AB06246170706C69636174696F6E2F766E642E7761702E6D6D732D6D65737361676500B487AF848C82984D4A36724A4C68624D376941008D9083687474703A2F2F3231312E3133362E3232312E37352F4D4A36724A4C68624D376941008805810302A30089178031333939393232323037382F545950453D504C4D4E 008A808E020B65
3 、关键解码函数
'VB6
'Print Ascii2Char("61324233")
'a2B3
Public Function Ascii2Char(ByVal strAsc As String) As String
Dim i As Integer
Dim j As Integer
Dim strTmp As String
Dim strTmpA As String
Dim strTmpB As String
On Error Resume Next
j = Len(strAsc)
strTmpB = ""
For i = 1 To j
strTmpA = Mid(strAsc, i, 1)
If strTmpA <> " " Then strTmpB = strTmpB & strTmpA
Next i
j = Len(strTmpB)
strTmp = ""
For i = 1 To j Step 2
strTmpA = Mid(strTmpB, i, 2)
' Debug.Print strTmpA
'strTmp = strTmp & ChrB(Hex2Dec(strTmpA))
strTmp = strTmp & Chr(Hex2Dec(strTmpA))
Next i
Ascii2Char = strTmp
End Function
0891683108200005F0
分段
含义
说明
08
SMSC地址信息的长度
共8个八位字节(包括91)
Length of the SMSC info
91
SMSC地址格式(TON/NPI)
用国际格式号码(在前面加‘+’)
international format
683108200005F0
SMSC地址
就是:8613800200500,补‘F’凑成偶数个
Service center number, +8613800100500
640CA8015618459150
0004012121010050238A
012121010050 反转后:10 12 12 10 00 05
就是: 2010年12月12日 10:00:05
分段
含义
说明
64
First octet of this SMS-DELIVER message.
0C
Length Of the Sender info
发送地址信息的长度
A8
National format
发送地址格式(TON/NPI)???未确定
015618459150
Sender number
发送地址两两转换后:106581541905
00
TP-PID
04
TP-DCS ( 8 bit data)
012121010050
23
TimeStamp: 010年12月12日 10:00:05
23为特殊的时区还是?
8A
TP-UDL
0605040B8423F0
分段
含义
说明
06
header len
UDHL(user header length)
05
端口地址
Information element identifier;
Application port addressing 16 bit
04
长度
Information element length
0B84
客户端端口
Destination port
23F0
服务器端口
Originating port
AB06246170706C69636174696F6E2F766E642E7761702E6D6D732D6D65737361676500B487AF84
分段
含义
说明
AB
Transaction ID
06
PDU Type: Push
24
Length of Content type + Header
6170706C69636174696F6E2F766E642E7761702E6D6D732D6D65737361676500
Content type: (8 bit encoding of)
Ascii2Char解码后为application/vnd.wap.mms-message
B4 87
Push Flag: 87
AF84
X-Wap-Application-Id: 84
8C82984D4A36724A4C68624D376941008D90
83687474703A2F2F3231312E3133362E3232312E37352F4D4A36724A4C68624D37694100
8805810302A300
8917
8031333932323939323037382F545950453D504C4D4E00
8A80
8E
02
0B65
分段
含义
说明
8C 82
X-Mms-Message-Type: m-notification-ind
984D4A36724A4C68624D37694100
Transaction-ID:
Ascii2Char解码后为
MJ6rJLhbM7iA
8D 90
MMS-Version: 1.0
83687474703A2F2F3231312E3133362E3232312E37352F4D4A36724A4C68624D37694100
Content-Location:http://218.200.249.38/ZX72hcMAlq7A
Ascii2Char解码后为
http://211.136.221.75/MJ6rJLhbM7iA
88
Expiry
05
Length
expiry length
81
Relative-token
relative format
03
02A300
Delta-secs
秒
Len
02A300约48小时
89 17 80
31333939393232323037382F545950453D504C4D4E
00
From + Length + Address-Present-token:5555160103/TYPE=PLMN
From 89
length 17
80 开头?
Address-Present-token:
13999222078/TYPE=PLMN
00结尾?
8A 80
Msg-Class: Info
表示MMS_CLASS 为'Personal'
8E
020B65
Msg-Size: 133989 还是2917
8E:Mms_Size
02,值长度
0b65实际值2917
