class Adhearsion::CallController::Output::Player

Public Instance Methods

output(content, options = {}, &block) click to toggle source

@yield The output component before executing it @raise [PlaybackError] if (one of) the given argument(s) could not be played

# File lib/adhearsion/call_controller/output/player.rb, line 12
def output(content, options = {}, &block)
  options.merge! :ssml => content
  component = new_output options
  if block
    controller.execute_component_and_await_completion component, &block
  else
    controller.execute_component_and_await_completion component
  end
rescue Call::Hangup
  raise
rescue Adhearsion::Error, Punchblock::ProtocolError => e
  raise PlaybackError, "Output failed due to #{e.inspect}"
end