Hello I am new at twilio. I build a small project for school that gathers some details (like account number, zip, street number) The compiled script is:
<?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>`
and handle-user-input.php content is:
<?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>';
}
Now, I don't want to go get the details I receive every-time, from Twilio dashboard. I heard I can retrieve the "results" in a .txt on my website, or a log. I searched everywhere but I couldn't find a script for this! Found some fwrite() functions but I can't format everything correctly. Please help!