无法让 twilio 收集工作
我正在使用 twilio 呼叫用户,但在收集用户输入时遇到问题。最初的呼叫工作正常,但当我按 1 或 3 时,似乎没有任何反应,并且在 3 秒暂停后,它继续进行。
//This works fine, I can call and hear the options being read.
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Gather action="https://mydomain.com/twilio/process_response.php" method="post" numDigits="1" timeout="3">
<Say>I can hear this.</Say>
<Say>Press 1.</Say>
<Say>Press 3.</Say>
</Gather>
<Say>It looks like you didn't select an option.</Say>
</Response>
响应 - https://mydomain.com/twilio/process_response.php
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Say>I should hear this, but I dont...</Say>
</Response>
谢谢!
I'm using twilio to call a user and am having trouble collecting the users input. The initial call works fine, but when I press 1 or 3, nothing appears to happen, and after the 3 second pause, it keeps going.
//This works fine, I can call and hear the options being read.
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Gather action="https://mydomain.com/twilio/process_response.php" method="post" numDigits="1" timeout="3">
<Say>I can hear this.</Say>
<Say>Press 1.</Say>
<Say>Press 3.</Say>
</Gather>
<Say>It looks like you didn't select an option.</Say>
</Response>
The response - https://mydomain.com/twilio/process_response.php
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Say>I should hear this, but I dont...</Say>
</Response>
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
该问题是由我用来测试的无绳电话无法识别输入引起的。更换手机“解决”了这个问题。
The issue was caused by the cordless phone I was using to test not recognising the input. Changing phones "solved" this issue.
通过收听 DTMF 来工作您的手机或设备发出的声音。那些会使您难以听清对方所说内容的事情也会使 Twilio 难以识别 DTMF 音调。手机信号接收不良、背景噪音过多或存在大量静电的连接都会导致
难以识别数字按键。此外,VoIP 电话可以默认安装非标准的 DTMF 音,Twilio 也难以识别。 VoIP 电话也可能使用相当强的压缩,这可能会干扰 DTMF。无论哪种情况,下一步通常最好咨询手机手册或安装手机的人员。
基于浏览器或应用程序的 VoIP(例如 Skype 或 Google Voice)有时也会遇到
问题,原因与 VoIP 电话出现问题的原因相同。Twilio 的
疑难解答链接:http:// www.twilio.com/docs/api/twiml/gather#troubleshooting<Gather>
works by listening to the DTMF sounds that your phone or device produces. Things that would make it difficult for you to hear what a person on the other end is saying can also make it difficult for Twilio to recognize DTMF tones. Poor mobile phone reception, excessive background noise, or connection that has lots of static can all make it difficult for<Gather>
to recognize digit presses.In addition, VoIP phones can be installed with a non-standard DTMF tones as the default, which Twilio will also have difficulty recognizing. VoIP phones might also be using pretty strong compression which can interfere with DTMF. In either case, consulting the phone's manual or the person who installed the phone is usually a good next step.
Browser or application based VoIP, like Skype or Google Voice, sometimes also have trouble with
<Gather>
for the same reasons VoIP phones have trouble.Twilio's
<Gather>
troubleshooting link: http://www.twilio.com/docs/api/twiml/gather#troubleshooting从他们的文档来看,action 属性似乎只能包含“/page.php”或“page.php”。您需要删除协议和主机部分。所以:
From looking in their documentation, it appears that the action attribute can only contain "/page.php" or "page.php". You'll need to drop the protocol and host portion. So:
我也遇到过同样的问题。
后来我发现这个问题在附加finishOnKey后就消失了,即#
或任何其他'自定义 finishOnKey'
I have faced the same issue.
Later, I found this issue disappeared after appending finishOnKey ie #
or any other 'custom finishOnKey'
面临同样的问题。
附加 finishOnKey 也不起作用。
我的解决方案是使用语音识别(input =“speech”),即不使用DTMF,这不够可靠。
Faced the same issue.
Appending finishOnKey didn't work either.
My solution was to use speech recognition (input="speech"), i.e. not using DTMF, which is not reliable enough.