import os
from twilio.rest import Client
# 设置Twilio账户信息
account_sid = 'your_account_sid'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# 目标电话号码列表
phone_numbers = ['+1234567890', '+0987654321']
# 群呼消息内容
message = 'Hello, this is a test call from our service.'
# 发送呼叫
for number in phone_numbers:
call = client.calls.create(
twiml=f'{message}',
to=number,
from_='+11234567890'
)
print(f'Call sent to {number}, Call SID: {call.sid}')