Fri May 26 01:50:24 2006

Asterisk developer's documentation


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.

Functions

int ast_say_character_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang)
int ast_say_character_str_full (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd)
int ast_say_date (struct ast_channel *chan, time_t t, const char *ints, const char *lang)
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)
int ast_say_datetime (struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_say_datetime_from_now (struct ast_channel *chan, time_t t, const char *ints, const char *lang)
int ast_say_digit_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang)
int ast_say_digit_str_full (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd)
int ast_say_digits (struct ast_channel *chan, int num, const char *ints, const char *lang)
int ast_say_digits_full (struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd)
int ast_say_enumeration (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
 ast_say_enumeration: call language-specific functions without file descriptors
int ast_say_enumeration_full (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd)
 ast_say_enumeration_full: call language-specific functions
int ast_say_number (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
 ast_say_number: call language-specific functions without file descriptors
int ast_say_number_full (struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd)
 ast_say_number_full: call language-specific functions
int ast_say_phonetic_str (struct ast_channel *chan, const char *num, const char *ints, const char *lang)
int ast_say_phonetic_str_full (struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd)
int ast_say_time (struct ast_channel *chan, time_t t, const char *ints, const char *lang)


Detailed Description

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

Definition in file say.h.


Function Documentation

int ast_say_character_str struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang
 

Definition at line 132 of file say.c.

References ast_say_character_str_full().

Referenced by pbx_builtin_saycharacters(), play_mailbox_owner(), and saycharstr().

00133 {
00134    return ast_say_character_str_full(chan, str, ints, lang, -1, -1);
00135 }

int ast_say_character_str_full struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang,
int  audiofd,
int  ctrlfd
 

Definition at line 57 of file say.c.

References ast_stopstream(), ast_streamfile(), and ast_waitstream_full().

Referenced by ast_say_character_str(), and handle_sayalpha().

00058 {
00059    const char *fn;
00060    char fnbuf[256];
00061    char ltr;
00062    int num = 0;
00063    int res = 0;
00064 
00065    while (str[num]) {
00066       fn = NULL;
00067       switch (str[num]) {
00068       case ('*'):
00069          fn = "digits/star";
00070          break;
00071       case ('#'):
00072          fn = "digits/pound";
00073          break;
00074       case ('!'):
00075          fn = "letters/exclaimation-point";
00076          break;
00077       case ('@'):
00078          fn = "letters/at";
00079          break;
00080       case ('$'):
00081          fn = "letters/dollar";
00082          break;
00083       case ('-'):
00084          fn = "letters/dash";
00085          break;
00086       case ('.'):
00087          fn = "letters/dot";
00088          break;
00089       case ('='):
00090          fn = "letters/equals";
00091          break;
00092       case ('+'):
00093          fn = "letters/plus";
00094          break;
00095       case ('/'):
00096          fn = "letters/slash";
00097          break;
00098       case (' '):
00099          fn = "letters/space";
00100          break;
00101       case ('0'):
00102       case ('1'):
00103       case ('2'):
00104       case ('3'):
00105       case ('4'):
00106       case ('5'):
00107       case ('6'):
00108       case ('7'):
00109       case ('8'):
00110       case ('9'):
00111          strcpy(fnbuf, "digits/X");
00112          fnbuf[7] = str[num];
00113          fn = fnbuf;
00114          break;
00115       default:
00116          ltr = str[num];
00117          if ('A' <= ltr && ltr <= 'Z') ltr += 'a' - 'A';    /* file names are all lower-case */
00118          strcpy(fnbuf, "letters/X");
00119          fnbuf[8] = ltr;
00120          fn = fnbuf;
00121       }
00122       res = ast_streamfile(chan, fn, lang);
00123       if (!res) 
00124          res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
00125       ast_stopstream(chan);
00126       num++;
00127    }
00128 
00129    return res;
00130 }

int ast_say_date struct ast_channel chan,
time_t  t,
const char *  ints,
const char *  lang
 

Definition at line 2719 of file say.c.

References ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_nl(), and ast_say_date_pt().

Referenced by ast_say_datetime_de(), ast_say_datetime_nl(), and handle_saydate().

02720 {
02721    if (!strcasecmp(lang, "en") ) {  /* English syntax */
02722       return(ast_say_date_en(chan, t, ints, lang));
02723    } else if (!strcasecmp(lang, "da") ) { /* Danish syntax */
02724       return(ast_say_date_da(chan, t, ints, lang));
02725    } else if (!strcasecmp(lang, "de") ) { /* German syntax */
02726       return(ast_say_date_de(chan, t, ints, lang));
02727    } else if (!strcasecmp(lang, "fr") ) { /* French syntax */
02728       return(ast_say_date_fr(chan, t, ints, lang));
02729    } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */
02730       return(ast_say_date_nl(chan, t, ints, lang));
02731    } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */
02732       return(ast_say_date_pt(chan, t, ints, lang));
02733    } else if (!strcasecmp(lang, "gr") ) {          /* Greek syntax */
02734       return(ast_say_date_gr(chan, t, ints, lang));
02735    }
02736 
02737    /* Default to English */
02738    return(ast_say_date_en(chan, t, ints, lang));
02739 }

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
 

Definition at line 2948 of file say.c.

References 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_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pt(), and ast_say_date_with_format_tw().

Referenced by 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_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pt(), ast_say_date_with_format_tw(), handle_saydatetime(), play_message_datetime(), and sayunixtime_exec().

02949 {
02950    if (!strcasecmp(lang, "en") ) {  /* English syntax */
02951       return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone));
02952    } else if (!strcasecmp(lang, "da") ) { /* Danish syntax */
02953       return(ast_say_date_with_format_da(chan, time, ints, lang, format, timezone));
02954    } else if (!strcasecmp(lang, "de") ) { /* German syntax */
02955       return(ast_say_date_with_format_de(chan, time, ints, lang, format, timezone));
02956    } else if (!strcasecmp(lang, "es") || !strcasecmp(lang, "mx")) {  /* Spanish syntax */
02957       return(ast_say_date_with_format_es(chan, time, ints, lang, format, timezone));
02958    } else if (!strcasecmp(lang, "he")) {  /* Hebrew syntax */
02959       return(ast_say_date_with_format_he(chan, time, ints, lang, format, timezone));
02960    } else if (!strcasecmp(lang, "fr") ) { /* French syntax */
02961       return(ast_say_date_with_format_fr(chan, time, ints, lang, format, timezone));
02962    } else if (!strcasecmp(lang, "it") ) {  /* Italian syntax */
02963       return(ast_say_date_with_format_it(chan, time, ints, lang, format, timezone));
02964    } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */
02965       return(ast_say_date_with_format_nl(chan, time, ints, lang, format, timezone));
02966    } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */
02967       return(ast_say_date_with_format_pt(chan, time, ints, lang, format, timezone));
02968    } else if (!strcasecmp(lang, "tw") ) { /* Taiwanese syntax */
02969       return(ast_say_date_with_format_tw(chan, time, ints, lang, format, timezone));
02970    } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */
02971       return(ast_say_date_with_format_gr(chan, time, ints, lang, format, timezone));
02972    }
02973 
02974    /* Default to English */
02975    return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone));
02976 }

int ast_say_datetime struct ast_channel chan,
time_t  t,
const char *  ints,
const char *  lang
 

Definition at line 5284 of file say.c.

References ast_say_datetime_de(), ast_say_datetime_en(), ast_say_datetime_fr(), ast_say_datetime_gr(), ast_say_datetime_nl(), ast_say_datetime_pt(), and ast_say_datetime_tw().

Referenced by datetime_exec().

05285 {
05286    if (!strcasecmp(lang, "en") ) {  /* English syntax */
05287       return(ast_say_datetime_en(chan, t, ints, lang));
05288    } else if (!strcasecmp(lang, "de") ) { /* German syntax */
05289       return(ast_say_datetime_de(chan, t, ints, lang));
05290    } else if (!strcasecmp(lang, "fr") ) { /* French syntax */
05291       return(ast_say_datetime_fr(chan, t, ints, lang));
05292    } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */
05293       return(ast_say_datetime_nl(chan, t, ints, lang));
05294    } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */
05295       return(ast_say_datetime_pt(chan, t, ints, lang));
05296    } else if (!strcasecmp(lang, "tw") ) { /* Taiwanese syntax */
05297       return(ast_say_datetime_tw(chan, t, ints, lang));
05298    } else if (!strcasecmp(lang, "gr") ) {          /* Greek syntax */
05299       return(ast_say_datetime_gr(chan, t, ints, lang));
05300    }
05301 
05302    /* Default to English */
05303    return(ast_say_datetime_en(chan, t, ints, lang));
05304 }

int ast_say_datetime_from_now struct ast_channel chan,
time_t  t,
const char *  ints,
const char *  lang
 

Definition at line 5563 of file say.c.

References ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), and ast_say_datetime_from_now_pt().

05564 {
05565    if (!strcasecmp(lang, "en") ) {  /* English syntax */
05566       return(ast_say_datetime_from_now_en(chan, t, ints, lang));
05567    } else if (!strcasecmp(lang, "fr") ) { /* French syntax */
05568       return(ast_say_datetime_from_now_fr(chan, t, ints, lang));
05569    } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */
05570       return(ast_say_datetime_from_now_pt(chan, t, ints, lang));
05571    }
05572 
05573    /* Default to English */
05574    return(ast_say_datetime_from_now_en(chan, t, ints, lang));
05575 }

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

Definition at line 262 of file say.c.

References ast_say_digit_str_full().

Referenced by invent_message(), mgcp_ss(), pbx_builtin_saydigits(), skinny_ss(), and ss_thread().

00263 {
00264    return ast_say_digit_str_full(chan, str, ints, lang, -1, -1);
00265 }

int ast_say_digit_str_full struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang,
int  audiofd,
int  ctrlfd
 

Definition at line 216 of file say.c.

References ast_stopstream(), ast_streamfile(), and ast_waitstream_full().

Referenced by ast_say_digit_str(), ast_say_digits_full(), and handle_saydigits().

00217 {
00218    const char *fn;
00219    char fnbuf[256];
00220    int num = 0;
00221    int res = 0;
00222 
00223    while (str[num] && !res) {
00224       fn = NULL;
00225       switch (str[num]) {
00226       case ('*'):
00227          fn = "digits/star";
00228          break;
00229       case ('#'):
00230          fn = "digits/pound";
00231          break;
00232       case ('-'):
00233          fn = "digits/minus";
00234          break;
00235       case '0':
00236       case '1':
00237       case '2':
00238       case '3':
00239       case '4':
00240       case '5':
00241       case '6':
00242       case '7':
00243       case '8':
00244       case '9':
00245          strcpy(fnbuf, "digits/X");
00246          fnbuf[7] = str[num];
00247          fn = fnbuf;
00248          break;
00249       }
00250       if (fn) {
00251          res = ast_streamfile(chan, fn, lang);
00252          if (!res) 
00253             res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
00254          ast_stopstream(chan);
00255       }
00256       num++;
00257    }
00258 
00259    return res;
00260 }

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

Definition at line 275 of file say.c.

References ast_say_digits_full().

Referenced by parkandannounce_exec().

00276 {
00277    return ast_say_digits_full(chan, num, ints, lang, -1, -1);
00278 }

int ast_say_digits_full struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang,
int  audiofd,
int  ctrlfd
 

Definition at line 267 of file say.c.

References ast_say_digit_str_full().

Referenced by ast_say_digits(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_number_full_cz(), 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_he(), ast_say_number_full_it(), 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(), and ast_say_number_full_tw().

00268 {
00269    char fn2[256];
00270 
00271    snprintf(fn2, sizeof(fn2), "%d", num);
00272    return ast_say_digit_str_full(chan, fn2, ints, lang, audiofd, ctrlfd);
00273 }

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

ast_say_enumeration: call language-specific functions without file descriptors

Definition at line 2289 of file say.c.

References ast_say_enumeration_full().

Referenced by ast_say_date_da(), ast_say_date_de(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), and ast_say_date_with_format_en().

02290 {
02291    return(ast_say_enumeration_full(chan, num, ints, language, options, -1, -1));
02292 }

int ast_say_enumeration_full struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang,
const char *  options,
int  audiofd,
int  ctrlfd
 

ast_say_enumeration_full: call language-specific functions

Definition at line 2274 of file say.c.

References ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), and ast_say_enumeration_full_en().

Referenced by ast_say_enumeration().

02275 {
02276    if (!strcasecmp(language,"en") ) {  /* English syntax */
02277       return(ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd));
02278    } else if (!strcasecmp(language, "da") ) {   /* Danish syntax */
02279       return(ast_say_enumeration_full_da(chan, num, ints, language, options, audiofd, ctrlfd));
02280    } else if (!strcasecmp(language, "de") ) {   /* German syntax */
02281       return(ast_say_enumeration_full_de(chan, num, ints, language, options, audiofd, ctrlfd));
02282    } 
02283    
02284    /* Default to english */
02285    return(ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd));
02286 }

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

ast_say_number: call language-specific functions without file descriptors

Definition at line 457 of file say.c.

References ast_say_number_full().

Referenced by ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_nl(), ast_say_date_pt(), 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_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pt(), 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_pt(), ast_say_datetime_pt(), ast_say_datetime_tw(), ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_nl(), ast_say_time_pt(), ast_say_time_tw(), bridge_playfile(), conf_exec(), conf_run(), count_exec(), get_folder(), gr_say_number_female(), pbx_builtin_saynumber(), play_message(), play_message_duration(), say_and_wait(), say_position(), saynum(), vm_intro_gr(), and vm_intro_pt().

00458 {
00459    return(ast_say_number_full(chan, num, ints, language, options, -1, -1));
00460 }

int ast_say_number_full struct ast_channel chan,
int  num,
const char *  ints,
const char *  lang,
const char *  options,
int  audiofd,
int  ctrlfd
 

ast_say_number_full: call language-specific functions

Definition at line 414 of file say.c.

References ast_say_number_full_cz(), 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_it(), 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(), and ast_say_number_full_tw().

Referenced by ast_say_number(), and handle_saynumber().

00415 {
00416    if (!strcasecmp(language,"en") ) {  /* English syntax */
00417       return(ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd));
00418    } else if (!strcasecmp(language, "cz") ) {   /* Czech syntax */
00419       return(ast_say_number_full_cz(chan, num, ints, language, options, audiofd, ctrlfd));
00420    } else if (!strcasecmp(language, "da") ) {   /* Danish syntax */
00421       return(ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd));
00422    } else if (!strcasecmp(language, "de") ) {   /* German syntax */
00423       return(ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd));
00424    } else if (!strcasecmp(language, "en_GB") ) {   /* British syntax */
00425       return(ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd));
00426    } else if (!strcasecmp(language, "no") ) {   /* Norwegian syntax */
00427       return(ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd));
00428    } else if (!strcasecmp(language, "es") || !strcasecmp(language, "mx")) {   /* Spanish syntax */
00429       return(ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd));
00430    } else if (!strcasecmp(language, "fr") ) {   /* French syntax */
00431       return(ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd));
00432    } else if (!strcasecmp(language, "he") ) {   /* Hebrew syntax */
00433       return(ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd));
00434    } else if (!strcasecmp(language, "it") ) {   /* Italian syntax */
00435       return(ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd));
00436    } else if (!strcasecmp(language, "nl") ) {   /* Dutch syntax */
00437       return(ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd));
00438    } else if (!strcasecmp(language, "pl") ) {   /* Polish syntax */
00439       return(ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd));
00440    } else if (!strcasecmp(language, "pt") ) {   /* Portuguese syntax */
00441       return(ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd));
00442    } else if (!strcasecmp(language, "se") ) {   /* Swedish syntax */
00443       return(ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd));
00444    } else if (!strcasecmp(language, "tw")) { /* Taiwanese syntax */
00445       return(ast_say_number_full_tw(chan, num, ints, language, audiofd, ctrlfd));
00446    } else if (!strcasecmp(language, "gr") ) {   /* Greek syntax */
00447       return(ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd));
00448    } else if (!strcasecmp(language, "ru") ) {   /* Russian syntax */
00449       return(ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd));
00450    }
00451 
00452    /* Default to english */
00453    return(ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd));
00454 }

int ast_say_phonetic_str struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang
 

Definition at line 211 of file say.c.

References ast_say_phonetic_str_full().

Referenced by pbx_builtin_sayphonetic().

00212 {
00213    return ast_say_phonetic_str_full(chan, str, ints, lang, -1, -1);
00214 }

int ast_say_phonetic_str_full struct ast_channel chan,
const char *  num,
const char *  ints,
const char *  lang,
int  audiofd,
int  ctrlfd
 

Definition at line 137 of file say.c.

References ast_stopstream(), ast_streamfile(), and ast_waitstream_full().

Referenced by ast_say_phonetic_str(), and handle_sayphonetic().

00138 {
00139    const char *fn;
00140    char fnbuf[256];
00141    char ltr;
00142    int num = 0;
00143    int res = 0;
00144 
00145    while (str[num]) {
00146       fn = NULL;
00147       switch (str[num]) {
00148       case ('*'):
00149          fn = "digits/star";
00150          break;
00151       case ('#'):
00152          fn = "digits/pound";
00153          break;
00154       case ('!'):
00155          fn = "letters/exclaimation-point";
00156          break;
00157       case ('@'):
00158          fn = "letters/at";
00159          break;
00160       case ('$'):
00161          fn = "letters/dollar";
00162          break;
00163       case ('-'):
00164          fn = "letters/dash";
00165          break;
00166       case ('.'):
00167          fn = "letters/dot";
00168          break;
00169       case ('='):
00170          fn = "letters/equals";
00171          break;
00172       case ('+'):
00173          fn = "letters/plus";
00174          break;
00175       case ('/'):
00176          fn = "letters/slash";
00177          break;
00178       case (' '):
00179          fn = "letters/space";
00180          break;
00181       case ('0'):
00182       case ('1'):
00183       case ('2'):
00184       case ('3'):
00185       case ('4'):
00186       case ('5'):
00187       case ('6'):
00188       case ('7'):
00189       case ('8'):
00190          strcpy(fnbuf, "digits/X");
00191          fnbuf[7] = str[num];
00192          fn = fnbuf;
00193          break;
00194       default: /* '9' falls here... */
00195          ltr = str[num];
00196          if ('A' <= ltr && ltr <= 'Z') ltr += 'a' - 'A';    /* file names are all lower-case */
00197          strcpy(fnbuf, "phonetic/X_p");
00198          fnbuf[9] = ltr;
00199          fn = fnbuf;
00200       }
00201       res = ast_streamfile(chan, fn, lang);
00202       if (!res) 
00203          res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
00204       ast_stopstream(chan);
00205       num++;
00206    }
00207 
00208    return res;
00209 }

int ast_say_time struct ast_channel chan,
time_t  t,
const char *  ints,
const char *  lang
 

Definition at line 5095 of file say.c.

References ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_nl(), ast_say_time_pt(), and ast_say_time_tw().

Referenced by ast_say_datetime_de(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_pt(), ast_say_datetime_nl(), and handle_saytime().

05096 {
05097    if (!strcasecmp(lang, "en") ) {  /* English syntax */
05098       return(ast_say_time_en(chan, t, ints, lang));
05099    } else if (!strcasecmp(lang, "de") ) { /* German syntax */
05100       return(ast_say_time_de(chan, t, ints, lang));
05101    } else if (!strcasecmp(lang, "fr") ) { /* French syntax */
05102       return(ast_say_time_fr(chan, t, ints, lang));
05103    } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */
05104       return(ast_say_time_nl(chan, t, ints, lang));
05105    } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */
05106       return(ast_say_time_pt(chan, t, ints, lang));
05107    } else if (!strcasecmp(lang, "tw") ) { /* Taiwanese syntax */
05108       return(ast_say_time_tw(chan, t, ints, lang));
05109    } else if (!strcasecmp(lang, "gr") ) {          /* Greek syntax */
05110       return(ast_say_time_gr(chan, t, ints, lang));
05111    }
05112 
05113    /* Default to English */
05114    return(ast_say_time_en(chan, t, ints, lang));
05115 }


Generated on Fri May 26 01:50:25 2006 for Asterisk - the Open Source PBX by  doxygen 1.4.6