Python smspdu输出的PDU表单无效

2024-05-29 11:15:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在编写一个脚本,将与telnet通信,并将要求短信发送。我使用的协议要求消息以PDU格式转换为BASE64。你知道吗

当我使用websites like this one手动操作时,一切都正常。你知道吗

在Python中,我使用smspdu。我测试了它,显然PDU返回是无效的。你知道吗

from smspdu import SMS_SUBMIT

sender = ''
target = "+48000000000"
msg = 'Hello World'
msg = SMS_SUBMIT.create(sender, target, msg)
print(msg.toPDU())

此代码输出:

010016D02B1A0E0683C16030180C0600000BC8329BFD065DDF723619

虽然提到的网站返回:

0011000B918400000000F00000AA0BC8329BFD065DDF723619

有人能帮忙确定为什么会这样吗?你知道吗


Tags: 脚本消息协议target格式msgsms短信

热门问题