将@char发送到kannel的错误

发布于 2024-12-23 14:11:54 字数 111 浏览 2 评论 0原文

当我向 kannel 发送包含 @ char 的消息时遇到问题。 例如,我发送了“@ Test”,但手机收到了一些东西 就像“我测试”一样。

这是频道错误吗?如果是这样,有人有补丁吗?

I have problem when I am send a message to kannel containing @ char.
For example I sent "@ Test" but phone received something
like "i Test".

Is this kannel bug? If so, does anybody have a patch for it?

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

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

发布评论

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

评论(1

離人涙 2024-12-30 14:11:54

@ 符号的问题在 SMS 中非常常见,因为该字符在 GSM 中的代码为 0x00,而不是 ASCII 或 UTF-8 中的 0x40。

要正确处理此字符和其他一些字符,建议在通过 Kannel 发送消息时提及以下参数:

  • 编码 - 0(默认 GSM)或 2(如果您发送 Unicode 字符)
  • 字符集 em> - 您发送到 Kannel 的字符串的字符集

这种情况下 Kannel 将通过它自己的字符转换字符(如果使用 libiconv 构建)。

示例:

http://127.0.0.1:13013/cgi-bin/sendsms?...&coding=0&charset=utf-8&text=test+@+sign

如果您通过 SMPP 连接到 SMSC,则可能会出现另一个问题。某些平台可能使用与标准不同的字符集。例如,它可以是 ASCII。

要解决此问题,您可以在配置文件的正确 group = smsc 部分使用 alt-charset 参数:

group = smsc
smsc = smpp
...
alt-charset = "ASCII"

要调试此问题,我建议为 SMSC 连接添加日志记录 log- level = 0 并检查协议转储以查看从 Kannel 发送到 SMSC 的具体内容。通常@符号应该是0x00字符。

Problem with @ sign is quite popular in SMS because of this character in GSM has 0x00 code instead of 0x40 in ASCII or UTF-8.

To process this and some other characters correctly it's recommended to mention the following parameters when sending message through Kannel:

  • coding - 0 (default GSM) or 2 (if you send Unicode characters)
  • charset - character set of string you send to Kannel

This case Kannel will convert characters by it's own (if built with libiconv).

Example:

http://127.0.0.1:13013/cgi-bin/sendsms?...&coding=0&charset=utf-8&text=test+@+sign

Another problem may happens if you connect to SMSC via SMPP. Some of platforms may use charset different from standard. For example it may be ASCII.

To resolve this you can use alt-charset parameter for proper group = smsc section of configuration file:

group = smsc
smsc = smpp
...
alt-charset = "ASCII"

To debug this I recommend to add logging for SMSC connection log-level = 0 and check for protocol dumps to see what exactly is sent from Kannel to SMSC. Normally it should be 0x00 character for @ sign.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文