Asterisk - The Open Source Telephony Project GIT-master-5963e62
|
Trivial application to record a sound file. More...
#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
#include "asterisk/channel.h"
#include "asterisk/dsp.h"
#include "asterisk/format_cache.h"
#include "asterisk/paths.h"
Go to the source code of this file.
Data Structures | |
struct | recording_data |
Macros | |
#define | OPERATOR_KEY '0' |
Enumerations | |
enum | { OPTION_APPEND = (1 << 0) , OPTION_NOANSWER = (1 << 1) , OPTION_QUIET = (1 << 2) , OPTION_SKIP = (1 << 3) , OPTION_STAR_TERMINATE = (1 << 4) , OPTION_IGNORE_TERMINATE = (1 << 5) , OPTION_KEEP = (1 << 6) , OPTION_ANY_TERMINATE = (1 << 7) , OPTION_OPERATOR_EXIT = (1 << 8) , OPTION_NO_TRUNCATE = (1 << 9) } |
enum | dtmf_response { RESPONSE_NO_MATCH = 0 , RESPONSE_OPERATOR , RESPONSE_DTMF } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | create_destination_directory (const char *path) |
static int | load_module (void) |
static enum dtmf_response | record_dtmf_response (struct ast_channel *chan, struct ast_flags *flags, int dtmf_integer, int terminator) |
static int | record_exec (struct ast_channel *chan, const char *data) |
static void | recording_data_free (void *data) |
static int | recording_info_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Trivial Record Application" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static struct ast_custom_function | acf_recording_info |
static char * | app = "Record" |
static const struct ast_app_option | app_opts [128] = { [ 'a' ] = { .flag = OPTION_APPEND }, [ 'k' ] = { .flag = OPTION_KEEP }, [ 'n' ] = { .flag = OPTION_NOANSWER }, [ 'o' ] = { .flag = OPTION_OPERATOR_EXIT }, [ 'q' ] = { .flag = OPTION_QUIET }, [ 's' ] = { .flag = OPTION_SKIP }, [ 't' ] = { .flag = OPTION_STAR_TERMINATE }, [ 'u' ] = { .flag = OPTION_NO_TRUNCATE }, [ 'y' ] = { .flag = OPTION_ANY_TERMINATE }, [ 'x' ] = { .flag = OPTION_IGNORE_TERMINATE }, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const struct ast_datastore_info | recording_data_info |
Trivial application to record a sound file.
Definition in file app_record.c.
#define OPERATOR_KEY '0' |
Definition at line 150 of file app_record.c.
anonymous enum |
Enumerator | |
---|---|
OPTION_APPEND | |
OPTION_NOANSWER | |
OPTION_QUIET | |
OPTION_SKIP | |
OPTION_STAR_TERMINATE | |
OPTION_IGNORE_TERMINATE | |
OPTION_KEEP | |
OPTION_ANY_TERMINATE | |
OPTION_OPERATOR_EXIT | |
OPTION_NO_TRUNCATE |
Definition at line 154 of file app_record.c.
enum dtmf_response |
Enumerator | |
---|---|
RESPONSE_NO_MATCH | |
RESPONSE_OPERATOR | |
RESPONSE_DTMF |
Definition at line 167 of file app_record.c.
|
static |
Definition at line 660 of file app_record.c.
|
static |
Definition at line 660 of file app_record.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 660 of file app_record.c.
|
static |
Definition at line 214 of file app_record.c.
References ast_config_AST_DATA_DIR, ast_mkdir(), and PATH_MAX.
Referenced by record_exec().
|
static |
Definition at line 652 of file app_record.c.
References acf_recording_info, app, ast_custom_function_register, ast_register_application_xml, and record_exec().
|
static |
Definition at line 198 of file app_record.c.
References ast_test_flag, OPERATOR_KEY, OPTION_ANY_TERMINATE, OPTION_OPERATOR_EXIT, RESPONSE_DTMF, RESPONSE_NO_MATCH, and RESPONSE_OPERATOR.
Referenced by record_exec().
|
static |
Definition at line 298 of file app_record.c.
References ao2_bump, ao2_cleanup, app_opts, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_language(), ast_channel_lock, ast_channel_name(), ast_channel_readformat(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), ast_channel_unlock, ast_closestream(), AST_CONTROL_VIDUPDATE, ast_copy_string(), ast_datastore_alloc, ast_datastore_free(), ast_debug, AST_DECLARE_APP_ARGS, ast_dsp_free(), ast_dsp_get_threshold_from_settings(), ast_dsp_new(), ast_dsp_set_threshold(), ast_dsp_silence(), AST_FILE_MODE, ast_filedelete(), ast_fileexists(), ast_format_slin, AST_FRAME_DTMF, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_frfree, ast_indicate(), ast_log, ast_opt_transmit_silence, ast_read(), ast_remaining_ms(), ast_set_read_format(), AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdupa, ast_stream_rewind(), ast_streamfile(), ast_strlen_zero(), ast_test_flag, ast_truncstream(), ast_tvdiff_ms(), ast_tvnow(), ast_waitfor(), ast_waitstream(), ast_writefile(), ast_writestream(), create_destination_directory(), ast_datastore::data, recording_data::duration, ext, ast_flags::flags, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, OPTION_APPEND, OPTION_IGNORE_TERMINATE, OPTION_KEEP, OPTION_NO_TRUNCATE, OPTION_NOANSWER, OPTION_QUIET, OPTION_SKIP, OPTION_STAR_TERMINATE, options, out, PATH_MAX, pbx_builtin_setvar_helper(), RAII_VAR, record_dtmf_response(), recording_data_info, RESPONSE_DTMF, RESPONSE_NO_MATCH, RESPONSE_OPERATOR, ast_frame::subclass, THRESHOLD_SILENCE, and ast_dsp::totalsilence.
Referenced by load_module().
|
static |
Definition at line 252 of file app_record.c.
References ast_free.
|
static |
Definition at line 262 of file app_record.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_log, ast_strlen_zero(), buf, ast_datastore::data, recording_data::duration, len(), LOG_ERROR, NULL, and recording_data_info.
|
static |
Definition at line 644 of file app_record.c.
References acf_recording_info, app, ast_custom_function_unregister(), and ast_unregister_application().
|
static |
Definition at line 660 of file app_record.c.
|
static |
Definition at line 639 of file app_record.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 152 of file app_record.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 184 of file app_record.c.
Referenced by record_exec().
|
static |
Definition at line 660 of file app_record.c.
|
static |
Definition at line 257 of file app_record.c.
Referenced by record_exec(), and recording_info_read().