diff options
-rw-r--r-- | apps/app_queue.c | 1 | ||||
-rw-r--r-- | main/say.c | 88 |
2 files changed, 43 insertions, 46 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 159bdda65..36f9c4b27 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2079,6 +2079,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte break; /* On "ringall" strategy we only move to the next penalty level when *all* ringing phones are done in the current penalty level */ + ast_log(LOG_DEBUG, "I actually hit this...\n"); ring_one(qe, outgoing, &numbusies); /* and retry... */ } diff --git a/main/say.c b/main/say.c index 336b7f5f5..ede9e98da 100644 --- a/main/say.c +++ b/main/say.c @@ -468,7 +468,7 @@ static int ast_say_number_full_en(struct ast_channel *chan, int num, const char if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && (num || playh)) { + while (!res && (num || playh)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -512,7 +512,7 @@ static int ast_say_number_full_en(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -570,7 +570,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && (num || playh)) { + while (!res && (num || playh)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -634,7 +634,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char num -= left * (exp10_int(length-1)); } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) { res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); } else { @@ -663,7 +663,7 @@ static int ast_say_number_full_da(struct ast_channel *chan, int num, const char if (options && !strncasecmp(options, "n",1)) cn = -1; - while(!res && (num || playh || playa )) { + while (!res && (num || playh || playa )) { /* The grammar for Danish numbers is the same as for English except * for the following: * - 1 exists in both commune ("en", file "1N") and neuter ("et", file "1") @@ -743,7 +743,7 @@ static int ast_say_number_full_da(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -776,7 +776,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char if (options && (!strncasecmp(options, "f",1))) mf = -1; - while(!res && num) { + while (!res && num) { /* The grammar for German numbers is the same as for English except * for the following: * - numbers 20 through 99 are said in reverse order, i.e. 21 is @@ -873,7 +873,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char res = -1; } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -908,7 +908,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && (num || playh || playa )) { + while (!res && (num || playh || playa )) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -959,7 +959,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1063,7 +1063,7 @@ static int ast_say_number_full_es(struct ast_channel *chan, int num, const char } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1094,7 +1094,7 @@ static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char if (options && !strncasecmp(options, "f",1)) mf = -1; - while(!res && (num || playh || playa)) { + while (!res && (num || playh || playa)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -1155,7 +1155,7 @@ static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char res = -1; } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1233,7 +1233,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num, mf = -1; /* Do we have work to do? */ - while(!res && (num || (state>0) )) { + while (!res && (num || (state>0) )) { /* first type of work: play a second sound. In this loop * we can only play one sound file at a time. Thus playing * a second one requires repeating the loop just for the @@ -1304,7 +1304,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num, res = -1; } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1351,7 +1351,7 @@ static int ast_say_number_full_it(struct ast_channel *chan, int num, const char So the right file is provided. */ - while(!res && (num || playh)) { + while (!res && (num || playh)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -1457,7 +1457,7 @@ static int ast_say_number_full_it(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1548,7 +1548,7 @@ static int ast_say_number_full_nl(struct ast_channel *chan, int num, const char } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1577,7 +1577,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char if (options && !strncasecmp(options, "n",1)) cn = -1; - while(!res && (num || playh || playa )) { + while (!res && (num || playh || playa )) { /* The grammar for Norwegian numbers is the same as for English except * for the following: * - 1 exists in both commune ("en", file "1") and neuter ("ett", file "1N") @@ -1640,7 +1640,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -1964,7 +1964,7 @@ static int ast_say_number_full_pt(struct ast_channel *chan, int num, const char if (options && !strncasecmp(options, "f",1)) mf = -1; - while(!res && num ) { + while (!res && num ) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -2057,7 +2057,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); if (options && !strncasecmp(options, "n",1)) cn = -1; - while(!res && (num || playh)) { + while (!res && (num || playh)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -2106,7 +2106,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -2127,7 +2127,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && (num || playh)) { + while (!res && (num || playh)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -2171,7 +2171,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -2219,7 +2219,7 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && (num)) { + while (!res && (num)) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); if ( num > INT_MIN ) { @@ -2228,7 +2228,7 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char num = 0; } } else if (num < 20) { - if(options && strlen(options) == 1 && num < 3) { + if (options && strlen(options) == 1 && num < 3) { snprintf(fn, sizeof(fn), "digits/%d%s", num, options); } else { snprintf(fn, sizeof(fn), "digits/%d", num); @@ -2313,7 +2313,7 @@ static int ast_say_enumeration_full_en(struct ast_channel *chan, int num, const int res = 0, t = 0; char fn[256] = ""; - while(!res && num) { + while (!res && num) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */ if ( num > INT_MIN ) { @@ -2424,7 +2424,7 @@ static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && num) { + while (!res && num) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */ if ( num > INT_MIN ) { @@ -2587,7 +2587,7 @@ static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const if (!num) return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd); - while(!res && num) { + while (!res && num) { if (num < 0) { snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */ if ( num > INT_MIN ) { @@ -4908,7 +4908,7 @@ int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const cha char sndfile[256], nextmsg[256]; if (format == NULL) - format = "Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/at' IMp"; + format = "Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp"; ast_localtime(&time,&tm,timezone); @@ -4979,8 +4979,6 @@ int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const cha } if (!res) res = ast_say_number(chan, (tm.tm_hour % 12), ints, lang, "f"); - if ((!res) && (format[offset] == 'I')) - res = ast_say_date_with_format(chan, time, ints, lang, "P", timezone); } } else { if (tm.tm_hour == 0) { @@ -5052,10 +5050,9 @@ int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const cha res = wait_file(chan, ints, "digits/pt-hora", lang); if (tm.tm_hour != 1) if (!res) - res = wait_file(chan, ints, "digits/pt-sss", lang); } else { - res = wait_file(chan,ints,"digits/pt-e",lang); - if (!res) - res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL); + res = wait_file(chan, ints, "digits/pt-sss", lang); + } else { + res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL); } } break; @@ -5240,12 +5237,12 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha } else { snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday - (tm.tm_mday % 10)); res = wait_file(chan,ints,nextmsg,lang); - if(!res) { + if (!res) { 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 */ @@ -6207,7 +6204,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char return ast_waitstream(chan, ints); } - while(!res && num ) { + while (!res && num ) { i++; if (num < 13) { snprintf(fn, sizeof(fn), "digits/%d", num); @@ -6220,15 +6217,14 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char /* 100 < num < 200 */ snprintf(fn, sizeof(fn), "digits/hundred-100"); num -= ((num / 100) * 100); - }else if (num < 1000) { + } else if (num < 1000) { /* 200 < num < 1000 */ snprintf(fn, sizeof(fn), "digits/hundred-%d", (num/100)*100); num -= ((num / 100) * 100); - }else if (num < 2000){ + } else if (num < 2000){ snprintf(fn, sizeof(fn), "digits/xilia"); num -= ((num / 1000) * 1000); - } - else { + } else { /* num > 1000 */ if (num < 1000000) { res = ast_say_number_full_gr(chan, (num / 1000), ints, chan->language, audiofd, ctrlfd); @@ -6250,7 +6246,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char } } if (!res) { - if(!ast_streamfile(chan, fn, language)) { + if (!ast_streamfile(chan, fn, language)) { if ((audiofd > -1) && (ctrlfd > -1)) res = ast_waitstream_full(chan, ints, audiofd, ctrlfd); else @@ -6773,7 +6769,7 @@ static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char free(new_string); remainder = s + 1; /* position just after the found space char. */ - while(*remainder == ' ') /* skip multiple spaces */ + while (*remainder == ' ') /* skip multiple spaces */ remainder++; } |