MUTESTREAM audiohooks. More...
#include "asterisk.h"
#include "asterisk/options.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/frame.h"
#include "asterisk/utils.h"
#include "asterisk/audiohook.h"
#include "asterisk/manager.h"
Go to the source code of this file.
Data Structures | |
struct | mute_information |
Macros | |
#define | FALSE 0 |
#define | TRUE 1 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | destroy_callback (void *data) |
static int | func_mute_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
Mute dialplan function. More... | |
static struct ast_datastore * | initialize_mutehook (struct ast_channel *chan) |
Initialize mute hook on channel, but don't activate it. More... | |
static int | load_module (void) |
static int | manager_mutestream (struct mansession *s, const struct message *m) |
static int | mute_add_audiohook (struct ast_channel *chan, struct mute_information *mute, struct ast_datastore *datastore) |
Add or activate mute audiohook on channel Assumes channel is locked. More... | |
static int | mute_callback (struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction) |
The callback from the audiohook subsystem. We basically get a frame to have fun with. More... | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Mute audio stream resources" , .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 const char | mandescr_mutestream [] |
static struct ast_datastore_info | mute_datastore |
Static structure for datastore information. More... | |
static struct ast_custom_function | mute_function |
MUTESTREAM audiohooks.
Definition in file res_mutestream.c.
#define FALSE 0 |
Definition at line 102 of file res_mutestream.c.
#define TRUE 1 |
Definition at line 101 of file res_mutestream.c.
Referenced by manager_mutestream().
|
static |
Definition at line 356 of file res_mutestream.c.
|
static |
Definition at line 356 of file res_mutestream.c.
|
static |
Datastore destroy audiohook callback
Definition at line 105 of file res_mutestream.c.
References ast_audiohook_destroy(), ast_free, ast_module_unref(), mute_information::audiohook, mute, and ast_module_info::self.
|
static |
Mute dialplan function.
Definition at line 203 of file res_mutestream.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore_free(), ast_debug, ast_free, ast_log(), ast_true(), ast_datastore::data, initialize_mutehook(), LOG_WARNING, mute, mute_add_audiohook(), mute_information::mute_read, and mute_information::mute_write.
|
static |
Initialize mute hook on channel, but don't activate it.
Definition at line 164 of file res_mutestream.c.
References ast_audiohook_init(), AST_AUDIOHOOK_TYPE_MANIPULATE, ast_calloc, ast_datastore_alloc(), ast_datastore_free(), ast_debug, mute_information::audiohook, ast_datastore::data, ast_audiohook::manipulate_callback, mute, and mute_callback().
Referenced by func_mute_write(), and manager_mutestream().
|
static |
Definition at line 336 of file res_mutestream.c.
References ast_custom_function_register, ast_manager_register2(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, EVENT_FLAG_SYSTEM, and manager_mutestream().
|
static |
Definition at line 253 of file res_mutestream.c.
References ast_channel_datastore_find(), ast_channel_get_by_name(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_datastore_free(), ast_free, ast_strlen_zero(), ast_true(), astman_append(), astman_get_header(), astman_send_error(), ast_datastore::data, initialize_mutehook(), mute, mute_add_audiohook(), mute_information::mute_read, mute_information::mute_write, and TRUE.
Referenced by load_module().
|
static |
Add or activate mute audiohook on channel Assumes channel is locked.
Definition at line 189 of file res_mutestream.c.
References ast_audiohook_attach(), ast_channel_datastore_add(), ast_debug, ast_log(), ast_module_ref(), mute_information::audiohook, LOG_ERROR, ast_channel::name, and ast_module_info::self.
Referenced by func_mute_write(), and manager_mutestream().
|
static |
The callback from the audiohook subsystem. We basically get a frame to have fun with.
Definition at line 124 of file res_mutestream.c.
References AST_AUDIOHOOK_DIRECTION_READ, AST_AUDIOHOOK_DIRECTION_WRITE, AST_AUDIOHOOK_STATUS_DONE, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_debug, ast_frame_clear(), AST_FRAME_VOICE, ast_datastore::data, ast_frame::frametype, mute, mute_information::mute_read, mute_information::mute_write, and ast_audiohook::status.
Referenced by initialize_mutehook().
|
static |
Definition at line 347 of file res_mutestream.c.
References ast_custom_function_unregister(), and ast_manager_unregister().
|
static |
Definition at line 356 of file res_mutestream.c.
|
static |
Definition at line 356 of file res_mutestream.c.
|
static |
Definition at line 327 of file res_mutestream.c.
|
static |
Static structure for datastore information.
Definition at line 118 of file res_mutestream.c.
|
static |
Definition at line 248 of file res_mutestream.c.