如何使用 Twilio 处理电话号码的差异?
工具
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个有趣的问题!我必须对阿根廷的数据进行一些研究,看看这里发生了什么。
根据维基百科:
看起来,当 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:
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.