2011-12-23 125 views
2

我尝试发送wap推消息。 I SET datacoding 0xf5和发送具有以下信息提交SM:发送wap推

GSM短消息业务用户数据

 
    udh length: 6 
    16-bit address 05 04 
    Destination port 08b4 
    Source port 23f0 

无线会话协议,方法:推送(0×06),内容类型:应用/ vnd.wap。 SIC

 
    Transaction Id: 0x25 
    PDU Type: Push (0x06) 
    Header length: 1 
    Content type: application/vnd.wap.sic 

WAP二进制XML,版本:1.2,公共ID: “ - // WAPFORUM // DTD SI 1.0 // EN(服务指示1 0.0)”

 
    Version: 1.2 (0x02) 
    Public Identifier: (known): -//WAPFORUM//DTD SI 1.0//EN (Service Indication 1 .0) 
    Character Set: utf-8 (0x000006a) 
    String table: 0 bytes 

数据表示:

 
    45 <si> 
    c6 <indication 
    0c href='http://' 
    03 69 2e 69 6d 67 75 72 2e 63 6f 6d 2f 66 6a 49 44 4e 2e 6a 70 67 00 i.imgur.com/fjIDN.jpg' 
    07 action='signal-medium' 
    01 > 
    03 69 6d 67 75 72 00 'imgur' 
    01 </indication> 
    01 </si> 

消息字节:

 
    06 05 04 0b 84 23 f0 25 06 01 ae 02 05 6a 00 45 
    c6 0c 03 69 2e 69 6d 67 75 72 2e 63 6f 6d 2f 66 
    6a 49 44 4e 2e 6a 70 67 00 07 01 03 69 6d 67 75 
    72 00 01 01 

SMSC回报:SUBMIT_SM - RESP: “OK”。 但手机没有显示任何内容。有任何想法吗? 对不起,我的丑英语:)

回答

3

我不能完全证明为什么这些变化的工作,但从几年前的广泛测试,以下似乎可以在整个英国网络和一系列不同的手机可靠工作。它在生产代码中使用,我们从那以后没有看到任何问题。

06 - UDHL 
05 - EI (Send to Ports 16bit addr) 
04 - EIDL 
0B - src port 
84 - src port 
23 - dest port 
F0 - dest port (End of UDH) 

01 - trans id 
06 - Push 
04 - Header Length 
03 - Length 
AE - Content type (application/vnd.wap.sic) 
81 - Character Set (01 once removed high bit) 
EA - UTF 8 (6A once removed high bit) 

02 - Binary XML Version 1.2 
05 - SI Identifier 
6A - UTF-8 
00 - End Data 

45 - SI Binary XML Tag 
C6 - Indication Tag 
0B - href 
03 - Open Text 
    (URL bytes go here...) 
00 - End Data 
0A - Created (date) 
C3 - Data Follows 
07 - Data Length 
20 - date yy (century) 
08 - date yy (year) 
03 - date mm 
26 - date dd 
16 - date HH 
09 - date MM 
12 - date ss 
01 - Close Attribute 
03 - Open Text (Text Goes in here...) 
00 - End Data 
01 - Close Indication Tag 
01 - Close SI Tag 

有你送几个区别:

  1. 在无线会话协议报头指定的UTF-8字符集
  2. 的http://写入完全为字节,我不我认为这没有什么不同,但我们的应用程序需要它。
  3. 对指示标记没有任何操作
  4. 添加了创建的日期属性 - 这似乎对手机支持有很大的影响(我不太清楚为什么)。