Sha256: b4b0da0f920c06b29f9c9460c8cf7540e0a6cc09318dca804db95826da879040

Contents?: true

Size: 847 Bytes

Versions: 24

Compression:

Stored size: 847 Bytes

Contents

# encoding: utf-8

module Punchblock
  module Translator
    class Freeswitch
      module Component
        class Input < Component

          include InputComponent

          def execute
            super
            @dtmf_handler_id = register_dtmf_event_handler
          end

          private

          def register_dtmf_event_handler
            component = current_actor
            call.register_handler :es, :event_name => 'DTMF' do |event|
              safe_from_dead_actors do
                component.process_dtmf event[:dtmf_digit]
              end
            end
          end

          def unregister_dtmf_event_handler
            call.unregister_handler :es, @dtmf_handler_id if instance_variable_defined?(:@dtmf_handler_id)
          rescue Celluloid::DeadActorError
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
punchblock-2.7.5 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.7.3 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.7.2 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.7.1 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.7.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.6.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.5.3 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.5.2 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.5.1 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.5.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.4.2 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.4.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.3.1 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.3.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.2.2 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.2.1 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.2.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.1.1 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.1.0 lib/punchblock/translator/freeswitch/component/input.rb
punchblock-2.0.2 lib/punchblock/translator/freeswitch/component/input.rb