Asterisk - The Open Source Telephony Project GIT-master-77d630f
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:703

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 794 of file res/ari/config.c.

795{
797
799 sorcery = NULL;
801}
#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 482 of file res/ari/config.c.

483{
484 if (!sorcery) {
485 return NULL;
486 }
487
488 return ast_sorcery_retrieve_by_id(sorcery, "general", "general");
489}
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:1916

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 313 of file res/ari/config.c.

314{
315 if (!sorcery) {
316 return NULL;
317 }
318
319 return ast_sorcery_retrieve_by_id(sorcery, "outbound_websocket", id);
320}

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 322 of file res/ari/config.c.

324{
325 struct ari_conf_outbound_websocket *owc = NULL;
326 struct ao2_container *owcs = NULL;
327 struct ao2_iterator i;
328
330 return NULL;
331 }
332
333 ast_debug(3, "Checking outbound websockets for app '%s'\n", app_name);
334
335 owcs = ari_conf_get_owcs();
336 if (!owcs || ao2_container_count(owcs) == 0) {
337 ast_debug(3, "No outbound websockets found\n");
338 return NULL;
339 }
340
341 i = ao2_iterator_init(owcs, 0);
342 while ((owc = ao2_iterator_next(&i))) {
343 const char *id = ast_sorcery_object_get_id(owc);
344
345 ast_debug(3, "%s: Checking outbound websocket apps '%s' for app '%s'\n",
346 id, owc->apps, app_name);
347 if (owc->websocket_client->connection_type & ws_type
348 && ast_in_delimited_string(app_name, owc->apps, ',')) {
349 ast_debug(3, "%s: Found correct websocket type for apps '%s' for app '%s'\n",
350 id, owc->apps, app_name);
351 break;
352 }
353 ao2_cleanup(owc);
354 }
356 ao2_cleanup(owcs);
357 if (!owc) {
358 ast_debug(3, "No outbound websocket found for app '%s'\n", app_name);
359 }
360
361 return owc;
362}
#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:2380
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 303 of file res/ari/config.c.

304{
305 if (!sorcery) {
306 return NULL;
307 }
308
309 return ast_sorcery_retrieve_by_fields(sorcery, "outbound_websocket",
311}
@ 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:1960

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 583 of file res/ari/config.c.

584{
585 if (!sorcery) {
586 return NULL;
587 }
588
589 return ast_sorcery_retrieve_by_id(sorcery, "user", username);
590}

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 750 of file res/ari/config.c.

751{
752 void (*loader)(const struct ast_sorcery *sorcery, const char *type);
753 const char *msg_prefix;
754
755 if (flags & ARI_CONF_RELOAD) {
757 msg_prefix= "Reloading";
759 } else {
761 msg_prefix= "Loading";
762 }
763
764 if (flags & ARI_CONF_INIT) {
765 if (ari_conf_init() != 0) {
766 ast_log(LOG_ERROR, "Failed to initialize ARI configuration\n");
767 return -1;
768 }
769 }
770
771 if (!sorcery) {
772 ast_log(LOG_ERROR, "ARI configuration not initialized\n");
773 return -1;
774 }
775
776 if (flags & ARI_CONF_LOAD_GENERAL) {
777 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "general");
778 loader(sorcery, "general");
779 }
780
781 if (flags & ARI_CONF_LOAD_USER) {
782 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "user");
783 loader(sorcery, "user");
784 }
785
786 if (flags & ARI_CONF_LOAD_OWC) {
787 ast_debug(2, "%s ARI '%s' configuration\n", msg_prefix, "outbound_websocket");
788 loader(sorcery, "outbound_websocket");
789 }
790
791 return 0;
792}
#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:1456
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:1505
Full structure for sorcery.
Definition: sorcery.c:231
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 382 of file res/ari/config.c.

385{
387 const char *new_id = ast_sorcery_object_get_id(new_owc);
388 RAII_VAR(struct ast_variable *, changes, NULL, ast_variables_destroy);
389 struct ast_variable *v = NULL;
390 int res = 0;
391 int changes_found = 0;
392
393 ast_debug(2, "%s: Detecting changes\n", new_id);
394
395 res = ast_sorcery_diff(sorcery, old_owc, new_owc, &changes);
396 if (res != 0) {
397 ast_log(LOG_WARNING, "%s: Failed to create changeset\n", new_id);
398 return ARI_OWC_FIELD_NONE;
399 }
400
401 for (v = changes; v; v = v->next) {
402 changes_found = 1;
403 ast_debug(2, "%s: %s changed to %s\n", new_id, v->name, v->value);
404 if (ast_strings_equal(v->name, "apps")) {
405 changed |= ARI_OWC_FIELD_APPS;
406 } else if (ast_strings_equal(v->name, "subscribe_all")) {
408 } else if (ast_strings_equal(v->name, "local_ari_user")) {
410 } else if (ast_strings_equal(v->name, "local_ari_password")) {
412 } else {
413 ast_debug(2, "%s: Unknown change %s\n", new_id, v->name);
414 }
415 }
416 if (!changes_found) {
417 ast_debug(2, "%s: No changes found %p %p\n", new_id,
418 old_owc->websocket_client,new_owc->websocket_client);
419 }
420
422 old_owc->websocket_client, new_owc->websocket_client);
423
424 return changed;
425
426}
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
Definition: extconf.c:1260
#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:1868
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:978
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 163 of file res/ari/config.c.

164{
166
168 return state ? state->invalid_fields : ARI_OWC_FIELD_NONE;
169}
#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 596 of file res/ari/config.c.

598{
599 struct ari_conf_user *user = NULL;
600 int is_valid = 0;
601
602 if (ast_strlen_zero(username) || ast_strlen_zero(password)) {
603 return NULL;
604 }
605
606 user = ast_sorcery_retrieve_by_id(sorcery, "user", username);
607 if (!user) {
608 return NULL;
609 }
610
611 switch (user->password_format) {
613 is_valid = strcmp(password, user->password) == 0;
614 break;
616 is_valid = ast_crypt_validate(password, user->password);
617 break;
618 }
619
620 if (!is_valid) {
622 user = NULL;
623 }
624
625 return user;
626}
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 phoneprov_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 628 of file res/ari/config.c.

630{
631 if (!sorcery) {
632 return -1;
633 }
634 return ast_sorcery_observer_add(sorcery, object_type, callbacks);
635}
struct @476 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:2454

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 637 of file res/ari/config.c.

639{
640 if (!sorcery) {
641 return -1;
642 }
644 return 0;
645}
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:2486

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 364 of file res/ari/config.c.

365{
366 switch (type) {
368 return "persistent";
370 return "per_call";
372 return "per_call_config";
374 return "inbound";
375 case AST_WS_TYPE_ANY:
376 return "any";
377 default:
378 return "unknown";
379 }
380}
@ 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