app/controllers/ivr/calls_controller.rb
# Public: initiates a new outgoing call to congress. If ENV FAKE_CONGRESS_NUMBER is
# set, then the all calls will be routed to that number.
#
# CallSid - default param from twilio (required)
initiates a new outgoing call to congress. If ENV FAKE_CONGRESS_NUMBER is
set, then the all calls will be routed to that number.

default param from twilio (required)
initiates a new outgoing call to congress . If ENV FAKE_CONGRESS_NUMBER is set then the all calls will be routed to that number . default param from twilio ( required )
def new_connection
    response = Twilio::TwiML::Response.new do |r|
      if active_call.next_target.present?
        connection = active_call.create_connection!
        play_audio(r, connection.connecting_message_key)
        play_audio(r, 'star_to_disconnect')
        target_number = ENV['FAKE_CONGRESS_NUMBER'] || connection.legislator.phone
        r.Dial target_number, 'action' => ivr_calls_connection_gather_prompt_url, 'hangupOnStar' => true, 'callerId' => caller_id
      else
        close_call(r)
      end
    end
    render_twiml response
  end
def new_connection response = Twilio :: TwiML :: Response . new do | r | if active_call . next_target . present? connection = active_call . create_connection! play_audio ( r , connection . connecting_message_key ) play_audio ( r , 'star_to_disconnect' ) target_number = ENV [ 'FAKE_CONGRESS_NUMBER' ] || connection . legislator . phone r . Dial target_number , 'action' => ivr_calls_connection_gather_prompt_url , 'hangupOnStar' => true , 'callerId' => caller_id else close_call ( r ) end end render_twiml response end
Public: initiates a new outgoing call to congress.
Public : initiates a new outgoing call to congress .