Asterisk - The Open Source Telephony Project GIT-master-8f1982c
|
Trivial application to playback 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/say.h"
#include "asterisk/cli.h"
Go to the source code of this file.
Data Structures | |
struct | say_args_t |
Typical 'say' arguments in addition to the date or number or string to say. We do not include 'options' because they may be different in recursive calls, and so they are better left as an external parameter. More... | |
Functions | |
static void | __reg_module (void) |
static char * | __say_cli_init (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | do_say (say_args_t *a, const char *s, const char *options, int depth) |
the string is 'prefix:data' or prefix:fmt:data' with ':' being invalid in strings. More... | |
static int | load_module (void) |
static int | playback_exec (struct ast_channel *chan, const char *data) |
static int | reload (void) |
static void | restore_say_mode (void *arg) |
static int | s_streamwait3 (const say_args_t *a, const char *fn) |
static void | save_say_mode (const void *arg) |
static int | say_date (struct ast_channel *chan, time_t t, const char *ints, const char *lang) |
static int | say_date_generic (struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezonename, const char *prefix) |
static int | say_date_with_format (struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezonename) |
static int | say_datetime (struct ast_channel *chan, time_t t, const char *ints, const char *lang) |
static int | say_enumeration_full (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) |
static int | say_full (struct ast_channel *chan, const char *string, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) |
static int | say_init_mode (const char *mode) |
remap the 'say' functions to use those in this file More... | |
static int | say_number_full (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) |
static int | say_time (struct ast_channel *chan, time_t t, const char *ints, const char *lang) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Sound File Playback 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, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, } |
static char * | app = "Playback" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_playback [] |
static const void * | say_api_buf [40] |
save the say' api calls. The first entry is NULL if we have the standard source, otherwise we are sourcing from here. 'say load [new|old]' will enable the new or old method, or report status More... | |
static struct ast_config * | say_cfg = NULL |
static const char *const | say_new = "new" |
static const char *const | say_old = "old" |
Trivial application to playback a sound file.
Definition in file app_playback.c.
|
static |
Definition at line 607 of file app_playback.c.
|
static |
Definition at line 420 of file app_playback.c.
References a, ast_cli_entry::args, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, say_api_buf, say_init_mode(), say_new, say_old, and ast_cli_entry::usage.
|
static |
Definition at line 607 of file app_playback.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 607 of file app_playback.c.
|
static |
the string is 'prefix:data' or prefix:fmt:data' with ':' being invalid in strings.
Definition at line 189 of file app_playback.c.
References a, ast_debug, ast_extension_match(), ast_free, AST_LIST_INSERT_HEAD, ast_log, ast_skip_blanks(), ast_strdup, ast_strdupa, ast_trim_blanks(), ast_var_assign, ast_var_delete(), ast_variable_browse(), do_say(), ast_var_t::entries, varshead::first, LOG_ERROR, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, options, pbx_substitute_variables_varshead(), s_streamwait3(), say_cfg, strsep(), and ast_variable::value.
Referenced by do_say(), say_date_generic(), say_enumeration_full(), say_full(), and say_number_full().
|
static |
Definition at line 583 of file app_playback.c.
References app, ARRAY_LEN, ast_cli_register_multiple, ast_config_load, ast_extension_match(), ast_register_application_xml, ast_variable_browse(), cli_playback, CONFIG_STATUS_FILEINVALID, ast_variable::name, ast_variable::next, playback_exec(), say_cfg, say_init_mode(), and ast_variable::value.
|
static |
Definition at line 458 of file app_playback.c.
References args, ast_answer(), AST_APP_ARG, ast_channel_language(), ast_channel_name(), ast_check_hangup(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdupa, ast_streamfile(), ast_strlen_zero(), ast_strsep(), AST_STRSEP_STRIP, AST_STRSEP_TRIM, ast_waitstream(), done, LOG_WARNING, NULL, options, pbx_builtin_setvar_helper(), say_full(), and strcasestr().
Referenced by load_module().
|
static |
Definition at line 534 of file app_playback.c.
References ast_config_destroy(), ast_config_load, ast_extension_match(), ast_log, ast_variable_browse(), CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, LOG_ERROR, LOG_NOTICE, ast_variable::name, ast_variable::next, say_cfg, say_init_mode(), and ast_variable::value.
|
static |
Definition at line 140 of file app_playback.c.
References ast_say_character_str_full, ast_say_date, ast_say_date_with_format, ast_say_datetime, ast_say_datetime_from_now, ast_say_digit_str_full, ast_say_enumeration_full, ast_say_number_full, ast_say_phonetic_str_full, ast_say_time, and say_api_buf.
Referenced by say_init_mode().
|
static |
Definition at line 171 of file app_playback.c.
References a, ast_log, ast_stopstream(), ast_streamfile(), ast_waitstream(), ast_waitstream_full(), and LOG_WARNING.
Referenced by do_say().
|
static |
Definition at line 123 of file app_playback.c.
References ast_say_character_str_full, ast_say_date, ast_say_date_with_format, ast_say_datetime, ast_say_datetime_from_now, ast_say_digit_str_full, ast_say_enumeration_full, ast_say_number_full, ast_say_phonetic_str_full, ast_say_time, and say_api_buf.
Referenced by say_init_mode().
|
static |
Definition at line 367 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 336 of file app_playback.c.
References a, ast_localtime(), buf, do_say(), NULL, prefix, ast_tm::tm_hour, ast_tm::tm_mday, ast_tm::tm_min, ast_tm::tm_mon, ast_tm::tm_sec, ast_tm::tm_wday, ast_tm::tm_yday, and ast_tm::tm_year.
Referenced by say_date(), say_date_with_format(), say_datetime(), and say_time().
|
static |
Definition at line 361 of file app_playback.c.
References say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 377 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
|
static |
Definition at line 308 of file app_playback.c.
References a, do_say(), and options.
Referenced by playback_exec().
|
static |
remap the 'say' functions to use those in this file
Definition at line 385 of file app_playback.c.
References ast_log, ast_say_character_str_full, ast_say_date, ast_say_date_with_format, ast_say_datetime, ast_say_datetime_from_now, ast_say_digit_str_full, ast_say_digits_full(), ast_say_enumeration_full, ast_say_number_full, ast_say_phonetic_str_full, ast_say_time, LOG_ERROR, LOG_WARNING, NULL, restore_say_mode(), save_say_mode(), say_api_buf, say_cfg, say_character_str_full(), say_date(), say_date_with_format(), say_datetime(), say_datetime_from_now(), say_digit_str_full(), say_enumeration_full(), say_new, say_number_full(), say_old, say_phonetic_str_full(), and say_time().
Referenced by __say_cli_init(), load_module(), and reload().
|
static |
|
static |
Definition at line 372 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 569 of file app_playback.c.
References app, ARRAY_LEN, ast_cli_unregister_multiple(), ast_config_destroy(), ast_unregister_application(), cli_playback, and say_cfg.
|
static |
Definition at line 607 of file app_playback.c.
|
static |
< provides config-file based 'say' functions
Definition at line 110 of file app_playback.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 607 of file app_playback.c.
|
static |
Definition at line 454 of file app_playback.c.
Referenced by load_module(), and unload_module().
|
static |
save the say' api calls. The first entry is NULL if we have the standard source, otherwise we are sourcing from here. 'say load [new|old]' will enable the new or old method, or report status
Definition at line 119 of file app_playback.c.
Referenced by __say_cli_init(), restore_say_mode(), save_say_mode(), and say_init_mode().
|
static |
Definition at line 112 of file app_playback.c.
Referenced by do_say(), load_module(), reload(), say_init_mode(), and unload_module().
|
static |
Definition at line 121 of file app_playback.c.
Referenced by __say_cli_init(), and say_init_mode().
|
static |
Definition at line 120 of file app_playback.c.
Referenced by __say_cli_init(), and say_init_mode().