简体   繁体   English

Twilio的脚本引擎类似于Tropo

[英]Scripting engine for Twilio similar to Tropo

Tropo has a scripting engine using which we can write code in scripting language for voice and sms applications. Tropo有一个脚本引擎,通过它我们可以用脚本语言为语音和短信应用程序编写代码。 eg the python code to answer a call looks like, 例如,接听电话的python代码如下所示:

answer()
say("thanks for calling")
transfer("tel:+1xxxxxxxxxx")
hangup()

Is there something similar available for Twilio. Twilio是否有类似的可用内容。 I see that they have Python wrapper over their SDK using which one can do something similar. 我看到他们在SDK上使用了Python包装器,使用该包装器可以执行类似的操作。 But I need to find out if there is something similar that Twilio has. 但是我需要找出Twilio是否有类似的东西。

Thanks, gg 谢谢,gg

If you need to do anything dynamic (respond in different ways based on who is calling), you'll need to provide Twilio with a URL, and then respond with TwiML at that URL. 如果您需要做任何动态的事情(根据呼叫者的方式以不同的方式响应),则需要为Twilio提供一个URL,然后在该URL上以TwiML进行响应。

You can create TwiML with Python with the helper library: Creating TwiML with twilio-python 您可以使用帮助程序库使用Python 创建TwiML:使用twilio-python创建TwiML

If you are responding to every call in the same way (eg a static reply), Twilio has Twimlets you can use to create small snippets of functionality, like say a message and then dial a new number. 如果您以相同的方式(例如, 静态回复)响应每个呼叫,则Twilio的Twimlet可用于创建功能性的小片段,例如说一条消息,然后拨打新号码。 You can host Twimlets with Twilio, so you don't need your own server. 您可以使用Twilio托管Twimlet,因此不需要您自己的服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM