92 .
type =
"SHARED_VARIABLES",
152 sprintf(prefix,
"%s-",
args.chan);
173 varshead = varstore->
data;
213 sprintf(prefix,
"%s-",
args.chan);
228 ast_log(
LOG_ERROR,
"Unable to allocate new datastore. Shared variable not set.\n");
236 if (!(varshead =
ast_calloc(1,
sizeof(*varshead)))) {
237 ast_log(
LOG_ERROR,
"Unable to allocate variable structure. Shared variable not set.\n");
249 varshead = varstore->
data;
266 "Variable: SHARED(%s)\r\n"
269 chan ? chan->
name :
"none",
args.var, value,
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
const ast_string_field uniqueid
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_channel_unref(c)
Decrease channel reference count.
const char * ast_var_value(const struct ast_var_t *var)
struct ast_var_t * ast_var_assign(const char *name, const char *value)
const char * ast_var_name(const struct ast_var_t *var)
static int shared_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Structure for a data store type.
Structure for a data store object.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
static struct ast_datastore_info shared_variable_info
static int unload_module(void)
#define EVENT_FLAG_DIALPLAN
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
void ast_var_delete(struct ast_var_t *var)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
struct ast_channel * ast_channel_get_by_name_prefix(const char *name, size_t name_len)
Find a channel by a name prefix.
static int global_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int shared_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function shared_function
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Data structure associated with a custom dialplan function.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Core PBX routines and definitions.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
struct ast_datastore * ast_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define ast_channel_unlock(chan)
struct ast_var_t::@158 entries
static int load_module(void)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
static void shared_variable_free(void *data)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static struct ast_custom_function global_function
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define AST_APP_ARG(name)
Define an application argument.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define ASTERISK_GPL_KEY
The text the key() function should return.
static int global_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
Asterisk module definitions.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_custom_function_register(acf)
Register a custom function.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
static char prefix[MAX_PREFIX]