Asterisk - The Open Source Telephony Project
18.5.0
|
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 582 of file app_playback.c.
|
static |
Definition at line 404 of file app_playback.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, say_api_buf, say_init_mode(), say_new, say_old, and ast_cli_entry::usage.
|
static |
Definition at line 582 of file app_playback.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 582 of file app_playback.c.
|
static |
the string is 'prefix:data' or prefix:fmt:data' with ':' being invalid in strings.
Definition at line 173 of file app_playback.c.
References 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(), ast_var_t::entries, varshead::first, say_args_t::language, LOG_ERROR, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, pbx_substitute_variables_varshead(), s_streamwait3(), strsep(), and ast_variable::value.
Referenced by say_date_generic(), say_enumeration_full(), say_full(), and say_number_full().
|
static |
Definition at line 558 of file app_playback.c.
References app, ARRAY_LEN, ast_cli_register_multiple, ast_config_load, ast_extension_match(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_register_application_xml, ast_variable_browse(), ASTERISK_GPL_KEY, CONFIG_STATUS_FILEINVALID, ast_variable::name, ast_variable::next, playback_exec(), reload(), say_init_mode(), unload_module(), and ast_variable::value.
|
static |
Definition at line 442 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_waitstream(), done, LOG_WARNING, NULL, options, pbx_builtin_setvar_helper(), say_full(), strcasestr(), strsep(), and tmp().
Referenced by load_module().
|
static |
Definition at line 509 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_init_mode(), and ast_variable::value.
Referenced by load_module().
|
static |
Definition at line 124 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 155 of file app_playback.c.
References ast_log, ast_stopstream(), ast_streamfile(), ast_waitstream(), ast_waitstream_full(), say_args_t::audiofd, say_args_t::chan, say_args_t::ctrlfd, say_args_t::ints, say_args_t::language, and LOG_WARNING.
Referenced by do_say().
|
static |
Definition at line 107 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 351 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 320 of file app_playback.c.
References a, ast_localtime(), buf, do_say(), NULL, 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 345 of file app_playback.c.
References say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 361 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 310 of file app_playback.c.
References a, buf, and do_say().
Referenced by say_init_mode().
|
static |
Definition at line 292 of file app_playback.c.
Referenced by playback_exec().
|
static |
remap the 'say' functions to use those in this file
Definition at line 369 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_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 |
Definition at line 300 of file app_playback.c.
References a, buf, and do_say().
Referenced by say_init_mode().
|
static |
Definition at line 356 of file app_playback.c.
References NULL, and say_date_generic().
Referenced by say_init_mode().
|
static |
Definition at line 544 of file app_playback.c.
References app, ARRAY_LEN, ast_cli_unregister_multiple(), ast_config_destroy(), and ast_unregister_application().
Referenced by load_module().
|
static |
Definition at line 582 of file app_playback.c.
|
static |
< provides config-file based 'say' functions
Definition at line 94 of file app_playback.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 582 of file app_playback.c.
|
static |
Definition at line 438 of file app_playback.c.
|
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 103 of file app_playback.c.
Referenced by __say_cli_init(), restore_say_mode(), save_say_mode(), and say_init_mode().
|
static |
Definition at line 96 of file app_playback.c.
|
static |
Definition at line 105 of file app_playback.c.
Referenced by __say_cli_init(), and say_init_mode().
|
static |
Definition at line 104 of file app_playback.c.
Referenced by __say_cli_init(), and say_init_mode().