這Twilio API示例代碼是不是在Rails 3的工作:Rails 3的XML生成器/ Twilio API
#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似乎已成功打來電話(我可以看到PARAMS有我的電話號碼,位置等),但然後返回這個模糊的響應代碼:
Completed 406 Not Acceptable in 0ms
你把XML生成器文件放在哪裏? – 2011-06-06 20:46:10