Twilio phone 号码管理/架构

Twilio phone number management / architecture

嗨,我会尽量简短。

我 运行 通过设计一个国际化的 Twilio SMS 系统。我知道您可以使用 API 购买/删除号码 'on the fly',还可以使用区号作为文件管理器列出您当前购买的号码。

我的问题是我想支付本地短信费用以发送/回复,当我的新系统将有少量国际用户时,管理 phone 号码最具成本效益的方法是什么(最初在至少)?我注意到英国不提供免费电话 - 我的主要用户群...

我的粗略想法是首先为给定国家/地区的用户生成一个本地 SMS 号码,然后在下次发送该国家/地区时检查我们是否有现有号码,如果有就使用它,如果没有则购买新的,都带有 API.

这里的问题是,显然我需要清除一个月未使用的号码(以降低价格/在 Twilio 月费范围内),我不确定我该怎么做除了存储在我们的数据库中....)

这就是 API 的用途吗?即按月即时购买号码,如果在此期间再次使用,请保留现有号码,如果不购买新号码?我的重点是降低成本...

或者我是否完全忽略了这一点,也许可以获得一个国际号码并发送一次性短信而无需购买该号码一个月?

任何关于此系统最佳布局的建议或类似系统的指南都会有所帮助。

嗨,这里是 Twilio 开发人员布道师。

我会尽量分解你的问题。

given I want pay local rate text charges to send / reply, what's the most cost effective way of managing phone numbers when my new system will have a small amount of international users (initially at least)? I noticed toll free isn't available in the UK- my main user base...

如果您只是发送消息,您可以选择只购买一个号码,然后使用该号码发送所有消息。这将降低必须购买本地号码的成本。但是,如果您的用户需要回复,那么您使用本地号码(对您的客户)将是有益的,因为他们无需支付国际回复费用。可以看到从每个国家向每个国家发送消息的价格here。顺便说一句,我们在英国提供免费语音服务。

My rough idea is to first off generate a local SMS number for the user in a given country, then next time that country is sent from check if we have an existing number and if so use it, if not purchase a new one, both with the API.

这听起来不错,但要跟踪号码是否已被使用,您必须将其存储在某个地方。我的建议是使用类似 StatusCallback 的东西,它会在每次使用数字时通知您。这样,您就可以每天查询您的数据库,检查某个号码是否在最近 30 天内未被使用,然后通过 REST API.

将其删除

The problem here is that obviously I'll need to clear out numbers that haven't been used for say a month, (to keep prices down / within the Twilio monthly charge), not sure how I can do that except to store in our database....)

这是正确的(如我之前的评论所述)。将此信息存储在数据库中将使您更容易,并使您能够更明智地决定何时发布数字。如果您不想为一个号码支付月费然后在第二天发布它,因为它现在已经 30 天了,您可以选择在您的代码中加入一些逻辑来检查一个号码被使用的可能性说..下周。

So is this the way the API is intended to be used? ie purchase numbers on the fly, on a monthly basis and if used again within that time keep the existing number, if not purchase a new one? My emphasis is on keeping costs down...

这会有所不同,但大多数人倾向于保留数字而不是释放它们。这样你就有了一个属于你的号码,如果你决定再次联系你的用户,你将使用同一个号码联系,并且之前发送的消息将被很好地串接。总是从不同的号码发送消息可能会让用户不高兴,所以理想情况下我会说如果可以的话保留号码。