作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在编辑 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。
最佳答案
做到这一点的正确方法是持久变量。应用程序变量是一种选择,但您可能想要的是实体变量。 Kynetx Webhooks 与 Twilio 的 cookie jar 一起工作,从而产生一个在 kynetx 应用程序中维护实体变量的 session 。
每个电话都有自己的 session ,因此您无需担心多个同时通话会相互干扰。
应用程序持久变量(使用 app:myvar
而不是 ent:myvar
)将起作用,但对应用程序来说是全局的,因此它们应该只在变量出现时使用仅限于应用程序。
这里有一些规则可以证明这一点:
rule firstquestion {
select when twilio firstquestion
{
twilio:gather_start("firstanswer");
twilio:say("Question One");
twilio:gather_stop();
}
}
rule firstanswer {
select when twilio firstanswer
pre {
firstchoice = event:param("Digits");
}
{
twilio:gather_start("secondanswer");
twilio:say("Question Two");
twilio:gather_stop();
}
fired {
set ent:firstchoice firstchoice;
}
}
rule secondanswer {
select when twilio secondanswer
pre {
firstchoice = ent:firstchoice;
secondchoice = event:param("Digits");
}
noop();
}
关于krl - 从 KRL 中的 "twilio:gather_start"命令将变量传递给事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4382862/
我正在编辑 KRL/Twilio 应用程序,并且我有一个收集用户输入的事件。是否可以将变量传递给 "gather_start 的事件? “火灾?这是我迄今为止尝试过但不起作用的方法(在这种情况下,它试
我是一名优秀的程序员,十分优秀!