2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
20 * \brief Say numbers and dates (maybe words one day too)
23 #ifndef _ASTERISK_SAY_H
24 #define _ASTERISK_SAY_H
26 #include "asterisk/channel.h"
27 #include "asterisk/file.h"
31 #if defined(__cplusplus) || defined(c_plusplus)
36 * \param chan channel to say them number on
37 * \param num number to say on the channel
38 * \param ints which dtmf to interrupt on
39 * \param lang language to speak the number
40 * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural
41 * Vocally says a number on a given channel
42 * Returns 0 on success, DTMF digit on interrupt, -1 on failure
44 int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options);
46 /* Same as above with audiofd for received audio and returns 1 on ctrlfd being readable */
47 int ast_say_number_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd);
49 /* says an enumeration
50 * \param chan channel to say them enumeration on
51 * \param num number to say on the channel
52 * \param ints which dtmf to interrupt on
53 * \param lang language to speak the enumeration
54 * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural
55 * Vocally says a enumeration on a given channel (first, sencond, third, forth, thirtyfirst, hundredth, ....)
56 * especially useful for dates and messages. says 'last' if num equals to INT_MAX
57 * Returns 0 on success, DTMF digit on interrupt, -1 on failure
59 int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options);
60 int ast_say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd);
63 * \param chan channel to act upon
64 * \param num number to speak
65 * \param ints which dtmf to interrupt on
66 * \param lang language to speak
67 * Vocally says digits of a given number
68 * Returns 0 on success, dtmf if interrupted, -1 on failure
70 int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang);
71 int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd);
73 /* says digits of a string
74 * \param chan channel to act upon
75 * \param num string to speak
76 * \param ints which dtmf to interrupt on
77 * \param lang language to speak in
78 * Vocally says the digits of a given string
79 * Returns 0 on success, dtmf if interrupted, -1 on failure
81 int ast_say_digit_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
82 int ast_say_digit_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
83 int ast_say_character_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
84 int ast_say_character_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
85 int ast_say_phonetic_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
86 int ast_say_phonetic_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
88 int ast_say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
90 int ast_say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
92 int ast_say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
94 int ast_say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
96 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);
98 #if defined(__cplusplus) || defined(c_plusplus)
102 #endif /* _ASTERISK_SAY_H */