63 .
type =
"AudioSocket",
64 .description =
"AudioSocket Channel Driver",
92 if (instance ==
NULL || instance->
svc < 1) {
115 if (instance !=
NULL && instance->
svc > 0) {
116 close(instance->
svc);
160 ast_log(
LOG_ERROR,
"Destination is required for the 'AudioSocket' channel\n");
167 ast_log(
LOG_ERROR,
"Destination is required for the 'AudioSocket' channel\n");
180 if (uuid_parse(
args.idStr, uu)) {
197 ast_log(
LOG_ERROR,
"Codec '%s' not found for AudioSocket connection to '%s'\n",
204 ast_log(
LOG_ERROR,
"No codec available for AudioSocket connection to '%s'\n",
228 requestor, 0,
"AudioSocket/%s-%s",
args.destination,
args.idStr);
258 if (instance !=
NULL) {
300 .
requires =
"res_audiosocket",
Access Control of various sorts.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Internal Asterisk hangup causes.
#define AST_CAUSE_FAILURE
@ OPT_ARG_AUDIOSOCKET_CODEC
struct audiosocket_instance audiosocket_instance
static int audiosocket_hangup(struct ast_channel *ast)
Function called when we should hang the channel up.
static int audiosocket_write(struct ast_channel *ast, struct ast_frame *f)
Function called when we should write a frame to the channel.
static const struct ast_app_option audiosocket_options[128]
static struct ast_channel_tech audiosocket_channel_tech
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 load_module(void)
Function called when our module is loaded.
static int audiosocket_call(struct ast_channel *ast, const char *dest, int timeout)
Function called when we should actually call the destination.
static int unload_module(void)
Function called when our module is unloaded.
static struct ast_frame * audiosocket_read(struct ast_channel *ast)
Function called when we should read a frame from the channel.
General Asterisk PBX channel definitions.
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
int ast_channel_register(const struct ast_channel_tech *tech)
Register a channel technology (a new channel driver) Called by a channel module to register the kind ...
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
#define ast_channel_unlock(chan)
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_CHANNEL_DRIVER
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
int ast_sockaddr_resolve_first_af(struct ast_sockaddr *addr, const char *name, int flag, int family)
Return the first entry from ast_sockaddr_resolve filtered by address family.
Core PBX routines and definitions.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
AudioSocket support functions.
const int ast_audiosocket_init(const int svc, const char *id)
Send the initial message to an AudioSocket server.
const int ast_audiosocket_send_frame(const int svc, const struct ast_frame *f)
Send an Asterisk audio frame to an AudioSocket server.
struct ast_frame * ast_audiosocket_receive_frame(const int svc)
Receive an Asterisk frame from an AudioSocket server.
const int ast_audiosocket_connect(const char *server, struct ast_channel *chan)
Send the initial message to an AudioSocket server.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Structure to pass both assignedid values to channel drivers.
Structure to describe a channel "technology", ie a channel driver See for examples:
struct ast_format_cap * capabilities
Main Channel structure associated with a channel.
Structure used to handle boolean flags.
Data structure associated with a single frame of data.
Socket address structure.
#define ast_test_flag(p, flag)