45#define AST_MODULE "app_audiosocket"
46#define AUDIOSOCKET_CONFIG "audiosocket.conf"
47#define MAX_CONNECT_TIMEOUT_MSEC 2000
70static const char app[] =
"AudioSocket";
99 if (uuid_parse(
args.idStr, uu)) {
112 ast_log(
LOG_ERROR,
"Failed to set write format to SLINEAR for channel %s\n", chanName);
119 ast_log(
LOG_ERROR,
"Failed to set read format to SLINEAR for channel %s\n", chanName);
125 ast_log(
LOG_ERROR,
"Failed to restore write format for channel %s\n", chanName);
138 ast_log(
LOG_ERROR,
"Failed to restore write format for channel %s\n", chanName);
141 ast_log(
LOG_ERROR,
"Failed to restore read format for channel %s\n", chanName);
151 ast_log(
LOG_ERROR,
"Failed to restore write format for channel %s\n", chanName);
154 ast_log(
LOG_ERROR,
"Failed to restore read format for channel %s\n", chanName);
164 const char *chanName;
194 ast_log(
LOG_ERROR,
"Failed to forward channel frame from %s to AudioSocket\n",
207 "channel %s\n", chanName);
234 "AudioSocket Application",
239 .
requires =
"res_audiosocket",
static int audiosocket_exec(struct ast_channel *chan, const char *data)
static int audiosocket_run(struct ast_channel *chan, const char *id, const int svc)
static int load_module(void)
static int unload_module(void)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
ast_channel_state
ast_channel states
Generic File Format Support. Should be included by clients of the file handling routines....
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
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.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
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)
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
enum ast_frame_type frametype