* \note 2007-02-08 : Support for Georgian added by Alexander Shaduri <ashaduri@gmail.com>,
* Next Generation Networks (NGN).
* \note 2007-03-20 : Support for Thai added by Dome C. <dome@tel.co.th>,
- * IP Crossing Co.,Ltd.
+ * IP Crossing Co., Ltd.
*/
#include "asterisk.h"
/* Called from AGI */
static int say_number_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
{
- if (!strcasecmp(language,"en") ) { /* English syntax */
+ if (!strcasecmp(language, "en") ) { /* English syntax */
return(ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd));
} else if (!strcasecmp(language, "cz") ) { /* Czech syntax */
return(ast_say_number_full_cz(chan, num, ints, language, options, audiofd, ctrlfd));
int playh = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num || playh)) {
if (num < 0) {
options = "w";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num || playh)) {
if (num < 0) {
num = 0;
}
} else if (num < 3 ) {
- snprintf(fn, sizeof(fn), "digits/%d%c",num,options[0]);
+ snprintf(fn, sizeof(fn), "digits/%d%c", num, options[0]);
playh = 0;
num = 0;
} else if (num < 20) {
- snprintf(fn, sizeof(fn), "digits/%d",num);
+ snprintf(fn, sizeof(fn), "digits/%d", num);
playh = 0;
num = 0;
} else if (num < 100) {
} else if ( hundered == 2 ) {
ast_copy_string(fn, "digits/2ste", sizeof(fn));
} else {
- res = ast_say_number_full_cz(chan,hundered,ints,language,options,audiofd,ctrlfd);
+ res = ast_say_number_full_cz(chan, hundered, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
if (hundered == 3 || hundered == 4) {
}
}
if ( left > 1 ) { /* we dont say "one thousand" but only thousand */
- res = ast_say_number_full_cz(chan,left,ints,language,options,audiofd,ctrlfd);
+ res = ast_say_number_full_cz(chan, left, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
}
if ( left >= 5 ) { /* >= 5 have the same declesion */
- snprintf(fn, sizeof(fn), "digits/5_E%d",length-1);
+ snprintf(fn, sizeof(fn), "digits/5_E%d", length - 1);
} else if ( left >= 2 && left <= 4 ) {
- snprintf(fn, sizeof(fn), "digits/2-4_E%d",length-1);
+ snprintf(fn, sizeof(fn), "digits/2-4_E%d", length - 1);
} else { /* left == 1 */
- snprintf(fn, sizeof(fn), "digits/1_E%d",length-1);
+ snprintf(fn, sizeof(fn), "digits/1_E%d", length - 1);
}
num -= left * (exp10_int(length-1));
}
int cn = 1; /* +1 = commune; -1 = neuter */
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "n",1)) cn = -1;
+ if (options && !strncasecmp(options, "n", 1)) cn = -1;
while (!res && (num || playh || playa )) {
/* The grammar for Danish numbers is the same as for English except
char fn[256] = "";
char fna[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && (!strncasecmp(options, "f",1)))
+ if (options && (!strncasecmp(options, "f", 1)))
mf = -1;
while (!res && num) {
int playa = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num || playh || playa )) {
if (num < 0) {
int mf = 0; /* +1 = male; -1 = female */
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
if (options) {
- if (!strncasecmp(options, "f",1))
+ if (!strncasecmp(options, "f", 1))
mf = -1;
else if (!strncasecmp(options, "m", 1))
mf = 1;
int mf = 1; /* +1 = male; -1 = female */
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "f",1))
+ if (options && !strncasecmp(options, "f", 1))
mf = -1;
while (!res && (num || playh || playa)) {
int state = 0; /* no need to save anything */
int mf = 1; /* +1 = Masculin; -1 = Feminin */
char fn[SAY_NUM_BUF_SIZE] = "";
- ast_verb(3, "ast_say_digits_full: started. "
+ ast_debug(3, "ast_say_digits_full: started. "
"num: %d, options=\"%s\"\n",
num, options
);
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "f",1))
+ if (options && !strncasecmp(options, "f", 1))
mf = -1;
/* Do we have work to do? */
* state==0 is the normal mode and it means that we continue
* to check if the number num has yet anything left.
*/
- ast_verb(3, "ast_say_digits_full: num: %d, "
+ ast_debug(3, "ast_say_digits_full: num: %d, "
"state=%d, options=\"%s\", mf=%d\n",
num, state, options, mf
);
- if (state==1) {
+ if (state == 1) {
ast_copy_string(fn, "digits/hundred", sizeof(fn));
state = 0;
- } else if (state==2) {
+ } else if (state == 2) {
ast_copy_string(fn, "digits/ve", sizeof(fn));
state = 0;
- } else if (state==3) {
+ } else if (state == 3) {
ast_copy_string(fn, "digits/thousands", sizeof(fn));
state=0;
- } else if (num <21) {
+ } else if (num < 21) {
if (mf < 0)
snprintf(fn, sizeof(fn), "digits/%dF", num);
else
snprintf(fn, sizeof(fn), "digits/%d", num);
num = 0;
} else if (num < 100) {
- snprintf(fn, sizeof(fn), "digits/%d", (num/10)*10);
+ snprintf(fn, sizeof(fn), "digits/%d", (num / 10) * 10);
num = num % 10;
- if (num>0) state=2;
+ if (num > 0) state = 2;
} else if (num < 200) {
ast_copy_string(fn, "digits/1hundred", sizeof(fn));
num = num - 100;
- state=2;
+ state = 2;
} else if (num < 300) {
ast_copy_string(fn, "digits/2hundred", sizeof(fn));
num = num - 200;
- state=2;
+ state = 2;
} else if (num < 1000) {
- snprintf(fn, sizeof(fn), "digits/%d", (num/100));
- state=1;
+ snprintf(fn, sizeof(fn), "digits/%d", (num / 100));
+ state = 1;
num = num % 100;
} else if (num < 2000) {
ast_copy_string(fn, "digits/thousand", sizeof(fn));
} else if (num < 3000) {
ast_copy_string(fn, "digits/2thousand", sizeof(fn));
num = num - 2000;
- if (num>0) state=2;
+ if (num > 0)
+ state = 2;
} else if (num < 20000) {
- snprintf(fn, sizeof(fn), "digits/%ds",(num/1000));
+ snprintf(fn, sizeof(fn), "digits/%ds", (num / 1000));
num = num % 1000;
- state=3;
+ state = 3;
} else if (num < 1000000) {
res = ast_say_number_full_he(chan, num / 1000, ints, language, options, audiofd, ctrlfd);
if (res)
int playh = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
/*
Hungarian support
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
/*
Italian support
int units = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num || playh )) {
if (num < 0) {
ast_copy_string(fn, "digits/minus", sizeof(fn));
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "n",1)) cn = -1;
+ if (options && !strncasecmp(options, "n", 1)) cn = -1;
while (!res && (num || playh || playa )) {
/* The grammar for Norwegian numbers is the same as for English except
*/
{
- char *zenski_cyfry[] = {"0","1z", "2z", "3", "4", "5", "6", "7", "8", "9"};
+ char *zenski_cyfry[] = {"0", "1z", "2z", "3", "4", "5", "6", "7", "8", "9"};
- char *zenski_cyfry2[] = {"0","1", "2z", "3", "4", "5", "6", "7", "8", "9"};
+ char *zenski_cyfry2[] = {"0", "1", "2z", "3", "4", "5", "6", "7", "8", "9"};
- char *meski_cyfry[] = {"0","1", "2-1m", "3-1m", "4-1m", "5m", /*"2-1mdwaj"*/ "6m", "7m", "8m", "9m"};
+ char *meski_cyfry[] = {"0", "1", "2-1m", "3-1m", "4-1m", "5m", /*"2-1mdwaj"*/ "6m", "7m", "8m", "9m"};
- char *meski_cyfry2[] = {"0","1", "2-2m", "3-2m", "4-2m", "5m", "6m", "7m", "8m", "9m"};
+ char *meski_cyfry2[] = {"0", "1", "2-2m", "3-2m", "4-2m", "5m", "6m", "7m", "8m", "9m"};
char *meski_setki[] = {"", "100m", "200m", "300m", "400m", "500m", "600m", "700m", "800m", "900m"};
char *meski_nastki[] = {"", "11m", "12m", "13m", "14m", "15m", "16m", "17m", "18m", "19m"};
- char *nijaki_cyfry[] = {"0","1", "2", "3", "4", "5", "6", "7", "8", "9"};
+ char *nijaki_cyfry[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
- char *nijaki_cyfry2[] = {"0","1", "2", "3", "4", "5", "6", "7", "8", "9"};
+ char *nijaki_cyfry2[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
char *nijaki_setki[] = {"", "100", "200", "300", "400", "500", "600", "700", "800", "900"};
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "f",1))
+ if (options && !strncasecmp(options, "f", 1))
mf = -1;
while (!res && num ) {
char fn[256] = "";
int cn = 1; /* +1 = commune; -1 = neuter */
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
- if (options && !strncasecmp(options, "n",1)) cn = -1;
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
+ if (options && !strncasecmp(options, "n", 1)) cn = -1;
while (!res && (num || playh)) {
if (num < 0) {
int playh = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num || playh)) {
if (num < 0) {
int lastdigits = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && (num)) {
if (num < 0) {
int playh = 0;
char fn[256] = "";
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while(!res && (num || playh)) {
if (num < 0) {
/* Called from AGI */
static int say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
{
- if (!strcasecmp(language,"en") ) { /* English syntax */
+ if (!strcasecmp(language, "en") ) { /* English syntax */
return(ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd));
} else if (!strcasecmp(language, "da") ) { /* Danish syntax */
return(ast_say_enumeration_full_da(chan, num, ints, language, options, audiofd, ctrlfd));
char fn[256] = "", fna[256] = "";
char *gender;
- if (options && !strncasecmp(options, "f",1)) {
+ if (options && !strncasecmp(options, "f", 1)) {
gender = "F";
- } else if (options && !strncasecmp(options, "n",1)) {
+ } else if (options && !strncasecmp(options, "n", 1)) {
gender = "N";
} else {
gender = "";
}
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && num) {
if (num < 0) {
char fn[256] = "", fna[256] = "";
char *gender;
- if (options && !strncasecmp(options, "f",1)) {
+ if (options && !strncasecmp(options, "f", 1)) {
gender = "F";
- } else if (options && !strncasecmp(options, "n",1)) {
+ } else if (options && !strncasecmp(options, "n", 1)) {
gender = "N";
} else {
gender = "";
}
if (!num)
- return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
+ return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
while (!res && num) {
if (num < 0) {
/* We'll just be silent on the year, instead of bombing out. */
} else {
/* year 1100 to 1999. will anybody need this?!? */
- snprintf(fn,sizeof(fn), "digits/%d", (year / 100) );
+ snprintf(fn, sizeof(fn), "digits/%d", (year / 100));
res = wait_file(chan, ints, fn, lang);
if (!res) {
- res = wait_file(chan,ints, "digits/hundred", lang);
+ res = wait_file(chan, ints, "digits/hundred", lang);
if (!res && year % 100 != 0) {
res = ast_say_number(chan, (year % 100), ints, lang, (char *) NULL);
}
} else {
/* year 1100 to 1999. will anybody need this?!? */
/* say 1967 as 'neunzehn hundert sieben und sechzig' */
- snprintf(fn,sizeof(fn), "digits/%d", (year / 100) );
+ snprintf(fn, sizeof(fn), "digits/%d", (year / 100) );
res = wait_file(chan, ints, fn, lang);
if (!res) {
- res = wait_file(chan,ints, "digits/hundred", lang);
+ res = wait_file(chan, ints, "digits/hundred", lang);
if (!res && year % 100 != 0) {
res = ast_say_number(chan, (year % 100), ints, lang, (char *) NULL);
}
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* Month enumerated */
if (!res) {
if (tm.tm_year <= 9) {
/* 1901 - 1909 */
- res = wait_file(chan,ints, "digits/oh", lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
}
res |= ast_say_number(chan, tm.tm_year, ints, lang, (char *) NULL);
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
if (format[offset] == 'H') {
/* e.g. oh-eight */
if (tm.tm_hour < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
}
} else {
/* e.g. eight */
if (tm.tm_hour == 0) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
}
}
if (!res) {
if (tm.tm_hour != 0) {
int remainder = tm.tm_hour;
if (tm.tm_hour > 20) {
- res = wait_file(chan,ints, "digits/20",lang);
+ res = wait_file(chan, ints, "digits/20", lang);
remainder -= 20;
}
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", remainder);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remainder);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
res = wait_file(chan, ints, "digits/hundred", lang);
}
} else if (tm.tm_min < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_min);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else {
res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
struct ast_tm tmnow;
time_t beg_today;
- gettimeofday(&now,NULL);
+ gettimeofday(&now, NULL);
ast_localtime(&now, &tmnow, timezone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
case 'S':
/* Seconds */
if (tm.tm_sec == 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else if (tm.tm_sec < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else {
res = ast_say_number(chan, tm.tm_sec, ints, lang, (char *) NULL);
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* Month enumerated */
} else {
/* year 1100 to 1999. will anybody need this?!? */
/* say 1967 as 'nineteen hundred seven and sixty' */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", (year / 100) );
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", (year / 100) );
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- res = wait_file(chan,ints, "digits/hundred",lang);
+ res = wait_file(chan, ints, "digits/hundred", lang);
if (!res && year % 100 != 0) {
res = ast_say_number(chan, (year % 100), ints, lang, (char *) NULL);
}
case 'I':
case 'l':
/* 12-Hour */
- res = wait_file(chan,ints,"digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
if (!res) {
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
}
break;
case 'H':
/* 24-Hour, single digit hours preceeded by "oh" (0) */
if (tm.tm_hour < 10 && tm.tm_hour > 0) {
- res = wait_file(chan,ints, "digits/0",lang);
+ res = wait_file(chan, ints, "digits/0", lang);
}
/* FALLTRHU */
case 'k':
}
if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
if (tm.tm_min == 1) {
- res = wait_file(chan,ints,"digits/minute",lang);
+ res = wait_file(chan, ints, "digits/minute", lang);
} else {
- res = wait_file(chan,ints,"digits/minutes",lang);
+ res = wait_file(chan, ints, "digits/minutes", lang);
}
}
break;
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or AdBY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_da(chan, time, ints, lang, "AdBY", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_da(chan, time, ints, lang, "A", timezone);
break;
case 'S':
/* Seconds */
- res = wait_file(chan,ints, "digits/and",lang);
+ res = wait_file(chan, ints, "digits/and", lang);
if (!res) {
res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
if (!res) {
- res = wait_file(chan,ints, "digits/seconds",lang);
+ res = wait_file(chan, ints, "digits/seconds", lang);
}
}
break;
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* Month enumerated */
} else {
/* year 1100 to 1999. will anybody need this?!? */
/* say 1967 as 'neunzehn hundert sieben und sechzig' */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", (year / 100) );
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", (year / 100) );
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- res = wait_file(chan,ints, "digits/hundred",lang);
+ res = wait_file(chan, ints, "digits/hundred", lang);
if (!res && year % 100 != 0) {
res = ast_say_number(chan, (year % 100), ints, lang, (char *) NULL);
}
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- res = wait_file(chan,ints,"digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
}
break;
case 'H':
/* 24-Hour */
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
if (!res) {
- res = wait_file(chan,ints,"digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
}
break;
case 'M':
}
if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
if (tm.tm_min == 1) {
- res = wait_file(chan,ints,"digits/minute",lang);
+ res = wait_file(chan, ints, "digits/minute", lang);
} else {
- res = wait_file(chan,ints,"digits/minutes",lang);
+ res = wait_file(chan, ints, "digits/minutes", lang);
}
}
break;
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or AdBY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_de(chan, time, ints, lang, "AdBY", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_de(chan, time, ints, lang, "A", timezone);
break;
case 'S':
/* Seconds */
- res = wait_file(chan,ints, "digits/and",lang);
+ res = wait_file(chan, ints, "digits/and", lang);
if (!res) {
res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
if (!res) {
- res = wait_file(chan,ints, "digits/seconds",lang);
+ res = wait_file(chan, ints, "digits/seconds", lang);
}
}
break;
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* Month enumerated */
/* 12-Hour */
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/24", sizeof(nextmsg));
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
/* 24-Hour */
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/24", sizeof(nextmsg));
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'M':
case 'N':
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e': /* Day of the month */
if ((format[offset] == 'H') &&
(tm.tm_hour <10)&&(tm.tm_hour>0)
) { /* e.g. oh-eight */
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
}
res = ast_say_number_full_he(chan, tm.tm_hour,
break;
case 'M': /* Minute */
res = ast_say_number_full_he(chan, tm.tm_min,
- ints, lang,"f", -1, -1
+ ints, lang, "f", -1, -1
);
break;
case 'P':
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or "date" */
}
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if ((todo != 'Q') &&
(beg_today - 86400 * 6 < time))
{
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- snprintf(nextmsg,sizeof(nextmsg), "%s", sndfile);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "%s", sndfile);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* First - Twelfth */
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_es(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
}
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_es(chan, time, ints, lang, "A", timezone);
case 'S':
/* Seconds */
if (tm.tm_sec == 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else if (tm.tm_sec < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else if ((tm.tm_sec < 21) || (tm.tm_sec % 10 == 0)) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
int ten, one;
ten = (tm.tm_sec / 10) * 10;
one = (tm.tm_sec % 10);
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", ten);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
/* Fifty, not fifty-zero */
if (one != 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", one);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* First - Twelfth */
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
/* First */
if (tm.tm_mday == 1) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mday);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char * ) NULL);
}
case 'Y':
/* Year */
if (tm.tm_year > 99) {
- res = wait_file(chan,ints, "digits/2",lang);
+ res = wait_file(chan, ints, "digits/2", lang);
if (!res) {
- res = wait_file(chan,ints, "digits/thousand",lang);
+ res = wait_file(chan, ints, "digits/thousand", lang);
}
if (tm.tm_year > 100) {
if (!res) {
/* I'm not going to handle 1900 and prior */
/* We'll just be silent on the year, instead of bombing out. */
} else {
- res = wait_file(chan,ints, "digits/thousand",lang);
+ res = wait_file(chan, ints, "digits/thousand", lang);
if (!res) {
- wait_file(chan,ints, "digits/9",lang);
- wait_file(chan,ints, "digits/hundred",lang);
+ wait_file(chan, ints, "digits/9", lang);
+ wait_file(chan, ints, "digits/hundred", lang);
res = ast_say_number(chan, tm.tm_year, ints, lang, (char * ) NULL);
}
}
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res)
- res = wait_file(chan,ints, "digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
break;
case 'H':
case 'k':
/* 24-Hour */
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char * ) NULL);
if (!res)
- res = wait_file(chan,ints, "digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
break;
case 'M':
/* Minute */
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or AdBY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_fr(chan, time, ints, lang, "AdBY", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_fr(chan, time, ints, lang, "A", timezone);
/* Seconds */
res = ast_say_number(chan, tm.tm_sec, ints, lang, (char * ) NULL);
if (!res) {
- res = wait_file(chan,ints, "digits/second",lang);
+ res = wait_file(chan, ints, "digits/second", lang);
}
break;
case 'T':
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* First - Twelfth */
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
/* First day of the month is spelled as ordinal */
if (tm.tm_mday == 1) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mday);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
if (!res) {
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char *) NULL);
case 'Y':
/* Year */
if (tm.tm_year > 99) {
- res = wait_file(chan,ints, "digits/ore-2000",lang);
+ res = wait_file(chan, ints, "digits/ore-2000", lang);
if (tm.tm_year > 100) {
if (!res) {
/* This works until the end of 2021 */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year - 100);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year - 100);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
} else {
/* I'm not going to handle 1900 and prior */
/* We'll just be silent on the year, instead of bombing out. */
} else {
- res = wait_file(chan,ints, "digits/ore-1900",lang);
+ res = wait_file(chan, ints, "digits/ore-1900", lang);
if ((!res) && (tm.tm_year != 0)) {
if (tm.tm_year <= 21) {
/* 1910 - 1921 */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
/* 1922 - 1999, but sounds badly in 1928, 1931, 1938, etc... */
int ten, one;
ten = tm.tm_year / 10;
one = tm.tm_year % 10;
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten * 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", ten * 10);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
if (one != 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", one);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
/* 24-Hour */
if (tm.tm_hour == 0) {
- res = wait_file(chan,ints, "digits/ore-mezzanotte",lang);
+ res = wait_file(chan, ints, "digits/ore-mezzanotte", lang);
} else if (tm.tm_hour == 1) {
- res = wait_file(chan,ints, "digits/ore-una",lang);
+ res = wait_file(chan, ints, "digits/ore-una", lang);
} else {
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
}
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_it(chan, time, ints, lang, "AdB", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_it(chan, time, ints, lang, "A", timezone);
case 'S':
/* Seconds */
if (tm.tm_sec == 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else if (tm.tm_sec < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else if ((tm.tm_sec < 21) || (tm.tm_sec % 10 == 0)) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
int ten, one;
ten = (tm.tm_sec / 10) * 10;
one = (tm.tm_sec % 10);
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", ten);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
/* Fifty, not fifty-zero */
if (one != 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", one);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* First - Twelfth */
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
case 'Y':
/* Year */
if (tm.tm_year > 99) {
- res = wait_file(chan,ints, "digits/2",lang);
+ res = wait_file(chan, ints, "digits/2", lang);
if (!res) {
- res = wait_file(chan,ints, "digits/thousand",lang);
+ res = wait_file(chan, ints, "digits/thousand", lang);
}
if (tm.tm_year > 100) {
if (!res) {
/* This works until the end of 2020 */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year - 100);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year - 100);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
} else {
/* I'm not going to handle 1900 and prior */
/* We'll just be silent on the year, instead of bombing out. */
} else {
- res = wait_file(chan,ints, "digits/19",lang);
+ res = wait_file(chan, ints, "digits/19", lang);
if (!res) {
if (tm.tm_year <= 9) {
/* 1901 - 1909 */
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else if (tm.tm_year <= 20) {
/* 1910 - 1920 */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
/* 1921 - 1999 */
int ten, one;
ten = tm.tm_year / 10;
one = tm.tm_year % 10;
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten * 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", ten * 10);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
if (one != 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", one);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
/* 24-Hour */
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
if (!res) {
- res = wait_file(chan,ints, "digits/nl-uur",lang);
+ res = wait_file(chan, ints, "digits/nl-uur", lang);
}
break;
case 'M':
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_nl(chan, time, ints, lang, "ABdY", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_nl(chan, time, ints, lang, "A", timezone);
if (tm.tm_year > 100) {
res = wait_file(chan, ints, "digits/2", lang);
if (!res)
- res = wait_file(chan, ints, "digits/1000.2",lang);
+ res = wait_file(chan, ints, "digits/1000.2", lang);
if (tm.tm_year > 100) {
if (!res)
res = ast_say_enumeration(chan, tm.tm_year - 100, ints, lang, NULL);
one = tm.tm_sec % 10;
if (one > 1 && one < 5 && ten != 1)
- res = wait_file(chan,ints, "digits/seconds",lang);
+ res = wait_file(chan, ints, "digits/seconds", lang);
else
- res = wait_file(chan,ints, "digits/second",lang);
+ res = wait_file(chan, ints, "digits/second", lang);
}
}
}
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- snprintf(nextmsg,sizeof(nextmsg), "%s", sndfile);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "%s", sndfile);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'm':
/* First - Twelfth */
if (!strcasecmp(lang, "pt_BR")) {
res = ast_say_number(chan, tm.tm_mon+1, ints, lang, (char *) NULL);
} else {
- snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
+ res = wait_file(chan, ints, nextmsg, lang);
}
break;
case 'd':
res = ast_say_number(chan, tm.tm_hour, ints, lang, "f");
if ((!res) && (format[offset] == 'H')) {
if (tm.tm_hour > 1) {
- res = wait_file(chan,ints,"digits/hours",lang);
+ res = wait_file(chan, ints, "digits/hours", lang);
} else {
- res = wait_file(chan,ints,"digits/hour",lang);
+ res = wait_file(chan, ints, "digits/hour", lang);
}
}
} else {
if (tm.tm_hour != 0) {
int remainder = tm.tm_hour;
if (tm.tm_hour > 20) {
- res = wait_file(chan,ints, "digits/20",lang);
+ res = wait_file(chan, ints, "digits/20", lang);
remainder -= 20;
}
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", remainder);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remainder);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
res = ast_say_number(chan, tm.tm_min, ints, lang, NULL);
if (!res) {
if (tm.tm_min > 1) {
- res = wait_file(chan,ints,"digits/minutes",lang);
+ res = wait_file(chan, ints, "digits/minutes", lang);
} else {
- res = wait_file(chan,ints,"digits/minute",lang);
+ res = wait_file(chan, ints, "digits/minute", lang);
}
}
} else {
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_pt(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_pt(chan, time, ints, lang, "A", timezone);
res = ast_say_number(chan, tm.tm_sec, ints, lang, NULL);
if (!res) {
if (tm.tm_sec > 1) {
- res = wait_file(chan,ints,"digits/seconds",lang);
+ res = wait_file(chan, ints, "digits/seconds", lang);
} else {
- res = wait_file(chan,ints,"digits/second",lang);
+ res = wait_file(chan, ints, "digits/second", lang);
}
}
} else {
if (tm.tm_sec == 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else if (tm.tm_sec < 10) {
- res = wait_file(chan,ints, "digits/oh",lang);
+ res = wait_file(chan, ints, "digits/oh", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else if ((tm.tm_sec < 21) || (tm.tm_sec % 10 == 0)) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
int ten, one;
ten = (tm.tm_sec / 10) * 10;
one = (tm.tm_sec % 10);
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", ten);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
/* Fifty, not fifty-zero */
if (one != 0) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", one);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
case 'm':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
/* First - Thirtyfirst */
if (!(tm.tm_mday % 10) || (tm.tm_mday < 10)) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_mday);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday - (tm.tm_mday % 10));
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_mday - (tm.tm_mday % 10));
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_mday % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
- if (!res) res = wait_file(chan,ints,"digits/day",lang);
+ if (!res) res = wait_file(chan, ints, "digits/day", lang);
break;
case 'Y':
/* Year */
if (tm.tm_year > 99) {
- res = wait_file(chan,ints, "digits/2",lang);
+ res = wait_file(chan, ints, "digits/2", lang);
if (!res) {
- res = wait_file(chan,ints, "digits/thousand",lang);
+ res = wait_file(chan, ints, "digits/thousand", lang);
}
if (tm.tm_year > 100) {
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", (tm.tm_year - 100) / 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", (tm.tm_year - 100) / 10);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", (tm.tm_year - 100) % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", (tm.tm_year - 100) % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
if (!res) {
- res = wait_file(chan,ints, "digits/year",lang);
+ res = wait_file(chan, ints, "digits/year", lang);
}
} else {
if (tm.tm_year < 1) {
/* I'm not going to handle 1900 and prior */
/* We'll just be silent on the year, instead of bombing out. */
} else {
- res = wait_file(chan,ints, "digits/1",lang);
+ res = wait_file(chan, ints, "digits/1", lang);
if (!res) {
- res = wait_file(chan,ints, "digits/9",lang);
+ res = wait_file(chan, ints, "digits/9", lang);
}
if (!res) {
if (tm.tm_year <= 9) {
/* 1901 - 1909 */
- res = wait_file(chan,ints, "digits/0",lang);
+ res = wait_file(chan, ints, "digits/0", lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year);
+ res = wait_file(chan, ints, nextmsg, lang);
}
} else {
/* 1910 - 1999 */
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year / 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year / 10);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_year % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_year % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
}
}
if (!res) {
- res = wait_file(chan,ints, "digits/year",lang);
+ res = wait_file(chan, ints, "digits/year", lang);
}
}
break;
if (tm.tm_hour == 0)
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
else if (tm.tm_hour > 12)
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
else
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- res = wait_file(chan,ints, "digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
}
break;
case 'H':
case 'k':
/* 24-Hour */
if (!(tm.tm_hour % 10) || tm.tm_hour < 10) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour - (tm.tm_hour % 10));
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - (tm.tm_hour % 10));
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
if (!res) {
- res = wait_file(chan,ints, "digits/oclock",lang);
+ res = wait_file(chan, ints, "digits/oclock", lang);
}
break;
case 'M':
if (tm.tm_min < 10) {
res = wait_file(chan, ints, "digits/0", lang);
}
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_min);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min - (tm.tm_min % 10));
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_min - (tm.tm_min % 10));
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_min % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
if (!res) {
- res = wait_file(chan,ints, "digits/minute",lang);
+ res = wait_file(chan, ints, "digits/minute", lang);
}
break;
case 'P':
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_tw(chan, time, ints, lang, "A", timezone);
if (tm.tm_sec < 10) {
res = wait_file(chan, ints, "digits/0", lang);
}
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec);
+ res = wait_file(chan, ints, nextmsg, lang);
} else {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec - (tm.tm_sec % 10));
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec - (tm.tm_sec % 10));
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res) {
- snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec % 10);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_sec % 10);
+ res = wait_file(chan, ints, nextmsg, lang);
}
}
if (!res) {
- res = wait_file(chan,ints, "digits/second",lang);
+ res = wait_file(chan, ints, "digits/second", lang);
}
break;
case 'T':
int res;
char fn[256] = "";
- /* ast_debug(1, "\n\n Saying number female %s %d \n\n",lang, num); */
+ /* ast_debug(1, "\n\n Saying number female %s %d \n\n", lang, num); */
if (num < 5) {
snprintf(fn, sizeof(fn), "digits/female-%d", num);
res = wait_file(chan, ints, fn, lang);
-> digits/millions = "ektatomyria"
-> digits/[1..12] :: A pronunciation of th digits form 1 to 12 e.g. "tria"
-> digits/[10..100] :: A pronunciation of the tens from 10 to 90
- e,g 80 = "ogdonta"
+ e.g. 80 = "ogdonta"
Here we must note that we use digits/tens/100 to utter "ekato"
and digits/hundred-100 to utter "ekaton"
-> digits/hundred-[100...1000] :: A pronunciation of hundreds from 100 to 1000 e.g 400 =
and digits/thousnds for "xiliades"
*/
-static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char *ints, const char *language,int audiofd, int ctrlfd)
+static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd)
{
int res = 0;
char fn[256] = "";
snprintf(fn, sizeof(fn), "digits/thousands");
} else {
if (num < 1000000000) { /* 1,000,000,000 */
- res = ast_say_number_full_gr(chan, (num / 1000000), ints, chan->language ,audiofd, ctrlfd);
+ res = ast_say_number_full_gr(chan, (num / 1000000), ints, chan->language, audiofd, ctrlfd);
if (res)
return res;
num %= 1000000;
for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
- res = wait_file(chan,ints,sndfile,lang);
+ res = wait_file(chan, ints, sndfile, lang);
break;
case 'A':
case 'a':
/* Sunday - Saturday */
- snprintf(nextmsg,sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/day-%d", tm.tm_wday);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'B':
case 'b':
case 'h':
/* January - December */
- snprintf(nextmsg,sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
- res = wait_file(chan,ints,nextmsg,lang);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/mon-%d", tm.tm_mon);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'd':
case 'e':
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
else
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
if (beg_today < time) {
/* Today */
- res = wait_file(chan,ints, "digits/today",lang);
+ res = wait_file(chan, ints, "digits/today", lang);
} else if (beg_today - 86400 < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
res = ast_say_date_with_format_gr(chan, time, ints, lang, "AdBY", timezone);
}
/* Today */
} else if ((beg_today - 86400) < time) {
/* Yesterday */
- res = wait_file(chan,ints, "digits/yesterday",lang);
+ res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < time) {
/* Within the last week */
res = ast_say_date_with_format_gr(chan, time, ints, lang, "A", timezone);
case 'S':
/* Seconds */
ast_copy_string(nextmsg, "digits/kai", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
if (!res)
res = ast_say_number_full_gr(chan, tm.tm_sec, ints, lang, -1, -1);
if (!res)
ast_copy_string(nextmsg, "digits/seconds", sizeof(nextmsg));
- res = wait_file(chan,ints,nextmsg,lang);
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'T':
res = ast_say_date_with_format_gr(chan, time, ints, lang, "HMS", timezone);