Sha256: 286e73d3bc2fd60078f38421c04328a1bf91706bb96aadfae38af93b88a2cadf

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

# encoding: utf-8

module Punchblock
  module Translator
    class Asterisk
      module Component
        class Input < Component

          include InputComponent

          def execute
            @call.send_progress
            super
          end

          private

          def register_dtmf_event_handler
            component = current_actor
            call.register_handler :ami, :name => 'DTMF', [:[], 'End'] => 'Yes' do |event|
              component.process_dtmf event['Digit']
            end
          end

          def unregister_dtmf_event_handler
            call.async.unregister_handler :ami, @dtmf_handler_id if instance_variable_defined?(:@dtmf_handler_id)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
punchblock-1.9.4 lib/punchblock/translator/asterisk/component/input.rb
punchblock-1.9.3 lib/punchblock/translator/asterisk/component/input.rb
punchblock-1.9.2 lib/punchblock/translator/asterisk/component/input.rb
punchblock-1.9.1 lib/punchblock/translator/asterisk/component/input.rb
punchblock-1.9.0 lib/punchblock/translator/asterisk/component/input.rb