如何使用 Twilio 处理电话号码的差异?

发布于 2025-01-14 11:03:46 字数 237 浏览 4 评论 0原文

工具

Django - Twilio WSP API

上下文

我向自己的号码发送了一条消息 +54 9 (1234) 123456

但是当我回复时,Twilio 收到了来自 +54 (1234) 123456 的消息

问题

如果我保存“+54 9 (1234) 123456”在数据库中并接收来自“+54 (1234) 123456”的验证我无法找到匹配项来验证。

Tools

Django - Twilio WSP API

Context

I send a message to my own number as +54 9 (1234) 123456

But when I answer back Twilio receives the msg from +54 (1234) 123456

Problem

If I save "+54 9 (1234) 123456" in the database and receive validation from "+54 (1234) 123456" I can't get a match to verify.

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

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

发布评论

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

评论(1

浮华 2025-01-21 11:03:47

这是一个有趣的问题!我必须对阿根廷的数据进行一些研究,看看这里发生了什么。

根据维基百科

要将 SMS 文本消息发送到其他国家/地区的阿根廷手机,拨打语音呼叫号码时国际使用的 9(以及阿根廷国内呼叫使用的 15)将被省略。例如,如果阿根廷的手机号码为 (11) 15 1234–5678,则从国外拨打语音电话将拨打 +54 9 11 1234 5678,但短信则需要拨打 +54 11 1234 5678,并加上 +54 9 11 1234 5678 通常无效。如果收到来自阿根廷的短信,回复可以发送到显示为发件人的号码。并非阿根廷的所有移动提供商都与世界上的每个运营商都有短信协议,因此可能无法发送国际短信。

看起来,当 Twilio 收到来自阿根廷号码的消息时,它不会包含 9。您最好将两种形式的号码(包含和不包含 9)存储在数据库中,这样您就可以使用它来发送并接收消息。

我没有真正的阿根廷手机号码可供测试,但您可能会发现 Twilio Lookup API可以帮助您格式化数字。

This is an interesting problem! I had to go do some research on Argentinian numbers to see what was happening here.

According to Wikipedia:

To send an SMS text message to an Argentine cell phone from another country, the 9 used internationally when dialing the number for a voice call (and the 15 used for calls within Argentina) is omitted. For example, if the mobile number in Argentina is (11) 15 1234–5678, a voice call from abroad would be dialled as +54 9 11 1234 5678, but a text message would require +54 11 1234 5678, with +54 9 11 1234 5678 usually being invalid. If a text message is received from Argentina, the reply can be sent to the number displayed as the sender. Not all mobile providers in Argentina have SMS agreements with every carrier in the world, so it may not be possible to send an international SMS.

It seems that when Twilio receives a message from an Argentinian number it will do without the 9. It might be best for you to store the number in both forms (with and without the 9) in your database, so you can use it to send and receive messages.

I don't have a real Argentinian mobile number to test with, but you might find that the Twilio Lookup API can help you format numbers.

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