我需要帮助来设置 Twilio 语音信箱。我想我已经正确设置了所有内容,当有人提交语音消息时,我的电子邮件上收到了语音消息,但是当人们尝试提交语音消息时,Twilio 会自动说“对不起,您尝试呼叫的人有语音邮箱,但尚未设置”,然后可以提交语音邮件。谁能告诉我为什么我从 Twilio 收到这条消息?
我已经设置了如下语音邮箱:
<Dial>++1xxxxxxxxx</Dial>
<Say voice="woman">Please, leave a message after the tone and press the # when you are finished.</Say>
<Record action="mail.php" method="POST" maxLength="120" playBeep="true" />
而 mail.php 是:
<?php
/**
* This section ensures that Twilio gets a response.
*/
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<Response></Response>'; //Place the desired response (if any) here.
/**
* This section actually sends the email.
*/
$to = "example@gmail.com"; // Your email address.
$subject = "Message from {$_REQUEST['From']}";
$message = "You have received a message from {$_REQUEST['From']}.";
$message .= "To listen to this message, please visit this URL: {$_REQUEST['RecordingUrl']}";
$headers = "From: voicemail@twimlets.com"; // Who should it come from?
mail($to, $subject, $message, $headers);