Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Functions | Variables
general.c File Reference
#include "asterisk.h"
#include "asterisk/cli.h"
#include "asterisk/sorcery.h"
#include "stir_shaken.h"
#include "general.h"
#include "asterisk/res_stir_shaken.h"
Include dependency graph for general.c:

Go to the source code of this file.

Data Structures

struct  stir_shaken_general
 

Macros

#define CONFIG_TYPE   "general"
 
#define DEFAULT_CA_FILE   ""
 
#define DEFAULT_CA_PATH   ""
 
#define DEFAULT_CACHE_MAX_SIZE   1000
 
#define DEFAULT_CURL_TIMEOUT   2
 
#define DEFAULT_SIGNATURE_TIMEOUT   15
 

Functions

const char * ast_stir_shaken_ca_file (const struct stir_shaken_general *cfg)
 Retrieve the 'ca_file' general configuration option value. More...
 
const char * ast_stir_shaken_ca_path (const struct stir_shaken_general *cfg)
 Retrieve the 'ca_path' general configuration option value. More...
 
unsigned int ast_stir_shaken_cache_max_size (const struct stir_shaken_general *cfg)
 Retrieve the 'cache_max_size' general configuration option value. More...
 
unsigned int ast_stir_shaken_curl_timeout (const struct stir_shaken_general *cfg)
 Retrieve the 'curl_timeout' general configuration option value. More...
 
unsigned int ast_stir_shaken_signature_timeout (const struct stir_shaken_general *cfg)
 Retrieve the 'signature_timeout' general configuration option value. More...
 
static int ca_file_to_str (const void *obj, const intptr_t *args, char **buf)
 
static int ca_path_to_str (const void *obj, const intptr_t *args, char **buf)
 
static int on_load_ca_file (const struct aco_option *opt, struct ast_variable *var, void *obj)
 
static int on_load_ca_path (const struct aco_option *opt, struct ast_variable *var, void *obj)
 
static void * stir_shaken_general_alloc (const char *name)
 
static int stir_shaken_general_apply (const struct ast_sorcery *sorcery, void *obj)
 
static void stir_shaken_general_destructor (void *obj)
 
struct stir_shaken_generalstir_shaken_general_get ()
 Retrieve the stir/shaken 'general' configuration object. More...
 
int stir_shaken_general_load (void)
 Load time initialization for the stir/shaken 'general' configuration. More...
 
static void stir_shaken_general_loaded (const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded)
 
static char * stir_shaken_general_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
int stir_shaken_general_unload (void)
 Unload time cleanup for the stir/shaken 'general' configuration. More...
 

Variables

static struct stir_shaken_generaldefault_config = NULL
 
static struct ast_cli_entry stir_shaken_general_cli []
 
static const struct ast_sorcery_instance_observer stir_shaken_general_observer
 

Macro Definition Documentation

◆ CONFIG_TYPE

#define CONFIG_TYPE   "general"

◆ DEFAULT_CA_FILE

#define DEFAULT_CA_FILE   ""

Definition at line 30 of file general.c.

Referenced by ast_stir_shaken_ca_file(), and stir_shaken_general_load().

◆ DEFAULT_CA_PATH

#define DEFAULT_CA_PATH   ""

Definition at line 31 of file general.c.

Referenced by ast_stir_shaken_ca_path(), and stir_shaken_general_load().

◆ DEFAULT_CACHE_MAX_SIZE

#define DEFAULT_CACHE_MAX_SIZE   1000

Definition at line 32 of file general.c.

Referenced by ast_stir_shaken_cache_max_size(), and stir_shaken_general_load().

◆ DEFAULT_CURL_TIMEOUT

#define DEFAULT_CURL_TIMEOUT   2

Definition at line 33 of file general.c.

Referenced by ast_stir_shaken_curl_timeout(), and stir_shaken_general_load().

◆ DEFAULT_SIGNATURE_TIMEOUT

#define DEFAULT_SIGNATURE_TIMEOUT   15

Definition at line 34 of file general.c.

Referenced by ast_stir_shaken_signature_timeout(), and stir_shaken_general_load().

Function Documentation

◆ ast_stir_shaken_ca_file()

const char* ast_stir_shaken_ca_file ( const struct stir_shaken_general cfg)

Retrieve the 'ca_file' general configuration option value.

Note
If a NULL configuration is given, then the default value is returned
Parameters
cfgA 'general' configuration object
Return values
The'ca_file' value

Definition at line 72 of file general.c.

References stir_shaken_general::ca_file, and DEFAULT_CA_FILE.

73 {
74  return cfg ? cfg->ca_file : DEFAULT_CA_FILE;
75 }
#define DEFAULT_CA_FILE
Definition: general.c:30
const ast_string_field ca_file
Definition: general.c:43

◆ ast_stir_shaken_ca_path()

const char* ast_stir_shaken_ca_path ( const struct stir_shaken_general cfg)

Retrieve the 'ca_path' general configuration option value.

Note
If a NULL configuration is given, then the default value is returned
Parameters
cfgA 'general' configuration object
Return values
The'ca_path' value

Definition at line 77 of file general.c.

References stir_shaken_general::ca_path, and DEFAULT_CA_PATH.

78 {
79  return cfg ? cfg->ca_path : DEFAULT_CA_PATH;
80 }
#define DEFAULT_CA_PATH
Definition: general.c:31
const ast_string_field ca_path
Definition: general.c:43

◆ ast_stir_shaken_cache_max_size()

unsigned int ast_stir_shaken_cache_max_size ( const struct stir_shaken_general cfg)

Retrieve the 'cache_max_size' general configuration option value.

Note
If a NULL configuration is given, then the default value is returned
Parameters
cfgA 'general' configuration object
Return values
The'cache_max_size' value

Definition at line 82 of file general.c.

References stir_shaken_general::cache_max_size, and DEFAULT_CACHE_MAX_SIZE.

83 {
84  return cfg ? cfg->cache_max_size : DEFAULT_CACHE_MAX_SIZE;
85 }
#define DEFAULT_CACHE_MAX_SIZE
Definition: general.c:32
unsigned int cache_max_size
Definition: general.c:45

◆ ast_stir_shaken_curl_timeout()

unsigned int ast_stir_shaken_curl_timeout ( const struct stir_shaken_general cfg)

Retrieve the 'curl_timeout' general configuration option value.

Note
If a NULL configuration is given, then the default value is returned
Parameters
cfgA 'general' configuration object
Return values
The'curl_timeout' value

Definition at line 87 of file general.c.

References stir_shaken_general::curl_timeout, and DEFAULT_CURL_TIMEOUT.

Referenced by get_curl_instance().

88 {
89  return cfg ? cfg->curl_timeout : DEFAULT_CURL_TIMEOUT;
90 }
unsigned int curl_timeout
Definition: general.c:47
#define DEFAULT_CURL_TIMEOUT
Definition: general.c:33

◆ ast_stir_shaken_signature_timeout()

unsigned int ast_stir_shaken_signature_timeout ( const struct stir_shaken_general cfg)

Retrieve the 'signature_timeout' general configuration option value.

Note
if a NULL configuration is given, then the default value is returned
Parameters
cfgA 'general' configuration object
Return values
The'signature_timeout' value

Definition at line 92 of file general.c.

References DEFAULT_SIGNATURE_TIMEOUT, and stir_shaken_general::signature_timeout.

Referenced by ast_stir_shaken_get_signature_timeout().

93 {
94  return cfg ? cfg->signature_timeout : DEFAULT_SIGNATURE_TIMEOUT;
95 }
unsigned int signature_timeout
Definition: general.c:49
#define DEFAULT_SIGNATURE_TIMEOUT
Definition: general.c:34

◆ ca_file_to_str()

static int ca_file_to_str ( const void *  obj,
const intptr_t *  args,
char **  buf 
)
static

Definition at line 201 of file general.c.

References ast_strdup, and stir_shaken_general::ca_file.

Referenced by stir_shaken_general_load().

202 {
203  const struct stir_shaken_general *cfg = obj;
204 
205  *buf = ast_strdup(cfg->ca_file);
206 
207  return 0;
208 }
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
const ast_string_field ca_file
Definition: general.c:43

◆ ca_path_to_str()

static int ca_path_to_str ( const void *  obj,
const intptr_t *  args,
char **  buf 
)
static

Definition at line 223 of file general.c.

References ast_strdup, and stir_shaken_general::ca_path.

Referenced by stir_shaken_general_load().

224 {
225  const struct stir_shaken_general *cfg = obj;
226 
227  *buf = ast_strdup(cfg->ca_path);
228 
229  return 0;
230 }
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
const ast_string_field ca_path
Definition: general.c:43

◆ on_load_ca_file()

static int on_load_ca_file ( const struct aco_option opt,
struct ast_variable var,
void *  obj 
)
static

Definition at line 188 of file general.c.

References ast_file_is_readable(), ast_log, ast_string_field_set, stir_shaken_general::ca_file, LOG_ERROR, ast_variable::name, and ast_variable::value.

Referenced by stir_shaken_general_load().

189 {
190  struct stir_shaken_general *cfg = obj;
191 
192  if (!ast_file_is_readable(var->value)) {
193  ast_log(LOG_ERROR, "stir/shaken - %s '%s' not found, or is unreadable\n",
194  var->name, var->value);
195  return -1;
196  }
197 
198  return ast_string_field_set(cfg, ca_file, var->value);
199 }
int ast_file_is_readable(const char *filename)
Test that a file exists and is readable by the effective user.
Definition: main/utils.c:2855
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
const ast_string_field ca_file
Definition: general.c:43
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
Definition: stringfields.h:514

◆ on_load_ca_path()

static int on_load_ca_path ( const struct aco_option opt,
struct ast_variable var,
void *  obj 
)
static

Definition at line 210 of file general.c.

References ast_file_is_readable(), ast_log, ast_string_field_set, stir_shaken_general::ca_path, LOG_ERROR, ast_variable::name, and ast_variable::value.

Referenced by stir_shaken_general_load().

211 {
212  struct stir_shaken_general *cfg = obj;
213 
214  if (!ast_file_is_readable(var->value)) {
215  ast_log(LOG_ERROR, "stir/shaken - %s '%s' not found, or is unreadable\n",
216  var->name, var->value);
217  return -1;
218  }
219 
220  return ast_string_field_set(cfg, ca_path, var->value);
221 }
int ast_file_is_readable(const char *filename)
Test that a file exists and is readable by the effective user.
Definition: main/utils.c:2855
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
const ast_string_field ca_path
Definition: general.c:43
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
Definition: stringfields.h:514

◆ stir_shaken_general_alloc()

static void* stir_shaken_general_alloc ( const char *  name)
static

Definition at line 104 of file general.c.

References ao2_ref, ast_sorcery_generic_alloc(), ast_string_field_init, NULL, and stir_shaken_general_destructor().

Referenced by stir_shaken_general_load().

105 {
106  struct stir_shaken_general *cfg;
107 
109  if (!cfg) {
110  return NULL;
111  }
112 
113  if (ast_string_field_init(cfg, 512)) {
114  ao2_ref(cfg, -1);
115  return NULL;
116  }
117 
118  return cfg;
119 }
#define NULL
Definition: resample.c:96
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
Definition: stringfields.h:353
#define ao2_ref(o, delta)
Definition: astobj2.h:464
static void stir_shaken_general_destructor(void *obj)
Definition: general.c:97
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
Definition: sorcery.c:1728

◆ stir_shaken_general_apply()

static int stir_shaken_general_apply ( const struct ast_sorcery sorcery,
void *  obj 
)
static

Definition at line 121 of file general.c.

Referenced by stir_shaken_general_load(), and stir_shaken_general_loaded().

122 {
123  return 0;
124 }

◆ stir_shaken_general_destructor()

static void stir_shaken_general_destructor ( void *  obj)
static

Definition at line 97 of file general.c.

References ast_string_field_free_memory.

Referenced by stir_shaken_general_alloc().

98 {
99  struct stir_shaken_general *cfg = obj;
100 
102 }
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Definition: stringfields.h:368

◆ stir_shaken_general_get()

struct stir_shaken_general* stir_shaken_general_get ( void  )

Retrieve the stir/shaken 'general' configuration object.

A default configuration object is returned if no configuration was specified. As well, NULL can be returned if there is no configuration, and a problem occurred while loading the defaults.

Note
Object is returned with a reference that the caller is responsible for de-referencing.
Return values
A'general' configuration object, or NULL

Definition at line 54 of file general.c.

References ao2_bump, ao2_cleanup, ao2_container_count(), ao2_find, ao2_ref, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), ast_stir_shaken_sorcery(), CONFIG_TYPE, container, and NULL.

Referenced by ast_stir_shaken_get_signature_timeout(), get_curl_instance(), stir_shaken_general_loaded(), and stir_shaken_general_show().

55 {
56  struct stir_shaken_general *cfg;
57  struct ao2_container *container;
58 
61  if (!container || ao2_container_count(container) == 0) {
62  ao2_cleanup(container);
63  return ao2_bump(default_config);
64  }
65 
66  cfg = ao2_find(container, NULL, 0);
67  ao2_ref(container, -1);
68 
69  return cfg;
70 }
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
Perform no matching, return all objects.
Definition: sorcery.h:123
static struct stir_shaken_general * default_config
Definition: general.c:52
Return all matching objects.
Definition: sorcery.h:120
#define NULL
Definition: resample.c:96
#define CONFIG_TYPE
Definition: general.c:28
#define ao2_bump(obj)
Definition: astobj2.h:491
#define ao2_ref(o, delta)
Definition: astobj2.h:464
struct ao2_container * container
Definition: res_fax.c:502
struct ast_sorcery * ast_stir_shaken_sorcery(void)
Retrieve the stir/shaken sorcery context.
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
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
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
Generic container type.

◆ stir_shaken_general_load()

int stir_shaken_general_load ( void  )

Load time initialization for the stir/shaken 'general' configuration.

Return values
0on success, -1 on error

Definition at line 248 of file general.c.

References __stringify, ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_sorcery_apply_default, ast_sorcery_instance_observer_add(), ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_register, ast_stir_shaken_sorcery(), ca_file_to_str(), ca_path_to_str(), stir_shaken_general::cache_max_size, CONFIG_TYPE, stir_shaken_general::curl_timeout, DEFAULT_CA_FILE, DEFAULT_CA_PATH, DEFAULT_CACHE_MAX_SIZE, DEFAULT_CURL_TIMEOUT, DEFAULT_SIGNATURE_TIMEOUT, FLDSET, LOG_ERROR, NULL, on_load_ca_file(), on_load_ca_path(), OPT_NOOP_T, OPT_UINT_T, stir_shaken_general::signature_timeout, sorcery, stir_shaken_general_alloc(), and stir_shaken_general_apply().

Referenced by load_module().

249 {
251 
252  ast_sorcery_apply_default(sorcery, CONFIG_TYPE, "config",
253  "stir_shaken.conf,criteria=type=general,single_object=yes,explicit_name=general");
254 
257  ast_log(LOG_ERROR, "stir/shaken - failed to register '%s' sorcery object\n", CONFIG_TYPE);
258  return -1;
259  }
260 
261  ast_sorcery_object_field_register(sorcery, CONFIG_TYPE, "type", "", OPT_NOOP_T, 0, 0);
266  ast_sorcery_object_field_register(sorcery, CONFIG_TYPE, "cache_max_size",
268  FLDSET(struct stir_shaken_general, cache_max_size));
269  ast_sorcery_object_field_register(sorcery, CONFIG_TYPE, "curl_timeout",
271  FLDSET(struct stir_shaken_general, curl_timeout));
272  ast_sorcery_object_field_register(sorcery, CONFIG_TYPE, "signature_timeout",
274  FLDSET(struct stir_shaken_general, signature_timeout));
275 
277  ast_log(LOG_ERROR, "stir/shaken - failed to register loaded observer for '%s' "
278  "sorcery object type\n", CONFIG_TYPE);
279  return -1;
280  }
281 
284 
285  return 0;
286 }
static int stir_shaken_general_apply(const struct ast_sorcery *sorcery, void *obj)
Definition: general.c:121
#define DEFAULT_CA_FILE
Definition: general.c:30
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
int ast_sorcery_instance_observer_add(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Add an observer to a sorcery instance.
Definition: sorcery.c:520
static int on_load_ca_file(const struct aco_option *opt, struct ast_variable *var, void *obj)
Definition: general.c:188
static int ca_file_to_str(const void *obj, const intptr_t *args, char **buf)
Definition: general.c:201
Full structure for sorcery.
Definition: sorcery.c:230
Type for a default handler that should do nothing.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
static struct ast_cli_entry stir_shaken_general_cli[]
Definition: general.c:184
#define NULL
Definition: resample.c:96
static const struct ast_sorcery_instance_observer stir_shaken_general_observer
Definition: general.c:154
#define CONFIG_TYPE
Definition: general.c:28
#define ast_log
Definition: astobj2.c:42
#define ast_sorcery_object_field_register_custom(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags,...)
Register a field within an object with custom handlers.
Definition: sorcery.h:1005
#define __stringify(x)
Definition: asterisk.h:214
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
static int on_load_ca_path(const struct aco_option *opt, struct ast_variable *var, void *obj)
Definition: general.c:210
Type for default option handler for unsigned integers.
#define DEFAULT_SIGNATURE_TIMEOUT
Definition: general.c:34
#define ast_sorcery_object_register(sorcery, type, alloc, transform, apply)
Register an object type.
Definition: sorcery.h:838
#define DEFAULT_CA_PATH
Definition: general.c:31
#define LOG_ERROR
Definition: logger.h:285
#define ast_sorcery_apply_default(sorcery, type, name, data)
Definition: sorcery.h:477
static int ca_path_to_str(const void *obj, const intptr_t *args, char **buf)
Definition: general.c:223
static void * stir_shaken_general_alloc(const char *name)
Definition: general.c:104
#define DEFAULT_CURL_TIMEOUT
Definition: general.c:33
struct ast_sorcery * ast_stir_shaken_sorcery(void)
Retrieve the stir/shaken sorcery context.
#define DEFAULT_CACHE_MAX_SIZE
Definition: general.c:32
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
Definition: sorcery.h:955
static struct ast_sorcery * sorcery

◆ stir_shaken_general_loaded()

static void stir_shaken_general_loaded ( const char *  name,
const struct ast_sorcery sorcery,
const char *  object_type,
int  reloaded 
)
static

Definition at line 126 of file general.c.

References ao2_ref, ast_sorcery_alloc(), CONFIG_TYPE, NULL, stir_shaken_general_apply(), and stir_shaken_general_get().

128 {
129  struct stir_shaken_general *cfg;
130 
131  if (strcmp(object_type, CONFIG_TYPE)) {
132  /* Not interested */
133  return;
134  }
135 
136  if (default_config) {
137  ao2_ref(default_config, -1);
139  }
140 
141  cfg = stir_shaken_general_get();
142  if (cfg) {
143  ao2_ref(cfg, -1);
144  return;
145  }
146 
147  /* Use the default configuration if on is not specified */
149  if (default_config) {
151  }
152 }
struct stir_shaken_general * stir_shaken_general_get()
Retrieve the stir/shaken 'general' configuration object.
Definition: general.c:54
static int stir_shaken_general_apply(const struct ast_sorcery *sorcery, void *obj)
Definition: general.c:121
static struct stir_shaken_general * default_config
Definition: general.c:52
#define NULL
Definition: resample.c:96
#define CONFIG_TYPE
Definition: general.c:28
#define ao2_ref(o, delta)
Definition: astobj2.h:464
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
Definition: sorcery.c:1744

◆ stir_shaken_general_show()

static char* stir_shaken_general_show ( struct ast_cli_entry e,
int  cmd,
struct ast_cli_args a 
)
static

Definition at line 158 of file general.c.

References ao2_cleanup, ast_cli_args::argc, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, stir_shaken_cli_show(), stir_shaken_general_get(), and ast_cli_entry::usage.

159 {
160  struct stir_shaken_general *cfg;
161 
162  switch(cmd) {
163  case CLI_INIT:
164  e->command = "stir_shaken show general";
165  e->usage =
166  "Usage: stir_shaken show general\n"
167  " Show the general stir/shaken settings\n";
168  return NULL;
169  case CLI_GENERATE:
170  return NULL;
171  }
172 
173  if (a->argc != 3) {
174  return CLI_SHOWUSAGE;
175  }
176 
177  cfg = stir_shaken_general_get();
178  stir_shaken_cli_show(cfg, a, 0);
179  ao2_cleanup(cfg);
180 
181  return CLI_SUCCESS;
182 }
struct stir_shaken_general * stir_shaken_general_get()
Retrieve the stir/shaken 'general' configuration object.
Definition: general.c:54
const int argc
Definition: cli.h:160
Definition: cli.h:152
#define NULL
Definition: resample.c:96
int stir_shaken_cli_show(void *obj, void *arg, int flags)
Output configuration settings to the Asterisk CLI.
Definition: stir_shaken.c:35
#define CLI_SHOWUSAGE
Definition: cli.h:45
char * command
Definition: cli.h:186
const char * usage
Definition: cli.h:177
#define CLI_SUCCESS
Definition: cli.h:44
#define ao2_cleanup(obj)
Definition: astobj2.h:1958

◆ stir_shaken_general_unload()

int stir_shaken_general_unload ( void  )

Unload time cleanup for the stir/shaken 'general' configuration.

Return values
0on success, -1 on error

Definition at line 232 of file general.c.

References ao2_ref, ARRAY_LEN, ast_cli_unregister_multiple(), ast_sorcery_instance_observer_remove(), ast_stir_shaken_sorcery(), and NULL.

Referenced by unload_module().

233 {
236 
239 
240  if (default_config) {
241  ao2_ref(default_config, -1);
243  }
244 
245  return 0;
246 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
static struct stir_shaken_general * default_config
Definition: general.c:52
static struct ast_cli_entry stir_shaken_general_cli[]
Definition: general.c:184
#define NULL
Definition: resample.c:96
static const struct ast_sorcery_instance_observer stir_shaken_general_observer
Definition: general.c:154
#define ao2_ref(o, delta)
Definition: astobj2.h:464
void ast_sorcery_instance_observer_remove(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Remove an observer from a sorcery instance.
Definition: sorcery.c:537
struct ast_sorcery * ast_stir_shaken_sorcery(void)
Retrieve the stir/shaken sorcery context.

Variable Documentation

◆ default_config

struct stir_shaken_general* default_config = NULL
static

Definition at line 52 of file general.c.

◆ stir_shaken_general_cli

struct ast_cli_entry stir_shaken_general_cli[]
static
Initial value:
= {
{ .handler = stir_shaken_general_show , .summary = "Show stir/shaken general configuration" ,},
}
static char * stir_shaken_general_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Definition: general.c:158

Definition at line 184 of file general.c.

◆ stir_shaken_general_observer

const struct ast_sorcery_instance_observer stir_shaken_general_observer
static
Initial value:
= {
.object_type_loaded = stir_shaken_general_loaded,
}
static void stir_shaken_general_loaded(const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded)
Definition: general.c:126

Definition at line 154 of file general.c.