36 #include "asterisk/module.h"
63 static const char app[] =
"Milliwatt";
82 int i, *indexp = (
int *) data;
96 if (samples > maxsamples) {
101 len = samples *
sizeof (buf[0]);
106 for (i = 0; i <
len; i++) {
107 buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++];
149 const char *options = data;
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static int unload_module(void)
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
int ast_unregister_application(const char *app)
Unregister an application.
int ast_set_write_format(struct ast_channel *chan, format_t format)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
int ast_set_read_format(struct ast_channel *chan, format_t format)
Sets read format on channel chan Set read format for channel to whichever component of "format" is be...
General Asterisk PBX channel definitions.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
static int load_module(void)
static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
static void * milliwatt_alloc(struct ast_channel *chan, void *params)
Core PBX routines and definitions.
static void milliwatt_release(struct ast_channel *chan, void *data)
static const char digital_milliwatt[]
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
enum ast_channel_state _state
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
void *(* alloc)(struct ast_channel *chan, void *params)
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.
static struct ast_generator milliwattgen
static int milliwatt_exec(struct ast_channel *chan, const char *data)
void ast_deactivate_generator(struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
Data structure associated with a single frame of data.
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
enum ast_frame_type frametype
#define ASTERISK_GPL_KEY
The text the key() function should return.
static int old_milliwatt_exec(struct ast_channel *chan)
union ast_frame::@172 data
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.