سؤال

I have downloaded the Twilio API (PHP) and I was able to invoke the sms_messages->create successfully. I have read the documentation more than three times and checked here also. However my messages are not getting delivered to my cellphone.

My PHP code looks like this.

    <?php
    require_once('Services/Twilio.php');
    $sid = "AC02c3c69xxxxxxxxxxxxxxxxxxxxxxx";
    $token = "f3c343716xxxxxxxxxxxxxxxxxxxxx";
    $client = new Services_Twilio($sid, $token);
    $message = $client->account->sms_messages->create("+1404xxxxxxxxx","+919842xxxxxx", "hello good evening", array());
    echo $message->sid;

The response is given below.

    SMac841db0f52100f66c754974037b7960
    SMd32abd4234142f3662bcaec6dc8722be
    SMb75a7e89643d9d515f48a031fb480f3c

The above code returns the message ID, but still now I have not received the message.

FYI - The message is to be delivered to India mobile and the parameter I have used is +91<10 digit mobile number>

Did I go wrong somewhere? Is my message queued or scheduled for later delivery?

هل كانت مفيدة؟

المحلول

Your code looks great! Unfortunately delivery to Indian mobile numbers from Twilio is tricky due to the high amounts of spam messages delivered to Indian mobile devices, and government regulations about what messages you can send and when. There is a handy guide here, that will help you ensure your messages get delivered to Indian phone numbers.

https://www.twilio.com/help/faq/sms/are-there-limitations-on-sending-sms-messages-to-indian-mobile-devices

نصائح أخرى

You Are Code is good but your phone number is checked to DND Activate.to check the below link.

http://www.nccptrai.gov.in/nccpregistry/search.misc

Please you can used Not DND activate phone.

Here is what the reply from the customer support for my query.

Hi Hasan,

Thanks for the report. Unfortunately it looks like the problem is that the phone number that was sent to +91984xx-xxxxx is registered here:

http://www.nccptrai.gov.in/nccpregistry/

Twilio SMS messages sent to India are considered promotional messages and cannot be delivered to registered phone numbers. In the future we may have the API return an error when you try to send to a registered phone number, provided that we can check the registration status in real-time.

Please let us know if you have any other questions about this issue.

Alex Chan
Twilio Customer Support
www.twilio.com

Thanks again for all the help so far.

Check your message status after the

$message = $client->account->sms_messages->create("+1404xxxxxxxxx","+919842xxxxxx", "hello good evening", array());

echo $message->status;

this will return your message status.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top