Reputation: 142
I'm using twilio service in my rails app . I followed this tutorial. But after i run the app the message is sent to my twilio account , but i did not received any message to my mobile, other than the code in the link. I just added this code in my routes.rb:
Sms::Application.routes.draw do
get "send/sms"
root 'send#sms'
end
Send controllers code :
class SendController < ApplicationController
def sms
require 'rubygems'
require 'twilio-ruby'
@account_sid = 'AC6'
@auth_token = '2bf'
@client = Twilio::REST::Client.new(@account_sid, @auth_token)
@client.account.sms.messages.create( :from => '(954) 740-8336',:to => '+919884667438',:body => 'Hey there!')
end
end
and my sms action html file contails this :
Your message was successfully sent .
Upvotes: 1
Views: 147
Reputation: 1244
Twilio employee here.
On further inspection into your code, I noticed you're trying to send an SMS to an Indian number. The telephone networks have a lot of restrictions in India, which all companies must abide by.
The reason you are not receiving your SMS messages is because all Indian numbers are automatically opted-in to a Do Not Call Registry. You will need to opt-out your number in order to receive SMS in India.
For more information about sending / receiving SMS messages in India, check out our extensive FAQ section
You can get around this problem quickly by sending SMS to another non-Indian number, of course.
Upvotes: 1