Twilio找不到在轨道上
问题描述:
我整合twilio点击呼叫到我的Rails项目XML。Twilio找不到在轨道上
一切正常,但是网址:我twilio控制器不能在Heroku上找到。但是,如果您在浏览器中导航到它,可以找到它。电话拨号,但声音说:“对不起,发生了问题,再见。”如果我更改URL到正常工作的外部XML文件,只是不承认这个特殊的一个。所以我导致相信控制器等工作正常。
twillio_controller.rb
def call
@full_phone = current_user.phone
@partial_phone = @full_phone.last(-1)
@connected_number = "+61" + @partial_phone
@client = Twilio::REST::Client.new @@twilio_sid, @@twilio_token
# Connect an outbound call to the number submitted
@call = @client.calls.create(
:from => @@twilio_number,
:to => @connected_number,
:url => 'http://besttradies.herokuapp.com/mytradies/connect.xml', # Fetch instructions from this URL when the call connects
)
@msg = { :message => 'Phone call incoming!', :status => 'ok' }
end
def connect
# Our response to this request will be an XML document in the "TwiML"
# format. Our Ruby library provides a helper for generating one
# of these documents
response = Twilio::TwiML::Response.new do |r|
r.Say 'If this were a real click to call implementation, you would be connected to an agent at this point.', :voice => 'alice'
end
render text: response.text
end
答
在上述意见解决的OP:
想通了。需要连接路由进行POST,我也不得不 添加skip_before_action:verify_authenticity_token到twilio controller,因为它是后面的成员门。
想通了。需要连接路由进行POST,我也不得不加skip_before_action:verify_authenticity_token到twilio控制器,因为它是落后的成员门。 –
很高兴你把它分类! – philnash