Asterisk - The Open Source Telephony Project
18.5.0
|
Say numbers and dates (maybe words one day too) More...
Go to the source code of this file.
Macros | |
#define | SAY_EXTERN extern |
#define | SAY_INIT(x) |
The basic ast_say_* functions are implemented as function pointers, initialized to the function say_stub() which simply returns an error. Other interfaces, declared here as regular functions, are simply wrappers around the basic functions. More... | |
Enumerations | |
enum | ast_say_case_sensitivity { AST_SAY_CASE_NONE, AST_SAY_CASE_LOWER, AST_SAY_CASE_UPPER, AST_SAY_CASE_ALL } |
Controls how ast_say_character_str denotes the case of characters in a string. More... | |
Functions | |
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. More... | |
struct ast_str * | ast_get_digit_str (const char *str, const char *lang) |
Returns an ast_str of files for SayDigits playback. More... | |
struct ast_str * | ast_get_money_str (const char *str, const char *lang) |
Returns an ast_str of files for SayMoney playback. More... | |
struct ast_str * | ast_get_number_str (int num, const char *lang) |
Returns an ast_str of files for SayNumber playback. More... | |
struct ast_str * | ast_get_phonetic_str (const char *str, const char *lang) |
Returns an ast_str of files for SayPhonetic playback. More... | |
int | ast_say_character_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity) |
function to pronounce character and phonetic strings More... | |
int | ast_say_counted_adjective (struct ast_channel *chan, int num, const char *adjective, const char *gender) |
int | ast_say_counted_noun (struct ast_channel *chan, int num, const char *noun) |
int | ast_say_digit_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang) |
says digits of a string More... | |
int | ast_say_digits (struct ast_channel *chan, int num, const char *ints, const char *lang) |
says digits More... | |
int | ast_say_digits_full (struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd) |
Same as ast_say_digits() with audiofd for received audio and returns 1 on ctrlfd being readable. More... | |
int | ast_say_enumeration (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options) |
says an enumeration More... | |
int | ast_say_money_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang) |
function to pronounce monetary amounts More... | |
int | ast_say_number (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options) |
says a number More... | |
int | ast_say_phonetic_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang) |
Variables | |
SAY_EXTERN int(* | ast_say_character_str_full )(struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full) |
SAY_EXTERN int(* | ast_say_date )(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date) |
SAY_EXTERN int(* | ast_say_date_with_format )(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezone) SAY_INIT(ast_say_date_with_format) |
SAY_EXTERN int(* | ast_say_datetime )(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime) |
SAY_EXTERN int(* | ast_say_datetime_from_now )(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime_from_now) |
SAY_EXTERN int(* | ast_say_digit_str_full )(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_digit_str_full) |
Same as ast_say_digit_str() with audiofd for received audio and returns 1 on ctrlfd being readable. More... | |
SAY_EXTERN int(* | ast_say_enumeration_full )(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_enumeration_full) |
Same as ast_say_enumeration() with audiofd for received audio and returns 1 on ctrlfd being readable. More... | |
SAY_EXTERN int(* | ast_say_full )(struct ast_channel *chan, const char *num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_full) |
the generic 'say' routine, with the first chars in the string defining the format to use More... | |
SAY_EXTERN int(* | ast_say_money_str_full )(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_money_str_full) |
SAY_EXTERN int(* | ast_say_number_full )(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_number_full) |
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable. More... | |
SAY_EXTERN int(* | ast_say_phonetic_str_full )(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full) |
SAY_EXTERN int(* | ast_say_time )(struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time) |
Say numbers and dates (maybe words one day too)
Definition in file say.h.
#define SAY_INIT | ( | x | ) |
The basic ast_say_* functions are implemented as function pointers, initialized to the function say_stub() which simply returns an error. Other interfaces, declared here as regular functions, are simply wrappers around the basic functions.
An implementation of the basic ast_say functions (e.g. from say.c or from a dynamically loaded module) will just have to reassign the pointers to the relevant functions to override the previous implementation.
Controls how ast_say_character_str denotes the case of characters in a string.
Definition at line 162 of file say.h.
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.
str | Text to be translated to the corresponding audio files. |
lang | Channel language |
sensitivity | Case sensitivity |
Computes the list of files to be played by SayAlpha.
ampersand-separated | string of Asterisk sound files that can be played back. |
Definition at line 63 of file say.c.
References ast_fileexists(), AST_SAY_CASE_ALL, AST_SAY_CASE_LOWER, AST_SAY_CASE_NONE, AST_SAY_CASE_UPPER, ast_str_append(), ast_str_create, ast_str_reset(), and NULL.
Referenced by say_character_str_full(), and sayfile_exec().
struct ast_str* ast_get_digit_str | ( | const char * | str, |
const char * | lang | ||
) |
Returns an ast_str of files for SayDigits playback.
str | Text to be translated to the corresponding audio files. |
lang | Channel language |
Computes the list of files to be played by SayDigits.
ampersand-separated | string of Asterisk sound files that can be played back. |
Definition at line 294 of file say.c.
References ast_fileexists(), ast_str_append(), ast_str_create, ast_str_reset(), and NULL.
Referenced by ast_get_money_en_dollars_str(), get_number_str_en(), say_digit_str_full(), and sayfile_exec().
struct ast_str* ast_get_money_str | ( | const char * | str, |
const char * | lang | ||
) |
Returns an ast_str of files for SayMoney playback.
str | Text to be translated to the corresponding audio files. |
lang | Channel language |
Computes the list of files to be played by SayMoney.
ampersand-separated | string of Asterisk sound files that can be played back. |
Returns an ast_str of files for SayMoney playback.
Definition at line 419 of file say.c.
References ast_get_money_en_dollars_str(), ast_log, and LOG_WARNING.
Referenced by say_money_str_full(), and sayfile_exec().
struct ast_str* ast_get_number_str | ( | int | num, |
const char * | lang | ||
) |
Returns an ast_str of files for SayNumber playback.
num | Integer to be translated to the corresponding audio files. |
lang | Channel language |
Computes the list of files to be played by SayNumber.
ampersand-separated | string of Asterisk sound files that can be played back. |
Returns an ast_str of files for SayNumber playback.
Definition at line 525 of file say.c.
References ast_log, ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_he(), ast_say_date_hu(), ast_say_date_is(), ast_say_date_ja(), ast_say_date_ka(), ast_say_date_nl(), ast_say_date_pt(), ast_say_date_th(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_gr(), ast_say_date_with_format_he(), ast_say_date_with_format_is(), ast_say_date_with_format_it(), ast_say_date_with_format_ja(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_pt(), ast_say_date_with_format_th(), ast_say_date_with_format_vi(), ast_say_date_with_format_zh(), ast_say_datetime_de(), ast_say_datetime_en(), ast_say_datetime_fr(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_he(), ast_say_datetime_from_now_ka(), ast_say_datetime_from_now_pt(), ast_say_datetime_gr(), ast_say_datetime_he(), ast_say_datetime_hu(), ast_say_datetime_ja(), ast_say_datetime_ka(), ast_say_datetime_nl(), ast_say_datetime_pt(), ast_say_datetime_pt_BR(), ast_say_datetime_th(), ast_say_datetime_zh(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_he(), ast_say_enumeration_full_is(), ast_say_enumeration_full_vi(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_he(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ja(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_pl(), ast_say_number_full_pt(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_ur(), ast_say_number_full_vi(), ast_say_number_full_zh(), ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_he(), ast_say_time_hu(), ast_say_time_ja(), ast_say_time_ka(), ast_say_time_nl(), ast_say_time_pt(), ast_say_time_pt_BR(), ast_say_time_th(), ast_say_time_zh(), format, get_number_str_en(), language, LOG_WARNING, and options.
Referenced by ast_get_money_en_dollars_str(), ast_say_number_full_en(), get_number_str_en(), and sayfile_exec().
struct ast_str* ast_get_phonetic_str | ( | const char * | str, |
const char * | lang | ||
) |
Returns an ast_str of files for SayPhonetic playback.
str | Text to be translated to the corresponding audio files. |
lang | Channel language |
Computes the list of files to be played by SayPhonetic.
ampersand-separated | string of Asterisk sound files that can be played back. |
Definition at line 195 of file say.c.
References ast_fileexists(), ast_str_append(), ast_str_create, ast_str_reset(), and NULL.
Referenced by say_phonetic_str_full(), and sayfile_exec().
int ast_say_character_str | ( | struct ast_channel * | chan, |
const char * | num, | ||
const char * | ints, | ||
const char * | lang, | ||
enum ast_say_case_sensitivity | sensitivity | ||
) |
function to pronounce character and phonetic strings
Definition at line 8367 of file channel.c.
References ast_say_character_str_full.
Referenced by common_exec(), pbx_builtin_saycharacters(), pbx_builtin_saycharacters_case(), play_mailbox_owner(), play_on_channel(), and vmsayname_exec().
int ast_say_counted_adjective | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | adjective, | ||
const char * | gender | ||
) |
Referenced by saycountedadj_exec(), and vm_intro_multilang().
int ast_say_counted_noun | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | noun | ||
) |
Referenced by saycountednoun_exec(), and vm_intro_multilang().
int ast_say_digit_str | ( | struct ast_channel * | chan, |
const char * | num, | ||
const char * | ints, | ||
const char * | lang | ||
) |
says digits of a string
chan | channel to act upon |
num | string to speak |
ints | which dtmf to interrupt on |
lang | language to speak in |
Vocally says the digits of a given string
0 | on succes |
DTMF | if interrupted |
-1 | on failure |
Definition at line 8355 of file channel.c.
References ast_say_digit_str_full.
Referenced by __analog_ss_thread(), forward_message(), invent_message(), mgcp_ss(), pbx_builtin_saydigits(), play_message_callerid(), and play_on_channel().
int ast_say_digits | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | ints, | ||
const char * | lang | ||
) |
says digits
chan | channel to act upon |
num | number to speak |
ints | which dtmf to interrupt on |
lang | language to speak |
Vocally says digits of a given number
0 | on success |
DTMF | if interrupted |
-1 | on failure |
Definition at line 8349 of file channel.c.
References ast_say_digits_full().
Referenced by announce_to_dial(), common_exec(), conf_exec(), conf_run(), and say_parking_space().
int ast_say_digits_full | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | ints, | ||
const char * | lang, | ||
int | audiofd, | ||
int | ctrlfd | ||
) |
Same as ast_say_digits() with audiofd for received audio and returns 1 on ctrlfd being readable.
Definition at line 8379 of file channel.c.
References ast_say_digit_str_full, and buf.
Referenced by ast_say_digits(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_is(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_he(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ja(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_pt(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_ur(), ast_say_number_full_vi(), ast_say_number_full_zh(), and say_init_mode().
int ast_say_enumeration | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | ints, | ||
const char * | lang, | ||
const char * | options | ||
) |
says an enumeration
chan | channel to say them enumeration on |
num | number to say on the channel |
ints | which dtmf to interrupt on |
lang | language to speak the enumeration |
options | set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter |
Vocally says an enumeration on a given channel (first, sencond, third, forth, thirtyfirst, hundredth, ....) Especially useful for dates and messages. Says 'last' if num equals to INT_MAX
0 | on success |
DTMF | digit on interrupt |
-1 | on failure |
Definition at line 8343 of file channel.c.
References ast_say_enumeration_full.
Referenced by ast_say_date_da(), ast_say_date_de(), ast_say_date_is(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_is(), ast_say_date_with_format_pl(), and ast_say_date_with_format_vi().
int ast_say_money_str | ( | struct ast_channel * | chan, |
const char * | num, | ||
const char * | ints, | ||
const char * | lang | ||
) |
function to pronounce monetary amounts
Definition at line 8361 of file channel.c.
References ast_say_money_str_full.
Referenced by pbx_builtin_saymoney().
int ast_say_number | ( | struct ast_channel * | chan, |
int | num, | ||
const char * | ints, | ||
const char * | lang, | ||
const char * | options | ||
) |
says a number
chan | channel to say them number on |
num | number to say on the channel |
ints | which dtmf to interrupt on |
lang | language to speak the number |
options | set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter |
Vocally says a number on a given channel
0 | on success |
DTMF | digit on interrupt |
-1 | on failure |
Definition at line 8337 of file channel.c.
References ast_say_number_full.
Referenced by announce_user_count(), app_exec(), ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_he(), ast_say_date_hu(), ast_say_date_is(), ast_say_date_ja(), ast_say_date_ka(), ast_say_date_nl(), ast_say_date_pt(), ast_say_date_th(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_is(), ast_say_date_with_format_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_pt(), ast_say_date_with_format_th(), ast_say_date_with_format_vi(), ast_say_datetime_en(), ast_say_datetime_fr(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_he(), ast_say_datetime_from_now_ka(), ast_say_datetime_from_now_pt(), ast_say_datetime_he(), ast_say_datetime_ja(), ast_say_datetime_pt(), ast_say_datetime_th(), ast_say_datetime_zh(), ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_hu(), ast_say_time_ja(), ast_say_time_ka(), ast_say_time_nl(), ast_say_time_pt(), ast_say_time_pt_BR(), ast_say_time_th(), ast_say_time_zh(), conf_run(), count_exec(), dictate_exec(), get_folder(), get_folder_ja(), gr_say_number_female(), limits_interval_playback(), meetme_menu_admin_extended(), pbx_builtin_saynumber(), play_message(), play_message_duration(), play_on_channel(), playback_common(), say_and_wait(), say_position(), try_calling(), vm_intro_gr(), vm_intro_he(), vm_intro_multilang(), vm_intro_pt(), and vm_intro_pt_BR().
int ast_say_phonetic_str | ( | struct ast_channel * | chan, |
const char * | num, | ||
const char * | ints, | ||
const char * | lang | ||
) |
Definition at line 8373 of file channel.c.
References ast_say_phonetic_str_full.
Referenced by pbx_builtin_sayphonetic().
SAY_EXTERN int(* ast_say_character_str_full) (struct ast_channel *chan, const char *num, const char *ints, const char *lang, enum ast_say_case_sensitivity sensitivity, int audiofd, int ctrlfd) SAY_INIT(ast_say_character_str_full) |
Definition at line 175 of file say.h.
Referenced by __say_init(), ast_say_character_str(), handle_sayalpha(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_date) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date) |
Definition at line 185 of file say.h.
Referenced by __say_init(), ast_say_datetime_de(), ast_say_datetime_hu(), ast_say_datetime_ka(), ast_say_datetime_nl(), ast_say_datetime_pt_BR(), handle_saydate(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_date_with_format) (struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezone) SAY_INIT(ast_say_date_with_format) |
Definition at line 189 of file say.h.
Referenced by __say_init(), ast_say_date_with_format_ja(), ast_say_date_with_format_pl(), handle_saydatetime(), play_message_datetime(), restore_say_mode(), save_say_mode(), say_init_mode(), and sayunixtime_exec().
SAY_EXTERN int(* ast_say_datetime) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime) |
Definition at line 182 of file say.h.
Referenced by __say_init(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_datetime_from_now) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_datetime_from_now) |
Definition at line 187 of file say.h.
Referenced by __say_init(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_digit_str_full) (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_digit_str_full) |
Same as ast_say_digit_str() with audiofd for received audio and returns 1 on ctrlfd being readable.
Definition at line 143 of file say.h.
Referenced by __say_init(), ast_say_digit_str(), ast_say_digits_full(), handle_saydigits(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_enumeration_full) (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_enumeration_full) |
Same as ast_say_enumeration() with audiofd for received audio and returns 1 on ctrlfd being readable.
Definition at line 106 of file say.h.
Referenced by __say_init(), ast_say_enumeration(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_full) (struct ast_channel *chan, const char *num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_full) |
SAY_EXTERN int(* ast_say_money_str_full) (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_money_str_full) |
Definition at line 151 of file say.h.
Referenced by __say_init(), and ast_say_money_str().
SAY_EXTERN int(* ast_say_number_full) (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd) SAY_INIT(ast_say_number_full) |
Same as ast_say_number() with audiofd for received audio and returns 1 on ctrlfd being readable.
Definition at line 86 of file say.h.
Referenced by __say_init(), ast_say_number(), handle_saynumber(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_phonetic_str_full) (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd) SAY_INIT(ast_say_phonetic_str_full) |
Definition at line 180 of file say.h.
Referenced by __say_init(), ast_say_phonetic_str(), handle_sayphonetic(), restore_say_mode(), save_say_mode(), and say_init_mode().
SAY_EXTERN int(* ast_say_time) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time) |
Definition at line 183 of file say.h.
Referenced by __say_init(), ast_say_datetime_de(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_he(), ast_say_datetime_from_now_ka(), ast_say_datetime_from_now_pt(), ast_say_datetime_hu(), ast_say_datetime_ka(), ast_say_datetime_nl(), ast_say_datetime_pt_BR(), handle_saytime(), restore_say_mode(), save_say_mode(), and say_init_mode().