35 #include <uuid/uuid.h> 45 #define AST_MODULE "app_audiosocket" 46 #define AUDIOSOCKET_CONFIG "audiosocket.conf" 47 #define MAX_CONNECT_TIMEOUT_MSEC 2000 70 static 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",
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
ast_channel_state
ast_channel states
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
const int ast_audiosocket_connect(const char *server, struct ast_channel *chan)
Send the initial message to an AudioSocket server.
#define ast_strlen_zero(foo)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
static int load_module(void)
const int ast_audiosocket_init(const int svc, const char *id)
Send the initial message to an AudioSocket server.
General Asterisk PBX channel definitions.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
#define ao2_ref(o, delta)
#define ast_strdupa(s)
duplicate a string in memory from the stack
AudioSocket support functions.
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
const int ast_audiosocket_send_frame(const int svc, const struct ast_frame *f)
Send an Asterisk audio frame to an AudioSocket server.
static int unload_module(void)
static void parse(struct mgcp_request *req)
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.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
struct ast_frame * ast_audiosocket_receive_frame(const int svc)
Receive an Asterisk frame from an AudioSocket server.
const char * ast_channel_name(const struct ast_channel *chan)
Data structure associated with a single frame of data.
union ast_frame::@263 data
enum ast_frame_type frametype
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
static int audiosocket_exec(struct ast_channel *chan, const char *data)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int audiosocket_run(struct ast_channel *chan, const char *id, const int svc)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.