将变量从“twilio:gather_start”传递到事件KRL 中的命令
我正在编辑 KRL/Twilio 应用程序,并且有一个收集用户输入的事件。是否可以将变量传递到 "gather_start" 触发的事件中?以下是我到目前为止尝试过的不起作用的方法(在本例中,它试图将 var“color”传递为“red”):
twilio:gather_start("choice") with action="choice?color=red" and numDigits = "1" and timeout = "5" and color = "red" and parameters = {"color":"red"};
似乎持久变量可能是最好的(设置类似“ent:color”的内容)到“红色”),但听起来应用程序持久变量还不可用? TIA。
I'm editing a KRL/Twilio app, and I have an event that gathers input from the user. Is it possible to pass a variable into the the event that "gather_start" fires? Here are the ways I've tried so far that don't work (in this case it's trying to pass the var "color" as "red"):
twilio:gather_start("choice") with action="choice?color=red" and numDigits = "1" and timeout = "5" and color = "red" and parameters = {"color":"red"};
Seems like persistent vars might be best (set something like "ent:color" to "red"), but it sounds like application persistent vars aren't available yet? TIA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的方法是持久变量。应用程序变量是一种选择,但您可能想要的是实体变量。 Kynetx Webhooks 与 Twilio 的 cookie jar 配合使用,产生一个在 kynetx 应用程序中维护实体变量的会话。
每个电话都有自己的会话,因此您无需担心多个同时通话相互干扰。
应用程序持久变量(使用
app:myvar
而不是ent:myvar
)可以工作,但对于应用程序来说是全局的,因此仅应在变量作用域为该应用程序。以下是证明这一点的一些规则:
The right way to do this is persistent variables. App variables are one option, but what you probably want is entity variables. Kynetx Webhooks work with Twilio's cookie jar, resulting in a session that maintains entity variables in kynetx apps.
Each phone call gets a session of it's own, so you don't need to worry about multiple simultaneous calls stepping on each other.
App persistent variables (use
app:myvar
instead ofent:myvar
) will work, but are global to the application, so they should only be used when the variables are scoped to the app.Here's a few rules that demonstrate this: