私の目標は、着信を選別してボイスメールに送信できるようにすることです。以下のコードはスクリーニングを正しく行いますが、電話に出てから電話を切ると、ボイスメールに転送されるのではなく、通話が切断されます。どうすればこれを達成できますか?
<Say>Please wait while we connect you to Aaron. Calls may be recorded for quality assurance purposes.</Say>
<Dial action="voicemail.php?email=aaron" timeout="15">
<Number url="screen-caller.xml">+11231231234</Number>
</Dial>
screen-caller.xml:
<Response>
<Gather action="handle-screen-input.php" numDigits="1">
<Say>To accept, press 1.</Say>
</Gather>
<!-- If customer doesn't input anything, prompt and try again. -->
<Say>Sorry, I didn't get your response.</Say>
<Redirect>screen-caller.xml</Redirect>
</Response>
ハンドル-画面-input.php:
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<Response>';
$user_pushed = (int) $_REQUEST['Digits'];
if ($user_pushed == 1)
{
echo '<Say>Connecting. Calls are recorded.</Say>';
}
else {
echo '<Hangup />';
}
echo '</Response>';
voicemail.php:
header("content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
$email = $_REQUEST['email'];
?>
<Response>
<?php if ($_REQUEST['DialCallStatus'] == 'completed') { ?>
<Hangup/>
<?php } else { ?>
<Say>Please leave a message at the beep. Press the star key when finished.</Say>
<Record transcribe="true" action="goodbye.php" transcribeCallback="voicemail-send.php?email=<?php echo $email; ?>" maxLength="120" finishOnKey="*" />
<Say>I did not receive a recording.</Say>
<Redirect>voicemail.php</Redirect>
<?php } ?>
</Response>