发送wap推送

发布于 2024-12-23 02:50:12 字数 1199 浏览 1 评论 0原文

我尝试发送wap推送消息。我设置数据编码 0xf5 并发送带有以下消息的提交 sm:

GSM 短消息服务用户数据

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

无线会话协议,方法:推送(0x06),内容类型:application/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)"

    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 -回复:“好的”。 但手机上却没有任何显示。有什么想法吗? 抱歉我的英语很糟糕:)

I try send wap push message. I set datacoding 0xf5 and send submit sm with following message:

GSM Short Message Service User Data

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

Wireless Session Protocol, Method: Push (0x06), Content-Type: application/vnd.wap.sic

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

WAP Binary XML, Version: 1.2, Public ID: "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1 .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

Data representation:

    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>

Message bytes:

    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 return: Submit_sm - resp: "OK".
But the phone did not show nothing. Any ideas?
Sorry for my ugly english :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨小墨 2024-12-30 02:50:12

我无法完全证明这些变化为何有效,但从几年前的广泛测试来看,以下内容似乎可以在英国网络和一系列不同的手机上可靠地工作。它已在生产代码中使用,此后我们没有看到任何问题。

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. 无线会话协议标头
  2. http:// 上指定的 UTF-8 字符集完全写为字节,我不认为这有什么不同,但我们的其余部分需要它应用。
  3. 对指示标签没有任何操作
  4. 添加了创建日期属性 - 这似乎对手机支持产生了很大的影响(我不太确定为什么)。

I can't fully justify why these changes work, but from extensive testing a few years back the following seemed to work reliably across the UK networks and a range of different handsets. It's in use in production code and we haven't seen any problems since.

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

There are a few differences to your send:

  1. UTF-8 Character set specified on the Wireless Session Protocol header
  2. http:// is written in full as bytes, I don't think this made a difference but it was required by the rest of our application.
  3. No action on the indication tag
  4. Added a created date attribute - This seemed to make a big difference to handset support (I'm not quite sure why).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文