此 Twilio API 示例代码在 Rails 3 中不起作用:
#voice_controller.rb
def reminder
@postto = BASE_URL + '/directions'
respond_to do |format|
format.xml { @postto }
end
end
#reminder.xml.builder
xml.instruct!
xml.Response do
xml.Gather(:action => @postto, :numDigits => 1) do
xml.Say "Hello this is a call from Twilio. You have an appointment
tomorrow at 9 AM."
xml.Say "Please press 1 to repeat this menu. Press 2 for directions.
Or press 3 if you are done."
end
end
有任何想法吗?
Twilio 似乎成功拨打了电话(我可以看到带有我的电话号码、位置等的参数),但随后返回了这个模糊的响应代码:
Completed 406 Not Acceptable in 0ms