无法解析Twilio参数

时间:2015-01-03 23:33:47

标签: twilio

Twilio初学者问题:我已按照these instructions设置了一个简单的语音邮件系统,该系统通过电子邮件发送语音邮件通知,包括来自的呼叫号码和录音链接。但是我无法获取我的代码来解析Twilio发送的参数。

这是Twiml:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Record action="mail.php" />
</Response>

这是动作的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 = "your-email@example.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: webmaster@example.com"; // Who should it come from?
mail($to, $subject, $message, $headers);

录制语音邮件并发送电子邮件,但收到的电子邮件不包含变量{$ _REQUEST ['From']}和{$ _REQUEST ['RecordingUrl']}的任何值,例如“您收到了一条消息。要收听此消息,请访问此网址:。”

希望有一些显而易见的事我在这里做错了。任何建议都是最受欢迎的。感谢。

0 个答案:

没有答案