Definition at line 166 of file func_volume.c.
167{
170 int is_new = 0;
171
172
173
177 );
178
179 if (!chan) {
181 return -1;
182 }
183
185
189
191 return 0;
194 return 0;
195 }
199 is_new = 1;
200 } else {
202 vi = datastore->
data;
203 }
204
205
208 return -1;
209 }
210
211 if (!strcasecmp(
args.direction,
"tx")) {
213 }
else if (!strcasecmp(
args.direction,
"rx")) {
215 } else {
217 }
218
219 if (is_new) {
220 datastore->
data = vi;
225 }
226
227
228
233 } else {
235 }
236
237 return 0;
238}
#define ast_calloc(num, len)
A wrapper for calloc()
@ AST_AUDIOHOOK_MANIPULATE_ALL_RATES
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source, enum ast_audiohook_init_flags flags)
Initialize an audiohook structure.
@ AST_AUDIOHOOK_WANTS_DTMF
int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audiohook)
Attach audiohook to channel.
@ AST_AUDIOHOOK_TYPE_MANIPULATE
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
static const struct ast_app_option volume_opts[128]
static int volume_callback(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
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.
ast_audiohook_manipulate_callback manipulate_callback
Structure used to handle boolean flags.
#define ast_set_flag(p, flag)
References args, AST_APP_ARG, ast_app_parse_options(), ast_audiohook_attach(), ast_audiohook_init(), AST_AUDIOHOOK_MANIPULATE_ALL_RATES, AST_AUDIOHOOK_TYPE_MANIPULATE, AST_AUDIOHOOK_WANTS_DTMF, ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, ast_datastore_free(), AST_DECLARE_APP_ARGS, ast_log, ast_set_flag, AST_STANDARD_APP_ARGS, ast_strlen_zero(), volume_information::audiohook, ast_datastore::data, volume_information::flags, ast_flags::flags, LOG_ERROR, LOG_WARNING, ast_audiohook::manipulate_callback, NULL, options, volume_information::rx_gain, volume_information::tx_gain, value, volume_callback(), volume_datastore, and volume_opts.