Sha256: cb7dc748e658f7477738477594aeb05759dda7fcdbbf0db7d1c1da9cf25258ba
Contents?: true
Size: 984 Bytes
Versions: 10
Compression:
Stored size: 984 Bytes
Contents
# encoding: utf-8 require 'active_support/core_ext/string/filters' module Punchblock module Translator class Asterisk module Component module StopByRedirect def execute_command(command) return super unless command.is_a?(Punchblock::Component::Stop) if @complete command.response = ProtocolError.new.setup 'component-already-stopped', "Component #{id} is already stopped", call_id, id else stop_by_redirect Punchblock::Event::Complete::Stop.new command.response = true end end def stop_by_redirect(complete_reason) component_actor = current_actor call.register_handler :ami, lambda { |e| e['SubEvent'] == 'Start' }, :name => 'AsyncAGI' do |event| component_actor.send_complete_event! complete_reason end call.redirect_back! end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems