Sha256: 89b67903439d53d23552c9f1e6f2e67ad0f08f1473ff7557f9d14301322f7347
Contents?: true
Size: 797 Bytes
Versions: 6
Compression:
Stored size: 797 Bytes
Contents
require 'ruby_ami' module Punchblock module Connection class Asterisk < GenericConnection attr_reader :ami_client, :translator attr_accessor :event_handler def initialize(options = {}) @ami_client = RubyAMI::Client.new options.merge(:event_handler => lambda { |event| translator.handle_ami_event! event }, :logger => pb_logger) @translator = Translator::Asterisk.new @ami_client, self super() end def run pb_logger.debug "Starting the RubyAMI client" ami_client.start end def stop ami_client.stop end def write(command, options) translator.execute_command! command, options end def handle_event(event) event_handler.call event end end end end
Version data entries
6 entries across 6 versions & 1 rubygems