This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TwilioBaseController < ActionController::Base | |
| before_filter :authenticate_twilio_request | |
| private | |
| def authenticate_twilio_request | |
| twilio_sig = request.headers['HTTP_X_TWILIO_SIGNATURE'] | |
| render :xml => (Twilio::TwiML::Response.new {|r| r.Hangup}).text and return if twilio_sig.blank? | |
| twilio_validator = Twilio::Util::RequestValidator.new("YOUR TWILIO AUTH TOKEN") | |
| params_for_auth = (request.post? ? env['rack.request.form_hash'] : {}) |
NewerOlder