1

I am using Twillio's sending of an SMS message,

    $client = new Client($GLOBALS['twSID'], $GLOBALS['twToken']);
    $client->messages->create(
        // the number you'd like to send the message to
        $phoneNumber,
        [
            // A Twilio phone number you purchased at twilio.com/console
            'from' => $GLOBALS['twPhone'],
            // the body of the text message you'd like to send
            'body' => $message,
            //"statusCallback" => "https://webhook.site/604faca0-e525-453d-ad8c-148118f03009"
            "statusCallback" => "https://XXXXXX.COM/XXX/webhooks/twillioStatusCallback.php"
        ]
    );

If I use the commented statusCallback to https://webhook.site... I see the status updates.

However, if I use my server (REDACTED) nothing happens.

THe php on my server is very basic, open a text file and write the contents of the status. But nothing the text file does not even get called.

Any suggestions or help???

rsirota
  • 321
  • 3
  • 15
  • 1
    It just means that `https://XXXXXX.COM/XXX/webhooks/twillioStatusCallback.php` is not populating the status updates. Either by not reflecting them, not being available from the viewpoint of the requester (Twilio) and so on. And even very basic code (which you have hidden, perhaps intentionally) may just be with flaws. So it is also an option that the code what you think it does do, does not reflect as well. Add assertions to it and check the PHP error log, it often gives hints with such kind of problems.... . – hakre Aug 17 '23 at 21:51

1 Answers1

0

You need to create one api in your project just like the statusCallback on which the twilio will send sms status as a request to your application/project!

checkout

Purvang
  • 23
  • 3