class Asterisk::ARI::Asterisk

Defined in:

asterisk/ari/resources/asterisk.cr
asterisk/ari/models/asterisk_asterisk_info.cr
asterisk/ari/models/asterisk_asterisk_ping.cr
asterisk/ari/models/asterisk_build_info.cr
asterisk/ari/models/asterisk_config_info.cr
asterisk/ari/models/asterisk_config_tuple.cr
asterisk/ari/models/asterisk_log_channel.cr
asterisk/ari/models/asterisk_module.cr
asterisk/ari/models/asterisk_set_id.cr
asterisk/ari/models/asterisk_status_info.cr
asterisk/ari/models/asterisk_system_info.cr
asterisk/ari/models/asterisk_variable.cr

Instance Method Summary

Instance methods inherited from class Asterisk::ARI::Resources

ari : ARI ari

Constructor methods inherited from class Asterisk::ARI::Resources

new(ari) new

Instance Method Detail

def add_log(log_channel_name : String, configuration : String) #

Adds a log channel.

Arguments:

  • log_channel_name - the log channel to add. (required);
  • configuration - levels of the log channel. (required);

Error responses:

  • 400 - Bad request body
  • 409 - Log channel could not be created.

[View source]
def delete_log(log_channel_name : String) #

Deletes a log channel.

Arguments:

  • log_channel_name - log channels name. (required);

Error responses:

  • 404 - Log channel does not exist.

[View source]
def delete_object(config_class : String, object_type : String, id : String) #

Delete a dynamic configuration object.

Arguments:

  • config_class - the configuration class containing dynamic configuration objects. (required);
  • object_type - the type of configuration object to delete. (required);
  • id - the unique identifier of the object to delete. (required);

Error responses:

  • 403 - Could not delete object
  • 404 - {configClass|objectType|id} not found

[View source]
def get_global_var(variable : String) : HTTP::Client::Response | Asterisk::Variable #

Get the value of a global variable.

Arguments:

  • variable - the variable to get. (required);

Error responses:

  • 400 - Missing variable parameter.

[View source]
def get_info(only : String? = nil) : HTTP::Client::Response | Asterisk::AsteriskInfo #

Gets Asterisk system information.

Arguments:

  • only - filter information returned.. Allow multiple instances (comma-separated list);

[View source]
def get_module(module_name : String) : HTTP::Client::Response | Asterisk::Module #

Get Asterisk module information.

Arguments:

  • module_name - module's name. (required);

Error responses:

  • 404 - Module could not be found in running modules.
  • 409 - Module information could not be retrieved.

[View source]
def get_object(config_class : String, object_type : String, id : String) : HTTP::Client::Response | Array(Asterisk::ConfigTuple) #

Retrieve a dynamic configuration object.

Arguments:

  • config_class - the configuration class containing dynamic configuration objects. (required);
  • object_type - the type of configuration object to retrieve. (required);
  • id - the unique identifier of the object to retrieve. (required);

Error responses:

  • 404 - {configClass|objectType|id} not found

[View source]
def list_log_channels : HTTP::Client::Response | Array(Asterisk::LogChannel) #

Gets Asterisk log channel information.


[View source]
def list_modules : HTTP::Client::Response | Array(Asterisk::Module) #

List Asterisk modules.


[View source]
def load_module(module_name : String) #

Load an Asterisk module.

Arguments:

  • module_name - module's name. (required);

Error responses:

  • 409 - Module could not be loaded.

[View source]
def ping : HTTP::Client::Response | Asterisk::AsteriskPing #

Response pong message.


[View source]
def reload_module(module_name : String) #

Reload an Asterisk module.

Arguments:

  • module_name - module's name. (required);

Error responses:

  • 404 - Module not found in running modules.
  • 409 - Module could not be reloaded.

[View source]
def rotate_log(log_channel_name : String) #

Rotates a log channel.

Arguments:

  • log_channel_name - log channel's name. (required);

Error responses:

  • 404 - Log channel does not exist.

[View source]
def set_global_var(variable : String, value : String? = nil) #

Set the value of a global variable.

Arguments:

  • variable - the variable to set. (required);
  • value - the value to set the variable to;

Error responses:

  • 400 - Missing variable parameter.

[View source]
def unload_module(module_name : String) #

Unload an Asterisk module.

Arguments:

  • module_name - module's name. (required);

Error responses:

  • 404 - Module not found in running modules.
  • 409 - Module could not be unloaded.

[View source]
def update_object(config_class : String, object_type : String, id : String, fields : Hash(String, String | Bool | Int32 | Float32)? = nil) : HTTP::Client::Response | Array(Asterisk::ConfigTuple) #

Create or update a dynamic configuration object.

Arguments:

  • config_class - the configuration class containing dynamic configuration objects. (required);
  • object_type - the type of configuration object to create or update. (required);
  • id - the unique identifier of the object to create or update. (required);
  • fields - the body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { "attribute": "directmedia", "value": "false" } ];

Error responses:

  • 400 - Bad request body
  • 403 - Could not create or update object
  • 404 - {configClass|objectType} not found

[View source]