Class: Ari::Asterisk
- Defined in:
- lib/ari/resources/asterisk.rb
Class Method Summary collapse
-
.get_global_var(options = {}) ⇒ Object
(also: getGlobalVar)
GET /asterisk/variable.
-
.get_info(options = {}) ⇒ Object
(also: getInfo)
GET /asterisk/info.
-
.set_global_var(options = {}) ⇒ Object
(also: setGlobalVar)
POST /asterisk/variable.
Methods inherited from Resource
#add_listener, client, #client, #remove_all_listeners!, #remove_listener
Methods inherited from Model
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
41 42 43 44 45 46 |
# File 'lib/ari/resources/asterisk.rb', line 41 def self.get_global_var( = {}) raise ArgumentError.new("Parameter variable must be passed in options hash.") unless [:variable] path = '/asterisk/variable' response = client().get(path, ) Variable.new(response.merge(client: [: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( = {}) path = '/asterisk/info' response = client().get(path, ) AsteriskInfo.new(response.merge(client: [: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
59 60 61 62 63 |
# File 'lib/ari/resources/asterisk.rb', line 59 def self.set_global_var( = {}) raise ArgumentError.new("Parameter variable must be passed in options hash.") unless [:variable] path = '/asterisk/variable' response = client().post(path, ) end |