我有一个接受MMS消息的PHP休息服务器。我可以接受这些图片就好了,但是我想回复一下,回复一下"得到你的照片,谢谢!"但有时只会发送。我使用Twilio将消息与PHP连接起来,PHP必须在MySQL中存储数据,然后通知移动设备新照片。我可以随机看到Twilio日志 回复一些而不是其他人。
我做错了什么会使响应只发送几次?
require('../twilio-twilio-php-9d8bb7d/Services/Twilio.php');
include_once 'DBConnect.php';
include_once 'gcm.php';
$account_sid = "AC...5b"; // Your Twilio account sid
$auth_token = "5e0..5"; // Your Twilio auth token
$client = new Services_Twilio($account_sid, $auth_token);
header('Content-type: text/xml');
// Create a TwiML response object - this object helps us generate an XML string
// that we will output as the respnse of this request
$response = new Services_Twilio_Twiml();
$message = $response->message();
$message->body(' thanks for sending');
print $response;
if ( isset($_POST['NumMedia']) && $_POST['NumMedia'] > 0 ){
<snip>
process image into DB, notify mobile devices, etc)
</snip
}