【问题标题】:Call forwarding with twimlets in Django App在 Django App 中使用 timlets 进行呼叫转移
【发布时间】: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


    【解决方案1】:

    成功了!我正在使用 Twilio 试用帐户,所以我需要验证所有未使用的手机。 但是在 timlets URL 中传递变量“lead_uni”仍然没有到位。

    【讨论】:

    • 不太确定你想用 url 变量实现什么?您能否再解释一下,什么有效或无效?我很乐意提供帮助。
    • 谢谢@philnash,问题已解决。url='twimlets.com/forward?PhoneNumber='+lead_str这是需要做的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多