109 .
type =
"audiohook inheritance",
126 struct audiohook_inheritance_datastore *datastore = data;
128 ast_debug(2,
"inheritance fixup occurring for channels %s(%p) and %s(%p)", old_chan->
name, old_chan, new_chan->
name, new_chan);
132 ast_debug(3,
"Moved audiohook %s from %s(%p) to %s(%p)\n",
133 audiohook->
source, old_chan->
name, old_chan, new_chan->
name, new_chan);
145 struct audiohook_inheritance_datastore *audiohook_inheritance_datastore = data;
152 ast_free(audiohook_inheritance_datastore);
163 struct audiohook_inheritance_datastore *audiohook_inheritance_datastore = NULL;
169 if (!(audiohook_inheritance_datastore =
ast_calloc(1,
sizeof(*audiohook_inheritance_datastore)))) {
174 datastore->
data = audiohook_inheritance_datastore;
178 return audiohook_inheritance_datastore;
192 inheritable_audiohook =
ast_calloc(1,
sizeof(*inheritable_audiohook) + strlen(source));
194 if (!inheritable_audiohook) {
198 strcpy(inheritable_audiohook->
source, source);
200 ast_debug(3,
"Set audiohook %s to be inheritable\n", source);
217 struct audiohook_inheritance_datastore *inheritance_datastore = NULL;
244 ast_debug(1,
"Audiohook %s is already set to not be inheritable on channel %s\n", data, chan->
name);
253 inheritance_datastore = datastore->
data;
260 if (!strcasecmp(inheritable_audiohook->
source, data)) {
262 ast_debug(2,
"Audiohook source %s is already set up to be inherited from channel %s\n", data, chan->
name);
265 ast_debug(2,
"Removing inheritability of audiohook %s from channel %s\n", data, chan->
name);
283 ast_debug(1,
"Audiohook %s is already set to not be inheritable on channel %s\n", data, chan->
name);
289 .
name =
"AUDIOHOOK_INHERIT",
static struct ast_datastore_info audiohook_inheritance_info
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
void ast_audiohook_move_by_source(struct ast_channel *old_chan, struct ast_channel *new_chan, const char *source)
Move an audiohook from one channel to a new one.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
static int func_inheritance_write(struct ast_channel *chan, const char *function, char *data, const char *value)
Set the permissibility of inheritance for a particular audiohook source on a channel.
Asterisk main include file. File version handling, generic pbx functions.
#define AST_LIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
struct audiohook_inheritance_datastore::@130 allowed_list
struct inheritable_audiohook::@129 list
Structure for a data store type.
static int setup_inheritable_audiohook(struct audiohook_inheritance_datastore *audiohook_inheritance_datastore, const char *source)
Create a new inheritable_audiohook structure and add it to an audiohook_inheritance_datastore.
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 load_module(void)
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
static struct ast_custom_function inheritance_function
static void audiohook_inheritance_destroy(void *data)
Destroy dynamically allocated data on an audiohook_inheritance_datastore.
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.
Asterisk datastore objects.
static struct audiohook_inheritance_datastore * setup_inheritance_datastore(struct ast_channel *chan)
create an audiohook_inheritance_datastore and attach it to a channel
#define ast_debug(level,...)
Log a DEBUG message.
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.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
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_ENTRY(type)
Declare a forward link structure inside a list entry.
#define ast_channel_unlock(chan)
static void audiohook_inheritance_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Move audiohooks as defined by previous calls to the AUDIOHOOK_INHERIT function.
Support for logging to various files, console and syslog Configuration in file logger.conf.
#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.
Asterisk module definitions.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
static int unload_module(void)
#define ast_custom_function_register(acf)
Register a custom function.