108 .
type =
"SHARED_VARIABLES",
168 sprintf(prefix,
"%s-",
args.chan);
189 varshead = varstore->
data;
231 sprintf(prefix,
"%s-",
args.chan);
242 len = 9 + strlen(
args.var);
244 if (!shared_buffer) {
255 ast_log(
LOG_ERROR,
"Unable to allocate new datastore. Shared variable not set.\n");
263 if (!(varshead =
ast_calloc(1,
sizeof(*varshead)))) {
264 ast_log(
LOG_ERROR,
"Unable to allocate variable structure. Shared variable not set.\n");
276 varshead = varstore->
data;
292 sprintf(shared_buffer,
"SHARED(%s)",
args.var);
#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.
#define ast_channel_unref(c)
Decrease channel reference count.
const char * ast_var_value(const struct ast_var_t *var)
const char * ast_var_name(const struct ast_var_t *var)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static int shared_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
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 int unload_module(void)
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
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.
#define ast_strlen_zero(foo)
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.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
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_malloc(len)
A wrapper for malloc()
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Core PBX routines and definitions.
static const struct ast_datastore_info shared_variable_info
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
void ast_channel_publish_varset(struct ast_channel *chan, const char *variable, const char *value)
Publish a ast_channel_varset for a channel.
void ast_var_delete(struct ast_var_t *var)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#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)
#define ast_calloc(num, len)
A wrapper for calloc()
struct ast_var_t::@249 entries
#define ast_var_assign(name, value)
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...
#define ast_datastore_alloc(info, uid)
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#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)
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_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.
static char prefix[MAX_PREFIX]
#define AST_APP_ARG(name)
Define an application argument.