Digital Milliwatt Test.
More...
Go to the source code of this file.
|
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Digital Milliwatt (mu-law) Test Application" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
| |
| static const char | app [] = "Milliwatt" |
| |
| static const struct ast_module_info * | ast_module_info = &__mod_info |
| |
| static const char | digital_milliwatt [] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} |
| |
| static struct ast_generator | milliwattgen |
| |
◆ __reg_module()
| static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
| static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ load_module()
| static int load_module |
( |
void |
| ) |
|
|
static |
◆ milliwatt_alloc()
| static void * milliwatt_alloc |
( |
struct ast_channel * |
chan, |
|
|
void * |
params |
|
) |
| |
|
static |
◆ milliwatt_exec()
| static int milliwatt_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 163 of file app_milliwatt.c.
164{
166 int res = -1;
167
170 }
173 } else {
175 }
176
177 while (!res) {
179 }
180
181 return res;
182}
static int old_milliwatt_exec(struct ast_channel *chan)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
References ast_playtones_start(), ast_safe_sleep(), ast_strlen_zero(), old_milliwatt_exec(), and options.
Referenced by load_module().
◆ milliwatt_generate()
| static int milliwatt_generate |
( |
struct ast_channel * |
chan, |
|
|
void * |
data, |
|
|
int |
len, |
|
|
int |
samples |
|
) |
| |
|
static |
Definition at line 90 of file app_milliwatt.c.
91{
94 int i, *indexp = (int *) data, res;
98 .src = __FUNCTION__,
99 };
100
103
104
105
106
107
108
112 }
113
117
118
119 for (i = 0; i <
len; i++) {
121 *indexp &= 7;
122 }
123
126
127 if (res < 0) {
129 return -1;
130 }
131
132 return 0;
133}
static const char digital_milliwatt[]
const char * ast_channel_name(const struct ast_channel *chan)
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 int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
union ast_frame::@239 data
References ARRAY_LEN, ast_channel_name(), ast_format_ulaw, AST_FRAME_VOICE, ast_frfree, AST_FRIENDLY_OFFSET, ast_log, ast_write(), buf, ast_frame::data, ast_frame::datalen, digital_milliwatt, errno, ast_frame_subclass::format, ast_frame::frametype, len(), LOG_WARNING, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
◆ milliwatt_release()
| static void milliwatt_release |
( |
struct ast_channel * |
chan, |
|
|
void * |
data |
|
) |
| |
|
static |
◆ old_milliwatt_exec()
| static int old_milliwatt_exec |
( |
struct ast_channel * |
chan | ) |
|
|
static |
Definition at line 141 of file app_milliwatt.c.
142{
145
148 }
149
152 return -1;
153 }
154
156 ;
157
159
160 return -1;
161}
static struct ast_generator milliwattgen
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
void ast_deactivate_generator(struct ast_channel *chan)
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
int ast_answer(struct ast_channel *chan)
Answer a channel.
ast_channel_state
ast_channel states
References ast_activate_generator(), ast_answer(), ast_channel_name(), ast_deactivate_generator(), ast_format_ulaw, ast_log, ast_safe_sleep(), ast_set_read_format(), ast_set_write_format(), AST_STATE_UP, LOG_WARNING, and milliwattgen.
Referenced by milliwatt_exec().
◆ unload_module()
| static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
◆ app
| const char app[] = "Milliwatt" |
|
static |
◆ ast_module_info
◆ digital_milliwatt
| const char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} |
|
static |
◆ milliwattgen
Initial value:= {
}
static void * milliwatt_alloc(struct ast_channel *chan, void *params)
static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
static void milliwatt_release(struct ast_channel *chan, void *data)
Definition at line 135 of file app_milliwatt.c.
Referenced by old_milliwatt_exec().