117 if (!strcmp(type,
"alpha")) {
119 }
else if (!strcmp(type,
"phonetic")) {
121 }
else if (!strcmp(type,
"digits")) {
123 }
else if (!strcmp(type,
"number")) {
125 if (sscanf(value,
"%d", &num) == 1)
129 }
else if (!strcmp(type,
"money")) {
140 snprintf(buf, len,
"%s", files);
151 #ifdef TEST_FRAMEWORK 159 info->name =
"test_SAYFILES_function";
160 info->category =
"/funcs/sayfiles/";
161 info->summary =
"Test SAYFILES function substitution";
163 "Executes a series of variable substitutions using the SAYFILES function and ensures that the expected results are received.";
179 ast_str_set(&expr, 0,
"${SAYFILES(hi Th3re,alpha)}");
181 if (strcmp(
ast_str_buffer(result),
"letters/h&letters/i&letters/space&letters/t&letters/h&digits/3&letters/r&letters/e") != 0) {
187 ast_str_set(&expr, 0,
"${SAYFILES(phreak,phonetic)}");
189 if (strcmp(
ast_str_buffer(result),
"phonetic/p_p&phonetic/h_p&phonetic/r_p&phonetic/e_p&phonetic/a_p&phonetic/k_p") != 0) {
213 if (strcmp(
ast_str_buffer(result),
"digits/1&digits/thousand&digits/40&digits/2") != 0) {
245 if (strcmp(
ast_str_buffer(result),
"digits/40&digits/2¢s") != 0) {
253 if (strcmp(
ast_str_buffer(result),
"digits/1&letters/dollar") != 0) {
261 if (strcmp(
ast_str_buffer(result),
"digits/1&letters/dollar_&and&digits/40&digits/2¢s") != 0) {
277 if (strcmp(
ast_str_buffer(result),
"digits/2&dollars&and&digits/40&digits/2¢s") != 0) {
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_custom_function sayfiles
static int unload_module(void)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
struct ast_str * ast_get_number_str(int num, const char *lang)
Returns an ast_str of files for SayNumber playback.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
#define AST_TEST_REGISTER(cb)
struct ast_str * ast_get_phonetic_str(const char *str, const char *lang)
Returns an ast_str of files for SayPhonetic playback.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
struct ast_str * ast_get_money_str(const char *str, const char *lang)
Returns an ast_str of files for SayMoney playback.
AST_TEST_DEFINE(test_SAYFILES_function)
#define ast_strlen_zero(foo)
Custom localtime functions for multiple timezones.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
General Asterisk PBX channel definitions.
struct ast_str * ast_get_digit_str(const char *str, const char *lang)
Returns an ast_str of files for SayDigits playback.
#define ast_test_status_update(a, b, c...)
Data structure associated with a custom dialplan function.
static int sayfile_exec(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Core PBX routines and definitions.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
#define AST_TEST_UNREGISTER(cb)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct ast_str * ast_get_character_str(const char *str, const char *lang, enum ast_say_case_sensitivity sensitivity)
Returns an ast_str of files for SayAlpha playback.
const char * ast_channel_language(const struct ast_channel *chan)
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
#define AST_APP_ARG(name)
Define an application argument.
static int load_module(void)