【发布时间】:2017-08-10 07:10:23
【问题描述】:
我正在我的 Django 应用程序中实现 Twilio 呼叫功能,其中我想拨打指定号码的电话,在有人接听电话后,它应该将呼叫连接到另一个电话号码。 这是我已经实现的以使呼叫功能运行,但我无法将其转发到所需的号码。
def call(country_code, to, lead_cc, lead_no, configuration):
account_sid = "XXX22a62f54bXXXXXXXXXXXXX"
auth_token = "XXXXXa61188eXXXXXXXXXXX"
client = Client(account_sid, auth_token)
no_str = str(country_code) + str(to[0])
no_uni = unicode(no_str)
lead_str = str(lead_cc) + str(lead_no[0])
lead_uni = unicode(lead_str)
client.calls.create(from_="+17xxXXXXX",
to=no_uni,
url= 'http://twimlets.com/forward?PhoneNumber=+91xxxxxxxxx')
另外,我需要像这样在 URL 中传递“lead_uni”,但它现在可以工作了 (url= 'http://twimlets.com/forward?PhoneNumber=lead_uni')。请建议!
【问题讨论】:
标签: django twilio twilio-click-to-call