How to use User Data in smpp?

送分小仙女□ 提交于 2019-12-11 05:39:54

问题


How to use User Data(UDH) in smpp? Now I want to send sms specified port.

I use OpenSMPP as my project lib..


回答1:


Follow these steps to send UDH over SMPP:

  • Set the UDHI bit to 1 on the esm_class field. The simplest way to do this - esm_class = esm_class | 0x40.
  • Put UDH at the beginning of short_message field. Read on for a quick summary. See the references to know in details how to encode UDH.

Here is how to encode UDH:

  • The first byte of UDH must mention the length (in bytes) of remaining part of UDH. Since you may not know this ahead, you may have to calculate it later on.
  • Then follows one or more IE (Information Element). Each IE has 3 parts:
    • First byte: IEI (IE Indicator). Identifies the element you want to encode. There are established IEI.
    • Second byte: IEIDL (IEI Data Length). Identifies the number of bytes that holds the data part. Each established IEI has fixed value for this field.
    • Third byte and rest part: IEID (IEI Data): Holds the data part. Each established IEI has fixed format of the data.
  • Count the total bytes consumed by each IE and put the result in the first byte.

For sending SMS to a part, you can use IEI 0x04 or 0x05. I have only seen 0x05 being used.

References

  • 3GPP specification: 23.040
  • User Data Header


来源:https://stackoverflow.com/questions/16351463/how-to-use-user-data-in-smpp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!