7BIT 编码 长短信

32 篇文章 0 订阅

5.5.4. UDH and Information Elements

User Data Headers (UDH) are a very general framework used by binary SMS in GSM networks to transmit special binary data associated with the message. An understanding of User Data Headers is a prerequisite to many of the binary SMS topics in the rest of the chapter.

When an SMS message is delivered to a phone over a GSM network, it contains both the usual 140 bytes of data and separate flags that record the encoding used by the data (GSM, UCS-2, or binary) and the presence of a User Data Header (UDH) at the beginning of the message.

5.5.4.1. Size and alignment

When there is a UDH, it is part of the 140 bytes of data, which then include the UDH followed by the SMS text or binary data. The total size of UDH plus text/data must stay within the 140-byte limit.

In most cases, the conversion between ASCII and GSM text is done by the network operators, and SMPP connections to a gateway usually require you to send ASCII characters instead of GSM ones. In that case, to send a UDH you just send the UDH followed by the 8-bit ASCII characters. But if you are expected to send 7-bit GSM text, you need to manually concatenate the UDH and the following 7-bit GSM text: make sure that the 7-bit GSM text starts on a 7-bit boundary by adding filling bits (if required) between the UDH and the 7-bit GSM text. "Filling bits" could be 1 or 0; they are ignored by the phone.

For example, if your UDH is 6 bytes (which is common for fragments of concatenated messages, as explained later in this chapter), you still have 134 bytes to send 7-bit GSM data. 134 bytes is 153 GSM characters and 1 bit. You need to add this one filling bit before the 7-bit GSM data, not afterwards., So your message will consist of the UDH (6 bytes), 1 filling bit, and 153 GSM characters. The UDH takes up 48 bits (6 bytes of 8 bits each), and adding the filling bit brings the total to 49, a multiple of 7 so the GSM text is aligned on a 7-bit boundary. It is also aligned with the end of the message, so there is no waste in the 140 available bytes.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值