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_channel_unref(c)
Decrease channel reference count.
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.
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.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
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)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define ast_malloc(len)
A wrapper for malloc()
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_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()
#define ast_var_assign(name, value)
#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.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
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.
static char prefix[MAX_PREFIX]
#define AST_APP_ARG(name)
Define an application argument.