2

这是场景:在生产中,我想发送和接收短信。在 qa 中,我想将可以发送到的号码列入白名单,并在特定于 qa 的 url 处接收短信。在测试中,我想将可以发送到的号码列入白名单,并在特定于测试的 url 处接收短信。

据我所知,在 twilio 中执行此操作的唯一/最佳方法是设置三个不同的电话号码和三个不同的 TwiML 应用程序,以使 URL 都指向传入消息的正确位置。

我错过了什么吗?有没有其他方法可以做到这一点?

4

1 回答 1

2

Twilio must send all inbound SMS to a phone number to the same URL, so if you only had one number, you could only use one endpoint for inbound SMS. However, at that endpoint you could have specific handling logic for messages based on the number that is sending an inbound SMS. So if you are sending all of your test messages from +12345, at your URL endpoint you could check for a From address matching +12345 and handle that specially, otherwise use your regular production logic.

Otherwise yes, I believe you'd have to register separate numbers to do what you want :(

于 2012-07-05T08:49:30.403 回答