Class: Punchblock::Translator::Freeswitch::Component::AbstractOutput

Inherits:
Component
  • Object
show all
Defined in:
lib/punchblock/translator/freeswitch/component/abstract_output.rb

Direct Known Subclasses

Output, TTSOutput

Constant Summary collapse

UnrenderableDocError =
Class.new OptionError

Instance Attribute Summary

Attributes inherited from Component

#call, #call_id, #id

Instance Method Summary collapse

Methods inherited from Component

#application, #call_ended, #handle_es_event, #initialize, #logger_id, #send_complete_event, #send_event, #setup

Methods included from ActorHasGuardedHandlers

#execute_guarded_handlers_on_receiver

Methods included from DeadActorSafety

#safe_from_dead_actors

Constructor Details

This class inherits a constructor from Punchblock::Translator::Freeswitch::Component::Component

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
# File 'lib/punchblock/translator/freeswitch/component/abstract_output.rb', line 10

def execute
  validate
  send_ref
  do_output
rescue UnrenderableDocError => e
  with_error 'unrenderable document error', e.message
rescue OptionError => e
  with_error 'option error', e.message
end

#execute_command(command) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/punchblock/translator/freeswitch/component/abstract_output.rb', line 20

def execute_command(command)
  case command
  when Punchblock::Component::Stop
    command.response = true
    application 'break'
    send_complete_event Punchblock::Event::Complete::Stop.new
  else
    super
  end
end