Module: Adhearsion::Asterisk

Defined in:
lib/adhearsion/asterisk.rb,
lib/adhearsion/asterisk/plugin.rb,
lib/adhearsion/asterisk/version.rb,
lib/adhearsion/asterisk/queue_proxy.rb,
lib/adhearsion/asterisk/config_manager.rb,
lib/adhearsion/asterisk/has_agi_context.rb,
lib/adhearsion/asterisk/config_generator.rb,
lib/adhearsion/asterisk/queue_proxy/agent_proxy.rb,
lib/adhearsion/asterisk/call_controller_methods.rb,
lib/adhearsion/asterisk/config_generator/agents.rb,
lib/adhearsion/asterisk/config_generator/queues.rb,
lib/adhearsion/asterisk/config_generator/voicemail.rb,
lib/adhearsion/asterisk/queue_proxy/queue_agents_list_proxy.rb

Defined Under Namespace

Modules: CallControllerMethods, HasAgiContext Classes: ConfigGenerator, ConfigurationManager, Plugin, QueueProxy

Constant Summary

VERSION =
"1.5.1"
PLAYBACK_SUCCESS =
'SUCCESS'

Class Method Summary collapse

Class Method Details

.execute_ami_action(name, options = {}) {|Punchblock::Event::Asterisk::AMI::Event| ... } ⇒ Punchblock::Event::Complete

Execute an AMI action synchronously

Examples:

Execute a CoreShowChannels action, handling each channel event:


Adhearsion::Asterisk.execute_ami_action('CoreShowChannels') { |channel| puts channel.inspect }

Yields:

  • (Punchblock::Event::Asterisk::AMI::Event)

    block to handle each event resulting from the action



23
24
25
26
27
28
# File 'lib/adhearsion/asterisk.rb', line 23

def self.execute_ami_action(name, options = {}, &block)
  component = Punchblock::Component::Asterisk::AMI::Action.new :name => name, :params => options
  component.register_event_handler(Punchblock::Event::Asterisk::AMI::Event, &block) if block
  Adhearsion::PunchblockPlugin.execute_component component
  component.complete_event
end