I have implemented Twilio SMS response from Youtube video (its just one minute video) This works for all the cases but if I receive a text from Google Pixel I am not able to respond I am storing all the SMS response into the database but I am not able to store the ones coming from Google Pixel.
<?php
header('Content-Type: text/xml');
include "config.php";
require __DIR__ . '/Twilio/autoload.php';// Loads the library
// prepare and bind
$stmt = $con->prepare("INSERT INTO sms (MessageSid, smsFrom, smsTo, Body, timeStamp) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("sssss", $MessageSid, $FromNumber, $ToNumber, $body, $timeStamp);
$FromNumber = isset($_POST['From']) ? $_POST['From'] : '0';
$body = isset($_POST['Body']) ? $_POST['Body'] : '0';
$MessageSid = isset($_POST['MessageSid']) ? $_POST['MessageSid'] : '0';
$ToNumber = isset($_POST['To']) ? $_POST['To'] : '0';
$timeStamp = date("Y-m-d H:i:s");
$stmt->execute();
$stmt->close();
$con->close();
?>
What twilio does is they will allow us a web-hook and we can get the response. I can see SMS in their logs and my web-hook is executed successfully but there is nothing stored in our DB. any ideas on how to debug it? I tried sending emails with all the values but it throws me an error as this is an xml file.