Class: Ari::Asterisk

Inherits:
Resource show all
Defined in:
lib/ari/resources/asterisk.rb

Class Method Summary collapse

Methods inherited from Resource

#add_listener, #client, client, #remove_all_listeners!, #remove_listener

Methods inherited from Model

#attributes=, #initialize

Constructor Details

This class inherits a constructor from Ari::Model

Class Method Details

.get_global_var(options = {}) ⇒ Object Also known as: getGlobalVar

GET /asterisk/variable

Global variables

Parameters:

variable (required) - The variable to get

Raises:

  • (ArgumentError)

41
42
43
44
45
46
# File 'lib/ari/resources/asterisk.rb', line 41

def self.get_global_var(options = {})
  raise ArgumentError.new("Parameter variable must be passed in options hash.") unless options[:variable]
  path = '/asterisk/variable'
  response = client(options).get(path, options)
  Variable.new(response.merge(client: options[:client]))
end

.get_info(options = {}) ⇒ Object Also known as: getInfo

GET /asterisk/info

Asterisk system information (similar to core show settings)

Parameters:

only - Filter information returned


25
26
27
28
29
# File 'lib/ari/resources/asterisk.rb', line 25

def self.get_info(options = {})
  path = '/asterisk/info'
  response = client(options).get(path, options)
  AsteriskInfo.new(response.merge(client: options[:client]))
end

.set_global_var(options = {}) ⇒ Object Also known as: setGlobalVar

POST /asterisk/variable

Global variables

Parameters:

variable (required) - The variable to set value - The value to set the variable to

Raises:

  • (ArgumentError)

59
60
61
62
63
# File 'lib/ari/resources/asterisk.rb', line 59

def self.set_global_var(options = {})
  raise ArgumentError.new("Parameter variable must be passed in options hash.") unless options[:variable]
  path = '/asterisk/variable'
  response = client(options).post(path, options)
end