Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
AudioSocket Channel. More...
#include "asterisk.h"
#include <uuid/uuid.h>
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/res_audiosocket.h"
#include "asterisk/pbx.h"
#include "asterisk/acl.h"
#include "asterisk/app.h"
#include "asterisk/causes.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | audiosocket_instance |
Macros | |
#define | FD_OUTPUT 1 /* A fd of -1 means an error, 0 is stdin */ |
Enumerations | |
enum | { OPT_AUDIOSOCKET_CODEC = (1 << 0) } |
enum | { OPT_ARG_AUDIOSOCKET_CODEC = (1 << 0) , OPT_ARG_ARRAY_SIZE } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | audiosocket_call (struct ast_channel *ast, const char *dest, int timeout) |
Function called when we should actually call the destination. More... | |
static int | audiosocket_hangup (struct ast_channel *ast) |
Function called when we should hang the channel up. More... | |
static struct ast_frame * | audiosocket_read (struct ast_channel *ast) |
Function called when we should read a frame from the channel. More... | |
static struct ast_channel * | audiosocket_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
Function called when we should prepare to call the unicast destination. More... | |
static int | audiosocket_write (struct ast_channel *ast, struct ast_frame *f) |
Function called when we should write a frame to the channel. More... | |
static int | load_module (void) |
Function called when our module is loaded. More... | |
static int | unload_module (void) |
Function called when our module is unloaded. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "AudioSocket Channel" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DRIVER, .requires = "res_audiosocket", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_channel_tech | audiosocket_channel_tech |
struct audiosocket_instance | audiosocket_instance |
static const struct ast_app_option | audiosocket_options [128] = { [ 'c' ] = { .flag = OPT_AUDIOSOCKET_CODEC , .arg_index = OPT_ARG_AUDIOSOCKET_CODEC + 1 }, } |
AudioSocket Channel.
Definition in file chan_audiosocket.c.
#define FD_OUTPUT 1 /* A fd of -1 means an error, 0 is stdin */ |
Definition at line 45 of file chan_audiosocket.c.
anonymous enum |
Enumerator | |
---|---|
OPT_AUDIOSOCKET_CODEC |
Definition at line 125 of file chan_audiosocket.c.
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_AUDIOSOCKET_CODEC | |
OPT_ARG_ARRAY_SIZE |
Definition at line 129 of file chan_audiosocket.c.
|
static |
Definition at line 301 of file chan_audiosocket.c.
|
static |
Definition at line 301 of file chan_audiosocket.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 301 of file chan_audiosocket.c.
|
static |
Function called when we should actually call the destination.
Definition at line 99 of file chan_audiosocket.c.
References ast_audiosocket_init(), ast_channel_tech_pvt(), AST_CONTROL_ANSWER, ast_queue_control(), audiosocket_instance::id, and audiosocket_instance::svc.
|
static |
Function called when we should hang the channel up.
Definition at line 109 of file chan_audiosocket.c.
References ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), ast_free, NULL, and audiosocket_instance::svc.
|
static |
Function called when we should read a frame from the channel.
Definition at line 73 of file chan_audiosocket.c.
References ast_audiosocket_receive_frame(), ast_channel_tech_pvt(), FD_OUTPUT, NULL, and audiosocket_instance::svc.
|
static |
Function called when we should prepare to call the unicast destination.
Definition at line 139 of file chan_audiosocket.c.
References ao2_cleanup, ao2_ref, args, AST_AF_UNSPEC, AST_APP_ARG, ast_app_parse_options(), ast_audiosocket_connect(), ast_calloc, AST_CAUSE_FAILURE, ast_channel_alloc, ast_channel_nativeformats_set(), ast_channel_set_fd(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_unlock, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_format_cache_get, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_free, ast_log, AST_NONSTANDARD_APP_ARGS, ast_sockaddr_resolve_first_af(), AST_STATE_DOWN, ast_strdupa, ast_strlen_zero(), ast_test_flag, audiosocket_channel_tech, audiosocket_options, audiosocket_instance::id, LOG_ERROR, NULL, OPT_ARG_ARRAY_SIZE, OPT_ARG_AUDIOSOCKET_CODEC, OPT_AUDIOSOCKET_CODEC, options, PARSE_PORT_REQUIRE, pbx_builtin_setvar_helper(), and audiosocket_instance::svc.
|
static |
Function called when we should write a frame to the channel.
Definition at line 86 of file chan_audiosocket.c.
References ast_audiosocket_send_frame(), ast_channel_tech_pvt(), NULL, and audiosocket_instance::svc.
|
static |
Function called when our module is loaded.
Definition at line 279 of file chan_audiosocket.c.
References ao2_ref, ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, AST_MEDIA_TYPE_UNKNOWN, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, audiosocket_channel_tech, ast_channel_tech::capabilities, LOG_ERROR, and NULL.
|
static |
Function called when our module is unloaded.
Definition at line 269 of file chan_audiosocket.c.
References ao2_cleanup, ast_channel_unregister(), audiosocket_channel_tech, ast_channel_tech::capabilities, and NULL.
|
static |
Definition at line 301 of file chan_audiosocket.c.
|
static |
Definition at line 301 of file chan_audiosocket.c.
|
static |
Definition at line 62 of file chan_audiosocket.c.
Referenced by audiosocket_request(), load_module(), and unload_module().
|
static |
Definition at line 136 of file chan_audiosocket.c.
Referenced by audiosocket_request().