Audiohook inheritance function. More...
#include "asterisk.h"
#include "asterisk/datastore.h"
#include "asterisk/channel.h"
#include "asterisk/logger.h"
#include "asterisk/audiohook.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
Go to the source code of this file.
Data Structures | |
struct | audiohook_inheritance_datastore |
struct | inheritable_audiohook |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | audiohook_inheritance_destroy (void *data) |
Destroy dynamically allocated data on an audiohook_inheritance_datastore. More... | |
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. More... | |
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. More... | |
static int | load_module (void) |
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. More... | |
static struct audiohook_inheritance_datastore * | setup_inheritance_datastore (struct ast_channel *chan) |
create an audiohook_inheritance_datastore and attach it to a channel More... | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Audiohook inheritance function" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_datastore_info | audiohook_inheritance_info |
static struct ast_custom_function | inheritance_function |
Audiohook inheritance function.
Definition in file func_audiohookinherit.c.
|
static |
Definition at line 306 of file func_audiohookinherit.c.
|
static |
Definition at line 306 of file func_audiohookinherit.c.
|
static |
Destroy dynamically allocated data on an audiohook_inheritance_datastore.
data | Pointer to the audiohook_inheritance_datastore in question. |
Definition at line 143 of file func_audiohookinherit.c.
References audiohook_inheritance_datastore::allowed_list, ast_free, and AST_LIST_REMOVE_HEAD.
|
static |
Move audiohooks as defined by previous calls to the AUDIOHOOK_INHERIT function.
Move allowed audiohooks from the old channel to the new channel.
data | The ast_datastore containing audiohook inheritance information that will be moved |
old_chan | The "clone" channel from a masquerade. We are moving the audiohook in question off of this channel |
new_chan | The "original" channel from a masquerade. We are moving the audiohook in question to this channel |
Definition at line 123 of file func_audiohookinherit.c.
References audiohook_inheritance_datastore::allowed_list, ast_audiohook_move_by_source(), ast_debug, AST_LIST_TRAVERSE, ast_channel::name, and inheritable_audiohook::source.
|
static |
Set the permissibility of inheritance for a particular audiohook source on a channel.
For details regarding what happens in the function, see the inline comments
chan | The channel we are operating on |
function | The name of the dialplan function (AUDIOHOOK_INHERIT) |
data | The audiohook source for which we are setting inheritance permissions |
value | The value indicating the permission for audiohook inheritance |
Definition at line 213 of file func_audiohookinherit.c.
References audiohook_inheritance_datastore::allowed_list, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_debug, ast_free, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_log(), ast_strlen_zero(), ast_true(), audiohook_inheritance_info, ast_datastore::data, LOG_WARNING, ast_channel::name, setup_inheritable_audiohook(), setup_inheritance_datastore(), and inheritable_audiohook::source.
|
static |
Definition at line 298 of file func_audiohookinherit.c.
References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, and AST_MODULE_LOAD_SUCCESS.
|
static |
Create a new inheritable_audiohook structure and add it to an audiohook_inheritance_datastore.
audiohook_inheritance_datastore | The audiohook_inheritance_datastore we want to add the new inheritable_audiohook to |
source | The audiohook source for the newly created inheritable_audiohook |
0 | Success |
non-zero | Failure |
Definition at line 188 of file func_audiohookinherit.c.
References audiohook_inheritance_datastore::allowed_list, ast_calloc, ast_debug, AST_LIST_INSERT_TAIL, and inheritable_audiohook::source.
Referenced by func_inheritance_write().
|
static |
create an audiohook_inheritance_datastore and attach it to a channel
chan | The channel to which we wish to attach the new datastore |
Definition at line 160 of file func_audiohookinherit.c.
References ast_calloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc(), ast_datastore_free(), audiohook_inheritance_info, and ast_datastore::data.
Referenced by func_inheritance_write().
|
static |
Definition at line 293 of file func_audiohookinherit.c.
References ast_custom_function_unregister().
|
static |
Definition at line 306 of file func_audiohookinherit.c.
|
static |
Definition at line 306 of file func_audiohookinherit.c.
|
static |
Definition at line 108 of file func_audiohookinherit.c.
Referenced by func_inheritance_write(), and setup_inheritance_datastore().
|
static |
Definition at line 288 of file func_audiohookinherit.c.