1

I am using a Twilio (Trial) account with number of Houston, TX to send SMS from my application. I am sending SMS to verified Indian number and that works perfectly. But when I am replying back to Twilio (already set webhook url as per documentation), it is not sending message back. It fails with message

Message not sent

Also the twilio number from which the message is received in phone is not shown.

Girish Vadhel
  • 735
  • 1
  • 5
  • 17
  • Any body can send a SMS provided you go through a portal to a phone number. The return message on a PC which is outside the SMS network has to go to an email account. – jdweng Jan 10 '18 at 15:24

1 Answers1

2

Twilio developer evangelist here.

There are some restrictions when it comes to sending SMS messages to India. You can read up on our guidelines for sending SMS to India here.

The important part in this case is that:

Sender ID for international number will be replaced with XX-NNNNNN (2 letters followed by 6 numbers).

Basically, that means that the original sending number won't be sent to the user's phone. So, you can't respond directly to it.

You should be able to take your Houston Twilio number, enter that in the Indian phone and send an SMS to it which will be received by Twilio. You just can't reply directly to the message you sent from Twilio.

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • thanks a lot for the reply, sending SMS back to twilio number instead of replying, worked for me. I need some more help related how can I track the message sent from that phone in the service (webhook) I provided to twilio? The document suggests Add-ons for that. Can you please guide me with this? – Girish Vadhel Jan 11 '18 at 10:09
  • Not sure what you're asking there. What do you want to track? – philnash Jan 11 '18 at 23:51
  • I just want the reply body sent by the user in my application. I want the response whether user has replied with Yes or No. – Girish Vadhel Jan 12 '18 at 08:31
  • 1
    Oh, the message that the user sends is sent to your URL in the webhook as form encoded parameters, you want the `Body` parameter. See the documentation here for more details: https://www.twilio.com/docs/api/twiml/sms/twilio_request – philnash Jan 14 '18 at 22:48
  • Many thanks. Is there anything that we can keep track of each message thread? I want some Id to be attached with the message I send and get it back from the message that I receive to my twilio number, when user replies with Yes or No. Is it possible? – Girish Vadhel Jan 16 '18 at 15:15
  • No, that's not possible, there isn't an available message ID or reply-to style format in SMS. If you are planning on having multiple simultaneous conversation threads with one user then I recommend using a different Twilio number for each thread. – philnash Jan 16 '18 at 23:16
  • Ok, can I get the messageSid of the original message that user is replying to, in replied message? I just want to confirm if the user has replied to a particular message sent to him or not, in case of multiple messages sent to him. – Girish Vadhel Jan 17 '18 at 07:34
  • 1
    No, you can't. It's a limitation of SMS messaging rather than of Twilio. There's no way to reply to a specific message with SMS, you can test this yourself by opening your SMS app on your phone and trying to reply to anything but the last message from any of your contacts. If you need to have multiple conversations at the same time, you should use different Twilio numbers per conversation, otherwise, build your system so that there's only one active conversation at a time. – philnash Jan 17 '18 at 12:51
  • Thanks, I have implemented it in manner that it will have only one active conversation at a time. – Girish Vadhel Jan 17 '18 at 14:06