Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created May 20, 2010 18:38
Show Gist options
  • Select an option

  • Save sprite2005/407910 to your computer and use it in GitHub Desktop.

Select an option

Save sprite2005/407910 to your computer and use it in GitHub Desktop.
methods_for :rpc do
# Simply create proxy methods for the high-level AMI methods
[:send_action, :introduce, :originate, :call_into_context, :call_and_exec].each do |method_name|
define_method(method_name) do |*args|
if VoIP::Asterisk.manager_interface
VoIP::Asterisk.manager_interface.send(method_name, *args)
else
ahn_log.ami_remote.error "AMI has not been enabled in startup.rb!"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment