[asterisk-commits] oej: trunk r363517 - /trunk/main/say.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Apr 25 03:39:05 CDT 2012
Author: oej
Date: Wed Apr 25 03:39:01 2012
New Revision: 363517
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363517
Log:
Formatting fixes
Developer guidelines are important.
Modified:
trunk/main/say.c
Modified: trunk/main/say.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/say.c?view=diff&rev=363517&r1=363516&r2=363517
==============================================================================
--- trunk/main/say.c (original)
+++ trunk/main/say.c Wed Apr 25 03:39:01 2012
@@ -423,10 +423,12 @@
static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang)
{
int res;
- if ((res = ast_streamfile(chan, file, lang)))
+ if ((res = ast_streamfile(chan, file, lang))) {
ast_log(LOG_WARNING, "Unable to play message %s\n", file);
- if (!res)
+ }
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
return res;
}
@@ -8047,8 +8049,9 @@
char* s = 0;
const char* remaining = fn;
- if (!num)
+ if (!num) {
return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
+ }
ast_translate_number_ka(num, fn, 512);
@@ -8064,18 +8067,20 @@
/* new_string[len + strlen("digits/")] = '\0'; */
if (!ast_streamfile(chan, new_string, language)) {
- if ((audiofd > -1) && (ctrlfd > -1))
+ if ((audiofd > -1) && (ctrlfd > -1)) {
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
+ } else {
res = ast_waitstream(chan, ints);
+ }
}
ast_stopstream(chan);
ast_free(new_string);
remaining = s + 1; /* position just after the found space char. */
- while (*remaining == ' ') /* skip multiple spaces */
+ while (*remaining == ' ') { /* skip multiple spaces */
remaining++;
+ }
}
@@ -8086,10 +8091,11 @@
sprintf(new_string, "digits/%s", remaining);
if (!ast_streamfile(chan, new_string, language)) {
- if ((audiofd > -1) && (ctrlfd > -1))
+ if ((audiofd > -1) && (ctrlfd > -1)) {
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
+ } else {
res = ast_waitstream(chan, ints);
+ }
}
ast_stopstream(chan);
@@ -8122,14 +8128,16 @@
int res = 0;
ast_localtime(&when, &tm, NULL);
- if (!res)
+ if (!res) {
res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL);
+ }
if (!res) {
snprintf(fn, sizeof(fn), "digits/tslis %d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
if (!res) {
@@ -8142,8 +8150,9 @@
if (!res) {
snprintf(fn, sizeof(fn), "digits/mon-%d", tm.tm_mon);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
return res;
@@ -8165,8 +8174,9 @@
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char*)NULL);
if (!res) {
res = ast_streamfile(chan, "digits/saati_da", lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
if (tm.tm_min) {
@@ -8175,8 +8185,9 @@
if (!res) {
res = ast_streamfile(chan, "digits/tsuti", lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
}
}
@@ -8194,8 +8205,9 @@
ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
- if (!res)
+ if (!res) {
ast_say_time(chan, t, ints, lang);
+ }
return res;
}
@@ -8218,13 +8230,15 @@
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
/* Day of month and month */
- if (!res)
+ if (!res) {
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char *) NULL);
+ }
if (!res) {
snprintf(fn, sizeof(fn), "digits/mon-%d", tm.tm_mon);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
} else if (daydiff) {
@@ -8232,12 +8246,14 @@
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
} /* Otherwise, it was today */
- if (!res)
+ if (!res) {
res = ast_say_time(chan, t, ints, lang);
+ }
return res;
}
More information about the asterisk-commits
mailing list