Asterisk - The Open Source Telephony Project  18.5.0
Macros | Enumerations | Functions | Variables
say.h File Reference

Say numbers and dates (maybe words one day too) More...

#include "asterisk/channel.h"
#include "asterisk/file.h"
#include <time.h>
Include dependency graph for say.h:
This graph shows which files directly or indirectly include this file:

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_strast_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_strast_get_digit_str (const char *str, const char *lang)
 Returns an ast_str of files for SayDigits playback. More...
 
struct ast_strast_get_money_str (const char *str, const char *lang)
 Returns an ast_str of files for SayMoney playback. More...
 
struct ast_strast_get_number_str (int num, const char *lang)
 Returns an ast_str of files for SayNumber playback. More...
 
struct ast_strast_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)
 

Detailed Description

Say numbers and dates (maybe words one day too)

Definition in file say.h.

Macro Definition Documentation

◆ SAY_EXTERN

#define SAY_EXTERN   extern

Definition at line 66 of file say.h.

◆ SAY_INIT

#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.

Todo:
XXX As the conversion from the old implementation of say.c to the new implementation will be completed, and the API suitably reworked by removing redundant functions and/or arguments, this mechanism may be reverted back to pure static functions, if needed.

Definition at line 65 of file say.h.

Enumeration Type Documentation

◆ ast_say_case_sensitivity

Controls how ast_say_character_str denotes the case of characters in a string.

Enumerator
AST_SAY_CASE_NONE 

Do not distinguish case on any letters

AST_SAY_CASE_LOWER 

Denote case only on lower case letters, upper case is assumed otherwise

AST_SAY_CASE_UPPER 

Denote case only on upper case letters, lower case is assumed otherwise

AST_SAY_CASE_ALL 

Denote case on all letters, upper and lower

Definition at line 162 of file say.h.

162  {
163  AST_SAY_CASE_NONE, /*!< Do not distinguish case on any letters */
164  AST_SAY_CASE_LOWER, /*!< Denote case only on lower case letters, upper case is assumed otherwise */
165  AST_SAY_CASE_UPPER, /*!< Denote case only on upper case letters, lower case is assumed otherwise */
166  AST_SAY_CASE_ALL, /*!< Denote case on all letters, upper and lower */
167 };

Function Documentation

◆ ast_get_character_str()

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.

Parameters
strText to be translated to the corresponding audio files.
langChannel language
sensitivityCase sensitivity

Computes the list of files to be played by SayAlpha.

Return values
ampersand-separatedstring 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().

63  {
64  const char *fn;
65  char fnbuf[10], asciibuf[20] = "letters/ascii";
66  char ltr;
67  int num = 0;
68  int res = 0;
69  int upper = 0;
70  int lower = 0;
71 
72  struct ast_str *filenames = ast_str_create(20);
73  ast_str_reset(filenames);
74 
75  while (str[num] && !res) {
76  fn = NULL;
77  switch (str[num]) {
78  case ('*'):
79  fn = "digits/star";
80  break;
81  case ('#'):
82  fn = "digits/pound";
83  break;
84  case ('!'):
85  fn = "letters/exclaimation-point";
86  break;
87  case ('@'):
88  fn = "letters/at";
89  break;
90  case ('$'):
91  fn = "letters/dollar";
92  break;
93  case ('-'):
94  fn = "letters/dash";
95  break;
96  case ('.'):
97  fn = "letters/dot";
98  break;
99  case ('='):
100  fn = "letters/equals";
101  break;
102  case ('+'):
103  fn = "letters/plus";
104  break;
105  case ('/'):
106  fn = "letters/slash";
107  break;
108  case (' '):
109  fn = "letters/space";
110  break;
111  case ('0'):
112  case ('1'):
113  case ('2'):
114  case ('3'):
115  case ('4'):
116  case ('5'):
117  case ('6'):
118  case ('7'):
119  case ('8'):
120  case ('9'):
121  strcpy(fnbuf, "digits/X");
122  fnbuf[7] = str[num];
123  fn = fnbuf;
124  break;
125  default:
126  ltr = str[num];
127  if ('A' <= ltr && ltr <= 'Z') {
128  ltr += 'a' - 'A'; /* file names are all lower-case */
129  switch (sensitivity) {
130  case AST_SAY_CASE_UPPER:
131  case AST_SAY_CASE_ALL:
132  upper = !upper;
133  case AST_SAY_CASE_LOWER:
134  case AST_SAY_CASE_NONE:
135  break;
136  }
137  } else if ('a' <= ltr && ltr <= 'z') {
138  switch (sensitivity) {
139  case AST_SAY_CASE_LOWER:
140  case AST_SAY_CASE_ALL:
141  lower = !lower;
142  case AST_SAY_CASE_UPPER:
143  case AST_SAY_CASE_NONE:
144  break;
145  }
146  }
147 
148  if (upper) {
149  strcpy(fnbuf, "uppercase");
150  } else if (lower) {
151  strcpy(fnbuf, "lowercase");
152  } else {
153  strcpy(fnbuf, "letters/X");
154  fnbuf[8] = ltr;
155  }
156  fn = fnbuf;
157  }
158  if ((fn && ast_fileexists(fn, NULL, lang) > 0) ||
159  (snprintf(asciibuf + 13, sizeof(asciibuf) - 13, "%d", str[num]) > 0 && ast_fileexists(asciibuf, NULL, lang) > 0 && (fn = asciibuf))) {
160  ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
161  }
162  if (upper || lower) {
163  continue;
164  }
165  num++;
166  }
167 
168  return filenames;
169 }
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
const char * str
Definition: app_jack.c:147
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
Definition: file.c:1086
#define ast_str_create(init_len)
Create a malloc&#39;ed dynamic length string.
Definition: strings.h:620

◆ ast_get_digit_str()

struct ast_str* ast_get_digit_str ( const char *  str,
const char *  lang 
)

Returns an ast_str of files for SayDigits playback.

Parameters
strText to be translated to the corresponding audio files.
langChannel language

Computes the list of files to be played by SayDigits.

Return values
ampersand-separatedstring 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().

295 {
296  const char *fn;
297  char fnbuf[256];
298  int num = 0;
299 
300  struct ast_str *filenames = ast_str_create(20);
301  ast_str_reset(filenames);
302 
303  while (str[num]) {
304  fn = NULL;
305  switch (str[num]) {
306  case ('*'):
307  fn = "digits/star";
308  break;
309  case ('#'):
310  fn = "digits/pound";
311  break;
312  case ('-'):
313  fn = "digits/minus";
314  break;
315  case '0':
316  case '1':
317  case '2':
318  case '3':
319  case '4':
320  case '5':
321  case '6':
322  case '7':
323  case '8':
324  case '9':
325  strcpy(fnbuf, "digits/X");
326  fnbuf[7] = str[num];
327  fn = fnbuf;
328  break;
329  }
330  if (fn && ast_fileexists(fn, NULL, lang) > 0) {
331  ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
332  }
333  num++;
334  }
335 
336  return filenames;
337 }
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
const char * str
Definition: app_jack.c:147
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
Definition: file.c:1086
#define ast_str_create(init_len)
Create a malloc&#39;ed dynamic length string.
Definition: strings.h:620

◆ ast_get_money_str()

struct ast_str* ast_get_money_str ( const char *  str,
const char *  lang 
)

Returns an ast_str of files for SayMoney playback.

Parameters
strText to be translated to the corresponding audio files.
langChannel language

Computes the list of files to be played by SayMoney.

Return values
ampersand-separatedstring 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().

420 {
421  if (!strncasecmp(lang, "en", 2)) { /* English syntax */
422  return ast_get_money_en_dollars_str(str, lang);
423  }
424 
425  ast_log(LOG_WARNING, "Language %s not currently supported, defaulting to US Dollars\n", lang);
426  /* Default to english */
427  return ast_get_money_en_dollars_str(str, lang);
428 }
#define LOG_WARNING
Definition: logger.h:274
const char * str
Definition: app_jack.c:147
#define ast_log
Definition: astobj2.c:42
static struct ast_str * ast_get_money_en_dollars_str(const char *str, const char *lang)
Definition: say.c:363

◆ ast_get_number_str()

struct ast_str* ast_get_number_str ( int  num,
const char *  lang 
)

Returns an ast_str of files for SayNumber playback.

Parameters
numInteger to be translated to the corresponding audio files.
langChannel language

Computes the list of files to be played by SayNumber.

Return values
ampersand-separatedstring 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().

526 {
527  if (!strncasecmp(lang, "en", 2)) { /* English syntax */
528  return get_number_str_en(num, lang);
529  }
530 
531  ast_log(LOG_WARNING, "Language %s not currently supported, defaulting to English\n", lang);
532  /* Default to english */
533  return get_number_str_en(num, lang);
534 }
#define LOG_WARNING
Definition: logger.h:274
#define ast_log
Definition: astobj2.c:42
static struct ast_str * get_number_str_en(int num, const char *lang)
Definition: say.c:454

◆ ast_get_phonetic_str()

struct ast_str* ast_get_phonetic_str ( const char *  str,
const char *  lang 
)

Returns an ast_str of files for SayPhonetic playback.

Parameters
strText to be translated to the corresponding audio files.
langChannel language

Computes the list of files to be played by SayPhonetic.

Return values
ampersand-separatedstring 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().

196 {
197  const char *fn;
198  char fnbuf[256];
199  char ltr;
200  int num = 0;
201 
202  struct ast_str *filenames = ast_str_create(20);
203  ast_str_reset(filenames);
204 
205  while (str[num]) {
206  fn = NULL;
207  switch (str[num]) {
208  case ('*'):
209  fn = "digits/star";
210  break;
211  case ('#'):
212  fn = "digits/pound";
213  break;
214  case ('!'):
215  fn = "letters/exclaimation-point";
216  break;
217  case ('@'):
218  fn = "letters/at";
219  break;
220  case ('$'):
221  fn = "letters/dollar";
222  break;
223  case ('-'):
224  fn = "letters/dash";
225  break;
226  case ('.'):
227  fn = "letters/dot";
228  break;
229  case ('='):
230  fn = "letters/equals";
231  break;
232  case ('+'):
233  fn = "letters/plus";
234  break;
235  case ('/'):
236  fn = "letters/slash";
237  break;
238  case (' '):
239  fn = "letters/space";
240  break;
241  case ('0'):
242  case ('1'):
243  case ('2'):
244  case ('3'):
245  case ('4'):
246  case ('5'):
247  case ('6'):
248  case ('7'):
249  case ('8'):
250  strcpy(fnbuf, "digits/X");
251  fnbuf[7] = str[num];
252  fn = fnbuf;
253  break;
254  default: /* '9' falls here... */
255  ltr = str[num];
256  if ('A' <= ltr && ltr <= 'Z') ltr += 'a' - 'A'; /* file names are all lower-case */
257  strcpy(fnbuf, "phonetic/X_p");
258  fnbuf[9] = ltr;
259  fn = fnbuf;
260  }
261  if (fn && ast_fileexists(fn, NULL, lang) > 0) {
262  ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
263  }
264  num++;
265  }
266 
267  return filenames;
268 }
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
const char * str
Definition: app_jack.c:147
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
Definition: file.c:1086
#define ast_str_create(init_len)
Create a malloc&#39;ed dynamic length string.
Definition: strings.h:620

◆ ast_say_character_str()

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().

8369 {
8370  return ast_say_character_str_full(chan, str, ints, lang, sensitivity, -1, -1);
8371 }
const char * str
Definition: app_jack.c:147
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: say.h:175

◆ ast_say_counted_adjective()

int ast_say_counted_adjective ( struct ast_channel chan,
int  num,
const char *  adjective,
const char *  gender 
)

◆ ast_say_counted_noun()

int ast_say_counted_noun ( struct ast_channel chan,
int  num,
const char *  noun 
)

◆ ast_say_digit_str()

int ast_say_digit_str ( struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang 
)

says digits of a string

Parameters
chanchannel to act upon
numstring to speak
intswhich dtmf to interrupt on
langlanguage to speak in

Vocally says the digits of a given string

Return values
0on succes
DTMFif interrupted
-1on 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().

8357 {
8358  return ast_say_digit_str_full(chan, str, ints, lang, -1, -1);
8359 }
const char * str
Definition: app_jack.c:147
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: say.h:143

◆ ast_say_digits()

int ast_say_digits ( struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang 
)

says digits

Parameters
chanchannel to act upon
numnumber to speak
intswhich dtmf to interrupt on
langlanguage to speak

Vocally says digits of a given number

Return values
0on success
DTMFif interrupted
-1on 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().

8351 {
8352  return ast_say_digits_full(chan, num, ints, lang, -1, -1);
8353 }
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: channel.c:8379

◆ ast_say_digits_full()

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().

8381 {
8382  char buf[256];
8383 
8384  snprintf(buf, sizeof(buf), "%d", num);
8385 
8386  return ast_say_digit_str_full(chan, buf, ints, lang, audiofd, ctrlfd);
8387 }
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
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: say.h:143

◆ ast_say_enumeration()

int ast_say_enumeration ( struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang,
const char *  options 
)

says an enumeration

Parameters
chanchannel to say them enumeration on
numnumber to say on the channel
intswhich dtmf to interrupt on
langlanguage to speak the enumeration
optionsset 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

Return values
0on success
DTMFdigit on interrupt
-1on 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().

8345 {
8346  return ast_say_enumeration_full(chan, num, ints, language, options, -1, -1);
8347 }
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: say.h:106
static char language[MAX_LANGUAGE]
Definition: chan_alsa.c:117
static struct test_options options

◆ ast_say_money_str()

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().

8363 {
8364  return ast_say_money_str_full(chan, str, ints, lang, -1, -1);
8365 }
const char * str
Definition: app_jack.c:147
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: say.h:151

◆ ast_say_number()

int ast_say_number ( struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang,
const char *  options 
)

says a number

Parameters
chanchannel to say them number on
numnumber to say on the channel
intswhich dtmf to interrupt on
langlanguage to speak the number
optionsset to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter

Vocally says a number on a given channel

Return values
0on success
DTMFdigit on interrupt
-1on 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().

8339 {
8340  return ast_say_number_full(chan, num, ints, language, options, -1, -1);
8341 }
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: say.h:86
static char language[MAX_LANGUAGE]
Definition: chan_alsa.c:117
static struct test_options options

◆ ast_say_phonetic_str()

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().

8375 {
8376  return ast_say_phonetic_str_full(chan, str, ints, lang, -1, -1);
8377 }
const char * str
Definition: app_jack.c:147
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: say.h:180

Variable Documentation

◆ ast_say_character_str_full

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)

◆ ast_say_date

SAY_EXTERN int(* ast_say_date) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_date)

◆ ast_say_date_with_format

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)

◆ ast_say_datetime

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().

◆ ast_say_datetime_from_now

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().

◆ ast_say_digit_str_full

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().

◆ ast_say_enumeration_full

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().

◆ ast_say_full

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

Definition at line 157 of file say.h.

◆ ast_say_money_str_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().

◆ ast_say_number_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.

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().

◆ ast_say_phonetic_str_full

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)

◆ ast_say_time

SAY_EXTERN int(* ast_say_time) (struct ast_channel *chan, time_t t, const char *ints, const char *lang) SAY_INIT(ast_say_time)