您好,我是 twilio 的新手。我为学校构建了一个小项目,收集了一些详细信息(如帐号、邮编、街道号)编译的脚本是:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="dtmf" numDigits="5" timeout="20" finishOnKey="#" action="http://mywebsite.com/handle-user-input.php">
<Say voice="woman">Welcome</Say>
<Say voice="woman" language="es">para servicio en espaniol marque 9</Say>
<Say voice="alice">For account access, or questions, enter your account number followed by pound</Say>
<Say voice="alice">For everything else, say other options </Say>
</Gather>
<!-- If they didnt put an input say this then retry -->
<Say voice="woman">For account access, say or enter your acount number, one digit at a time, followed by pound. You can also say "other options" or press 2</Say>
<Redirect>http://mywebsite. com/handle-incoming-call.xml</Redirect>
</Response>`
和 handle-user-input.php 内容是:
<?php
echo '<?xml version="1.0" encoding="UTF-8"?>';
$digits = $_REQUEST['Digits'];
if ( $digits == 5 ) {
} else {
echo '<Response>';
echo '<Say voice="alice">Thank you, redirecting you to your account</Say>';
echo '<Redirect>second_step.xml</Redirect>';
echo '</Response>';
}
现在,我不想每次都从 Twilio 仪表板获取我收到的详细信息。我听说我可以在我的网站上的 .txt 或日志中检索“结果”。我到处搜索,但找不到这个脚本!找到了一些 fwrite() 函数,但我无法正确格式化所有内容。请帮忙!