| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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. | |
| static int | audiosocket_hangup (struct ast_channel *ast) | 
| Function called when we should hang the channel up. | |
| static struct ast_frame * | audiosocket_read (struct ast_channel *ast) | 
| Function called when we should read a frame from the channel. | |
| 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. | |
| static int | audiosocket_send_dtmf (struct ast_channel *ast, char digit, unsigned int duration) | 
| Function called when we should write a DTMF frame to the channel. | |
| static int | audiosocket_write (struct ast_channel *ast, struct ast_frame *f) | 
| Function called when we should write a frame to the channel. | |
| static int | load_module (void) | 
| Function called when our module is loaded. | |
| static int | unload_module (void) | 
| Function called when our module is unloaded. | |
| Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "AudioSocket Channel" , .key = ASTERISK_GPL_KEY , .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 46 of file chan_audiosocket.c.
| anonymous enum | 
| Enumerator | |
|---|---|
| OPT_AUDIOSOCKET_CODEC | |
Definition at line 168 of file chan_audiosocket.c.
| anonymous enum | 
| Enumerator | |
|---|---|
| OPT_ARG_AUDIOSOCKET_CODEC | |
| OPT_ARG_ARRAY_SIZE | |
Definition at line 172 of file chan_audiosocket.c.
| 
 | static | 
Definition at line 346 of file chan_audiosocket.c.
| 
 | static | 
Definition at line 346 of file chan_audiosocket.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) | 
Definition at line 346 of file chan_audiosocket.c.
| 
 | static | 
Function called when we should actually call the destination.
Definition at line 142 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 152 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 77 of file chan_audiosocket.c.
References ast_audiosocket_receive_frame_with_hangup(), ast_channel_name(), ast_channel_tech_pvt(), ast_log, FD_OUTPUT, hangup(), LOG_ERROR, NULL, audiosocket_instance::server, and audiosocket_instance::svc.
| 
 | static | 
Function called when we should prepare to call the unicast destination.
Definition at line 182 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(), audiosocket_instance::server, and audiosocket_instance::svc.
| 
 | static | 
Function called when we should write a DTMF frame to the channel.
Definition at line 118 of file chan_audiosocket.c.
References ast_audiosocket_send_frame(), ast_channel_name(), ast_channel_tech_pvt(), AST_FRAME_DTMF, ast_log, digit, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::len, LOG_ERROR, NULL, audiosocket_instance::server, ast_frame::subclass, and audiosocket_instance::svc.
| 
 | static | 
Function called when we should write a frame to the channel.
Definition at line 99 of file chan_audiosocket.c.
References ast_audiosocket_send_frame(), ast_channel_name(), ast_channel_tech_pvt(), ast_log, LOG_ERROR, NULL, audiosocket_instance::server, and audiosocket_instance::svc.
| 
 | static | 
Function called when our module is loaded.
Definition at line 324 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 314 of file chan_audiosocket.c.
References ao2_cleanup, ast_channel_unregister(), audiosocket_channel_tech, ast_channel_tech::capabilities, and NULL.
| 
 | static | 
Definition at line 346 of file chan_audiosocket.c.
| 
 | static | 
Definition at line 346 of file chan_audiosocket.c.
| 
 | static | 
Definition at line 65 of file chan_audiosocket.c.
Referenced by audiosocket_request(), load_module(), and unload_module().
| 
 | static | 
Definition at line 179 of file chan_audiosocket.c.
Referenced by audiosocket_request().