一次拨打10个以上的号码

时间:2016-08-22 05:52:13

标签: twilio

我们需要同时实施GSM呼叫,但正如文档(https://www.twilio.com/docs/api/twiml/number)中所述,“您可以在动词中指定最多十个同时拨打的号码”,这看起来非常严格。

有人可以为此建议解决方法吗?

1 个答案:

答案 0 :(得分:1)

您可以通过REST API执行此操作:https://www.twilio.com/docs/api/rest/making-calls

一个简单的例子看起来像这样:

# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# The following grabs a list of numbers that have sent a message to my Twilio number.
call_list = client.messages.list(to='+1415XXXXXXX')

# Then loop through all the numbers in the list and send a call from Twilio number via REST API.
for c in call_list: 
    client.calls.create(to=c.from_, from_="+1415XXXXXXX", url='YOUR_VOICE_URL')