Asterisk - The Open Source Telephony Project GIT-master-c7a8271
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
Data Structures
internal.h File Reference

Internal API's for res_ari. More...

#include "asterisk/http.h"
#include "asterisk/json.h"
#include "asterisk/md5.h"
#include "asterisk/sorcery.h"
#include "asterisk/stringfields.h"
#include "asterisk/websocket_client.h"
#include "ari_websockets.h"
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ari_conf_general
 Global configuration options for ARI. More...
 
struct  ari_conf_outbound_websocket
 
struct  ari_conf_user
 Per-user configuration options. More...
 

Functions

int ari_cli_register (void)
 Register CLI commands for ARI. More...
 
void ari_cli_unregister (void)
 Unregister CLI commands for ARI. More...
 
void ari_conf_destroy (void)
 Destroy the ARI configuration. More...
 
struct ari_conf_generalari_conf_get_general (void)
 
struct ari_conf_outbound_websocketari_conf_get_owc (const char *id)
 
struct ari_conf_outbound_websocketari_conf_get_owc_for_app (const char *app_name, unsigned int ws_type)
 Get the outbound websocket configuration for a Stasis app. More...
 
struct ao2_containerari_conf_get_owcs (void)
 
struct ari_conf_userari_conf_get_user (const char *username)
 
struct ao2_containerari_conf_get_users (void)
 
int ari_conf_load (enum ari_conf_load_flags flags)
 (Re)load the ARI configuration More...
 
enum  ari_conf_load_flags {
  ARI_CONF_INIT = (1 << 0) , ARI_CONF_RELOAD = (1 << 1) , ARI_CONF_LOAD_GENERAL = (1 << 2) , ARI_CONF_LOAD_USER = (1 << 3) ,
  ARI_CONF_LOAD_OWC = (1 << 4) , ARI_CONF_LOAD_ALL
}
 
enum ari_conf_owc_fields ari_conf_owc_detect_changes (struct ari_conf_outbound_websocket *old_owc, struct ari_conf_outbound_websocket *new_owc)
 Detect changes between two outbound websocket configurations. More...
 
enum  ari_conf_owc_fields {
  ARI_OWC_FIELD_NONE = 0 , ARI_OWC_FIELD_WEBSOCKET_CONNECTION_ID = (1 << AST_WS_CLIENT_FIELD_USER_START) , ARI_OWC_FIELD_APPS = (1 << (AST_WS_CLIENT_FIELD_USER_START + 1)) , ARI_OWC_FIELD_LOCAL_ARI_USER = (1 << (AST_WS_CLIENT_FIELD_USER_START + 2)) ,
  ARI_OWC_FIELD_LOCAL_ARI_PASSWORD = (1 << (AST_WS_CLIENT_FIELD_USER_START + 3)) , ARI_OWC_FIELD_SUBSCRIBE_ALL = (1 << (AST_WS_CLIENT_FIELD_USER_START + 4)) , ARI_OWC_NEEDS_RECONNECT , ARI_OWC_NEEDS_REREGISTER = ARI_OWC_FIELD_APPS | ARI_OWC_FIELD_SUBSCRIBE_ALL
}
 
enum ari_conf_owc_fields ari_conf_owc_get_invalid_fields (const char *id)
 
struct ari_conf_userari_conf_validate_user (const char *username, const char *password)
 Validated a user's credentials. More...
 
int ari_sorcery_observer_add (const char *object_type, const struct ast_sorcery_observer *callbacks)
 
int ari_sorcery_observer_remove (const char *object_type, const struct ast_sorcery_observer *callbacks)
 
enum  ari_user_password_format { ARI_PASSWORD_FORMAT_PLAIN , ARI_PASSWORD_FORMAT_CRYPT }
 Password format. More...
 
const char * ari_websocket_type_to_str (enum ast_websocket_type type)
 

Detailed Description

Internal API's for res_ari.

Author
David M. Lee, II dlee@.nosp@m.digi.nosp@m.um.co.nosp@m.m

Definition in file internal.h.

Enumeration Type Documentation

◆ ari_conf_load_flags

Enumerator
ARI_CONF_INIT 

Initialize sorcery

ARI_CONF_RELOAD 

Reload sorcery

ARI_CONF_LOAD_GENERAL 

Load general config

ARI_CONF_LOAD_USER 

Load user config

ARI_CONF_LOAD_OWC 

Load outbound websocket config

ARI_CONF_LOAD_ALL 

Definition at line 145 of file internal.h.

145 {
146 ARI_CONF_INIT = (1 << 0), /*!< Initialize sorcery */
147 ARI_CONF_RELOAD = (1 << 1), /*!< Reload sorcery */
148 ARI_CONF_LOAD_GENERAL = (1 << 2), /*!< Load general config */
149 ARI_CONF_LOAD_USER = (1 << 3), /*!< Load user config */
150 ARI_CONF_LOAD_OWC = (1 << 4), /*!< Load outbound websocket config */
151 ARI_CONF_LOAD_ALL = ( /*!< Load all configs */
155};
@ ARI_CONF_LOAD_ALL
Definition: internal.h:151
@ ARI_CONF_RELOAD
Definition: internal.h:147
@ ARI_CONF_INIT
Definition: internal.h:146
@ ARI_CONF_LOAD_OWC
Definition: internal.h:150
@ ARI_CONF_LOAD_USER
Definition: internal.h:149
@ ARI_CONF_LOAD_GENERAL
Definition: internal.h:148

◆ ari_conf_owc_fields

Enumerator
ARI_OWC_FIELD_NONE 
ARI_OWC_FIELD_WEBSOCKET_CONNECTION_ID 
ARI_OWC_FIELD_APPS 
ARI_OWC_FIELD_LOCAL_ARI_USER 
ARI_OWC_FIELD_LOCAL_ARI_PASSWORD 
ARI_OWC_FIELD_SUBSCRIBE_ALL 
ARI_OWC_NEEDS_RECONNECT 
ARI_OWC_NEEDS_REREGISTER 

Definition at line 96 of file internal.h.

96 {
107};
@ ARI_OWC_FIELD_APPS
Definition: internal.h:99
@ ARI_OWC_FIELD_WEBSOCKET_CONNECTION_ID
Definition: internal.h:98
@ ARI_OWC_NEEDS_REREGISTER
Definition: internal.h:106
@ ARI_OWC_FIELD_LOCAL_ARI_PASSWORD
Definition: internal.h:101
@ ARI_OWC_FIELD_NONE
Definition: internal.h:97
@ ARI_OWC_FIELD_LOCAL_ARI_USER
Definition: internal.h:100
@ ARI_OWC_FIELD_SUBSCRIBE_ALL
Definition: internal.h:102
@ ARI_OWC_NEEDS_RECONNECT
Definition: internal.h:103
@ AST_WS_CLIENT_NEEDS_RECONNECT
#define AST_WS_CLIENT_FIELD_USER_START

◆ ari_user_password_format

Password format.

Enumerator
ARI_PASSWORD_FORMAT_PLAIN 

Plaintext password.

ARI_PASSWORD_FORMAT_CRYPT 

crypt(3) password

Definition at line 76 of file internal.h.

76 {
77 /*! \brief Plaintext password */
79 /*! crypt(3) password */
81};
@ ARI_PASSWORD_FORMAT_CRYPT
Definition: internal.h:80
@ ARI_PASSWORD_FORMAT_PLAIN
Plaintext password.
Definition: internal.h:78

Function Documentation

◆ ari_cli_register()

int ari_cli_register ( void  )

Register CLI commands for ARI.

Returns
0 on success.
Non-zero on error.

Definition at line 699 of file res/ari/cli.c.

699 {
701}
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
static struct ast_cli_entry cli_ari[]
Definition: res/ari/cli.c:683
#define ARRAY_LEN(a)
Definition: utils.h:666

References ARRAY_LEN, ast_cli_register_multiple, and cli_ari.

Referenced by load_module().

◆ ari_cli_unregister()

void ari_cli_unregister ( void  )

Unregister CLI commands for ARI.

Definition at line 703 of file res/ari/cli.c.

703 {
705}
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30

References ARRAY_LEN, ast_cli_unregister_multiple(), and cli_ari.

Referenced by unload_module().

◆ ari_conf_destroy()

void ari_conf_destroy ( void  )

Destroy the ARI configuration.

Definition at line 789 of file res/ari/config.c.

790{
792
794 sorcery = NULL;
796}
#define ao2_cleanup(obj)
Definition: astobj2.h:1934
static struct ast_sorcery_observer ws_client_observer_callbacks
static struct ast_sorcery * sorcery
struct ao2_container * owc_states
#define NULL
Definition: resample.c:96
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
Definition: sorcery.h:1500
void ast_websocket_client_observer_remove(const struct ast_sorcery_observer *callbacks)
Remove sorcery observers for websocket client events.

References ao2_cleanup, ast_sorcery_unref, ast_websocket_client_observer_remove(), NULL, owc_states, sorcery, and ws_client_observer_callbacks.

Referenced by unload_module().

◆ ari_conf_get_general()

struct ari_conf_general * ari_conf_get_general ( void  )

Definition at line 477 of file res/ari/config.c.

478{
479 if (!sorcery) {
480 return NULL;
481 }
482
483 return ast_sorcery_retrieve_by_id(sorcery, "general", "general");
484}
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
Definition: sorcery.c:1853

References ast_sorcery_retrieve_by_id(), NULL, and sorcery.

Referenced by ari_show(), ast_ari_invoke(), ast_ari_json_format(), is_enabled(), origin_allowed(), and session_update().

◆ ari_conf_get_owc()

struct ari_conf_outbound_websocket * ari_conf_get_owc ( const char *  id)

Definition at line 308 of file res/ari/config.c.

309{
310 if (!sorcery) {
311 return NULL;
312 }
313
314 return ast_sorcery_retrieve_by_id(sorcery, "outbound_websocket", id);
315}

References ast_sorcery_retrieve_by_id(), NULL, and sorcery.

Referenced by ari_show_owc(), ari_start_owc(), outbound_sessions_load(), and outbound_websocket_state_cleanup().

◆ ari_conf_get_owc_for_app()

struct ari_conf_outbound_websocket * ari_conf_get_owc_for_app ( const char *  app_name,
unsigned int  ws_type 
)

Get the outbound websocket configuration for a Stasis app.

Parameters
app_nameThe application name to search for.
ws_typeAn OR'd list of ari_websocket_types or ARI_WS_TYPE_ANY.
Return values
ARIoutbound websocket configuration object.
NULLif not found.

Definition at line 317 of file res/ari/config.c.

319{
320 struct ari_conf_outbound_websocket *owc = NULL;
321 struct ao2_container *owcs = NULL;
322 struct ao2_iterator i;
323
325 return NULL;
326 }
327
328 ast_debug(3, "Checking outbound websockets for app '%s'\n", app_name);
329
330 owcs = ari_conf_get_owcs();
331 if (!owcs || ao2_container_count(owcs) == 0) {
332 ast_debug(3, "No outbound websockets found\n");
333 return NULL;
334 }
335
336 i = ao2_iterator_init(owcs, 0);
337 while ((owc = ao2_iterator_next(&i))) {
338 const char *id = ast_sorcery_object_get_id(owc);
339
340 ast_debug(3, "%s: Checking outbound websocket apps '%s' for app '%s'\n",
341 id, owc->apps, app_name);
342 if (owc->websocket_client->connection_type & ws_type
343 && ast_in_delimited_string(app_name, owc->apps, ',')) {
344 ast_debug(3, "%s: Found correct websocket type for apps '%s' for app '%s'\n",
345 id, owc->apps, app_name);
346 break;
347 }
348 ao2_cleanup(owc);
349 }
351 ao2_cleanup(owcs);
352 if (!owc) {
353 ast_debug(3, "No outbound websocket found for app '%s'\n", app_name);
354 }
355
356 return owc;
357}
#define ao2_iterator_next(iter)
Definition: astobj2.h:1911
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ast_debug(level,...)
Log a DEBUG message.
const char * app_name(struct ast_app *app)
Definition: pbx_app.c:463
struct ao2_container * ari_conf_get_owcs(void)
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
Definition: sorcery.c:2317
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
int ast_in_delimited_string(const char *needle, const char *haystack, char delim)
Check if there is an exact match for 'needle' between delimiters in 'haystack'.
Definition: strings.c:466
Generic container type.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1821
const ast_string_field apps
Definition: internal.h:116
struct ast_websocket_client * websocket_client
Definition: internal.h:119
enum ast_websocket_type connection_type

References ao2_cleanup, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, app_name(), ari_conf_outbound_websocket::apps, ari_conf_get_owcs(), ast_debug, ast_in_delimited_string(), ast_sorcery_object_get_id(), ast_strlen_zero(), ast_websocket_client::connection_type, NULL, and ari_conf_outbound_websocket::websocket_client.

Referenced by ast_ari_create_per_call_websocket().

◆ ari_conf_get_owcs()

struct ao2_container * ari_conf_get_owcs ( void  )

Definition at line 298 of file res/ari/config.c.

299{
300 if (!sorcery) {
301 return NULL;
302 }
303
304 return ast_sorcery_retrieve_by_fields(sorcery, "outbound_websocket",
306}
@ AST_RETRIEVE_FLAG_MULTIPLE
Return all matching objects.
Definition: sorcery.h:120
@ AST_RETRIEVE_FLAG_ALL
Perform no matching, return all objects.
Definition: sorcery.h:123
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
Definition: sorcery.c:1897

References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), NULL, and sorcery.

Referenced by ari_conf_get_owc_for_app(), ari_show_owc(), ari_show_owcs(), ari_start_owc(), outbound_sessions_load(), outbound_websocket_validate_cb(), and outbound_websockets_validate().

◆ ari_conf_get_user()

struct ari_conf_user * ari_conf_get_user ( const char *  username)

Definition at line 578 of file res/ari/config.c.

579{
580 if (!sorcery) {
581 return NULL;
582 }
583
584 return ast_sorcery_retrieve_by_id(sorcery, "user", username);
585}

References ast_sorcery_retrieve_by_id(), NULL, and sorcery.

Referenced by ari_show_user().

◆ ari_conf_get_users()

struct ao2_container * ari_conf_get_users ( void  )

◆ ari_conf_load()

int ari_conf_load ( enum ari_conf_load_flags  flags)

(Re)load the ARI configuration

Definition at line 745 of file res/ari/config.c.

746{
747 void (*loader)(const struct ast_sorcery *sorcery, const char *type);
748 const char *msg_prefix;
749
750 if (flags & ARI_CONF_RELOAD) {
752 msg_prefix= "Reloading";
754 } else {
756 msg_prefix= "Loading";
757 }
758
759 if (flags & ARI_CONF_INIT) {
760 if (ari_conf_init() != 0) {
761 ast_log(LOG_ERROR, "Failed to initialize ARI configuration\n");
762 return -1;
763 }
764 }
765
766 if (!sorcery) {
767 ast_log(LOG_ERROR, "ARI configuration not initialized\n");
768 return -1;
769 }
770
771 if (flags & ARI_CONF_LOAD_GENERAL) {
772 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "general");
773 loader(sorcery, "general");
774 }
775
776 if (flags & ARI_CONF_LOAD_USER) {
777 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "user");
778 loader(sorcery, "user");
779 }
780
781 if (flags & ARI_CONF_LOAD_OWC) {
782 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "outbound_websocket");
783 loader(sorcery, "outbound_websocket");
784 }
785
786 return 0;
787}
#define ast_log
Definition: astobj2.c:42
static const char type[]
Definition: chan_ooh323.c:109
#define LOG_ERROR
static int ari_conf_init(void)
void ast_sorcery_load_object(const struct ast_sorcery *sorcery, const char *type)
Inform any wizards of a specific object type to load persistent objects.
Definition: sorcery.c:1393
void ast_sorcery_reload_object(const struct ast_sorcery *sorcery, const char *type)
Inform any wizards of a specific object type to reload persistent objects.
Definition: sorcery.c:1442
Full structure for sorcery.
Definition: sorcery.c:230
int ast_websocket_client_reload(void)
Force res_websocket_client to reload its configuration.

References ari_conf_init(), ARI_CONF_INIT, ARI_CONF_LOAD_GENERAL, ARI_CONF_LOAD_OWC, ARI_CONF_LOAD_USER, ARI_CONF_RELOAD, ast_debug, ast_log, ast_sorcery_load_object(), ast_sorcery_reload_object(), ast_websocket_client_reload(), LOG_ERROR, sorcery, and type.

Referenced by load_module(), and reload_module().

◆ ari_conf_owc_detect_changes()

enum ari_conf_owc_fields ari_conf_owc_detect_changes ( struct ari_conf_outbound_websocket old_owc,
struct ari_conf_outbound_websocket new_owc 
)

Detect changes between two outbound websocket configurations.

Parameters
old_owcThe old outbound websocket configuration.
new_owcThe new outbound websocket configuration.
Returns
A bitmask of changed fields.

Definition at line 377 of file res/ari/config.c.

380{
382 const char *new_id = ast_sorcery_object_get_id(new_owc);
383 RAII_VAR(struct ast_variable *, changes, NULL, ast_variables_destroy);
384 struct ast_variable *v = NULL;
385 int res = 0;
386 int changes_found = 0;
387
388 ast_debug(2, "%s: Detecting changes\n", new_id);
389
390 res = ast_sorcery_diff(sorcery, old_owc, new_owc, &changes);
391 if (res != 0) {
392 ast_log(LOG_WARNING, "%s: Failed to create changeset\n", new_id);
393 return ARI_OWC_FIELD_NONE;
394 }
395
396 for (v = changes; v; v = v->next) {
397 changes_found = 1;
398 ast_debug(2, "%s: %s changed to %s\n", new_id, v->name, v->value);
399 if (ast_strings_equal(v->name, "apps")) {
400 changed |= ARI_OWC_FIELD_APPS;
401 } else if (ast_strings_equal(v->name, "subscribe_all")) {
403 } else if (ast_strings_equal(v->name, "local_ari_user")) {
405 } else if (ast_strings_equal(v->name, "local_ari_password")) {
407 } else {
408 ast_debug(2, "%s: Unknown change %s\n", new_id, v->name);
409 }
410 }
411 if (!changes_found) {
412 ast_debug(2, "%s: No changes found %p %p\n", new_id,
413 old_owc->websocket_client,new_owc->websocket_client);
414 }
415
417 old_owc->websocket_client, new_owc->websocket_client);
418
419 return changed;
420
421}
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
Definition: extconf.c:1262
#define LOG_WARNING
ari_conf_owc_fields
Definition: internal.h:96
int ast_sorcery_diff(const struct ast_sorcery *sorcery, const void *original, const void *modified, struct ast_variable **changes)
Create a changeset of two objects.
Definition: sorcery.c:1805
int ast_strings_equal(const char *str1, const char *str2)
Compare strings for equality checking for NULL.
Definition: strings.c:238
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941
enum ast_ws_client_fields ast_websocket_client_get_field_diff(struct ast_websocket_client *old_wc, struct ast_websocket_client *new_wc)
Detect changes between two websocket client configurations.

References ARI_OWC_FIELD_APPS, ARI_OWC_FIELD_LOCAL_ARI_PASSWORD, ARI_OWC_FIELD_LOCAL_ARI_USER, ARI_OWC_FIELD_NONE, ARI_OWC_FIELD_SUBSCRIBE_ALL, ast_debug, ast_log, ast_sorcery_diff(), ast_sorcery_object_get_id(), ast_strings_equal(), ast_variables_destroy(), ast_websocket_client_get_field_diff(), LOG_WARNING, ast_variable::name, ast_variable::next, NULL, RAII_VAR, sorcery, ast_variable::value, and ari_conf_outbound_websocket::websocket_client.

Referenced by outbound_session_apply_config().

◆ ari_conf_owc_get_invalid_fields()

enum ari_conf_owc_fields ari_conf_owc_get_invalid_fields ( const char *  id)

Definition at line 158 of file res/ari/config.c.

159{
161
163 return state ? state->invalid_fields : ARI_OWC_FIELD_NONE;
164}
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1736
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1101

References ao2_cleanup, ao2_find, ARI_OWC_FIELD_NONE, NULL, OBJ_SEARCH_KEY, owc_states, and RAII_VAR.

Referenced by ari_show_owc(), ast_ari_create_per_call_websocket(), outbound_session_create(), and show_owc_cb().

◆ ari_conf_validate_user()

struct ari_conf_user * ari_conf_validate_user ( const char *  username,
const char *  password 
)

Validated a user's credentials.

Parameters
usernameName of the user.
passwordUser's password.
Returns
User object.
Return values
NULLif username or password is invalid.

Definition at line 591 of file res/ari/config.c.

593{
594 struct ari_conf_user *user = NULL;
595 int is_valid = 0;
596
597 if (ast_strlen_zero(username) || ast_strlen_zero(password)) {
598 return NULL;
599 }
600
601 user = ast_sorcery_retrieve_by_id(sorcery, "user", username);
602 if (!user) {
603 return NULL;
604 }
605
606 switch (user->password_format) {
608 is_valid = strcmp(password, user->password) == 0;
609 break;
611 is_valid = ast_crypt_validate(password, user->password);
612 break;
613 }
614
615 if (!is_valid) {
617 user = NULL;
618 }
619
620 return user;
621}
static char user[512]
Per-user configuration options.
Definition: internal.h:84
const ast_string_field password
Definition: internal.h:89
structure to hold users read from users.conf
int ast_crypt_validate(const char *key, const char *expected)
Asterisk wrapper around crypt(3) for validating passwords.
Definition: crypt.c:136

References ao2_cleanup, ARI_PASSWORD_FORMAT_CRYPT, ARI_PASSWORD_FORMAT_PLAIN, ast_crypt_validate(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), NULL, ari_conf_user::password, sorcery, and user.

Referenced by authenticate_api_key(), and authenticate_user().

◆ ari_sorcery_observer_add()

int ari_sorcery_observer_add ( const char *  object_type,
const struct ast_sorcery_observer callbacks 
)

Definition at line 623 of file res/ari/config.c.

625{
626 if (!sorcery) {
627 return -1;
628 }
629 return ast_sorcery_observer_add(sorcery, object_type, callbacks);
630}
struct @471 callbacks
int ast_sorcery_observer_add(const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks)
Add an observer to a specific object type.
Definition: sorcery.c:2391

References ast_sorcery_observer_add(), callbacks, and sorcery.

Referenced by ari_websocket_load_module().

◆ ari_sorcery_observer_remove()

int ari_sorcery_observer_remove ( const char *  object_type,
const struct ast_sorcery_observer callbacks 
)

Definition at line 632 of file res/ari/config.c.

634{
635 if (!sorcery) {
636 return -1;
637 }
639 return 0;
640}
void ast_sorcery_observer_remove(const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks)
Remove an observer from a specific object type.
Definition: sorcery.c:2423

References ast_sorcery_observer_remove(), callbacks, and sorcery.

Referenced by ari_websocket_unload_module().

◆ ari_websocket_type_to_str()

const char * ari_websocket_type_to_str ( enum ast_websocket_type  type)

Definition at line 359 of file res/ari/config.c.

360{
361 switch (type) {
363 return "persistent";
365 return "per_call";
367 return "per_call_config";
369 return "inbound";
370 case AST_WS_TYPE_ANY:
371 return "any";
372 default:
373 return "unknown";
374 }
375}
@ AST_WS_TYPE_ANY
@ AST_WS_TYPE_INBOUND
@ AST_WS_TYPE_CLIENT_PER_CALL_CONFIG
@ AST_WS_TYPE_CLIENT_PERSISTENT
@ AST_WS_TYPE_CLIENT_PER_CALL