[asterisk-bugs] [Asterisk 0018452]: [fr] Female gender missing for digit "one" in holdtime announcement
Asterisk Bug Tracker
noreply at bugs.digium.com
Fri Dec 10 11:04:33 CST 2010
The following issue has been UPDATED.
======================================================================
https://issues.asterisk.org/view.php?id=18452
======================================================================
Reported By: ffossard
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 18452
Category: Applications/app_queue
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Asterisk Version: SVN
JIRA:
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): 1.8
SVN Revision (number only!): 297950
Request Review:
======================================================================
Date Submitted: 2010-12-09 14:00 CST
Last Modified: 2010-12-10 11:04 CST
======================================================================
Summary: [fr] Female gender missing for digit "one" in
holdtime announcement
Description:
There's a problem with the the holdtime announcement in queues, gender is
not changed for languages that need it.
For example, in French, when the average holdtime is 1 minute, we hear "un
minute" (file digits/1) instead of "une minute" (file digits/1F)
Here is the code that reads the holdtime. Note that there's already
commented on the need to manage the gender, but only for position
announcement:
apps/app_queue.c line 2432
static int say_position(struct queue_ent *qe, int ringing)
{
...
res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language,
NULL); /* Needs gender */
...
ast_verb(3, "Hold time for %s is %d minute(s) %d seconds\n",
qe->parent->name, avgholdmins, avgholdsecs);
/* If the hold time is >1 min, if it's enabled, and if it's not
supposed to be only once and we have already said it, say it
*/
if ((avgholdmins+avgholdsecs) > 0 && qe->parent->announceholdtime &&
((qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE &&
!qe->last_pos) ||
!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE))) {
res = play_file(qe->chan, qe->parent->sound_holdtime);
if (res)
goto playout;
if (avgholdmins >= 1) {
res = ast_say_number(qe->chan, avgholdmins,
AST_DIGIT_ANY, qe->chan->language, NULL); /* ========= HERE ========= */
if (res)
goto playout;
if (avgholdmins == 1) {
res = play_file(qe->chan,
qe->parent->sound_minute);
if (res)
goto playout;
} else {
res = play_file(qe->chan,
qe->parent->sound_minutes);
if (res)
goto playout;
}
}
I tried to add "f" to play female song, but that does not work.
res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY,
qe->chan->language, "f");
Yet in the say.c, it's used like that.:
main/say.c line 6402
int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints,
const char *lang)
{
struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
ast_localtime(&when, &tm, NULL);
res = ast_say_number(chan, tm.tm_hour, ints, lang, "f"); /*
========= HERE ========= */
if (!res)
res = ast_streamfile(chan, "digits/oclock", lang);
if (tm.tm_min) {
if (!res)
res = ast_say_number(chan, tm.tm_min, ints, lang, (char *)
NULL);
}
return res;
}
ast_say_number_full_fr function implements the "f" option:
main/say.c line 1132
/*! \brief ast_say_number_full_fr: French syntax
Extra sounds needed:
1F: feminin 'une'
et: 'and' */
static int ast_say_number_full_fr(struct ast_channel *chan, int num, const
char *ints, const char *language, const char *options, int audiofd, int
ctrlfd)
{
int res = 0;
int playh = 0;
int playa = 0;
int mf = 1; /* +1 = male; -1 = female
*/
char fn[256] = "";
if (!num)
return ast_say_digits_full(chan, 0, ints, language,
audiofd, ctrlfd);
if (options && !strncasecmp(options, "f", 1))
mf = -1;
while (!res && (num || playh || playa)) {
if (num < 0) {
ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (playh) {
ast_copy_string(fn, "digits/hundred",
sizeof(fn));
playh = 0;
} else if (playa) {
ast_copy_string(fn, "digits/et", sizeof(fn));
playa = 0;
} else if (num == 1) {
if (mf < 0)
snprintf(fn, sizeof(fn), "digits/%dF",
num);
else
snprintf(fn, sizeof(fn), "digits/%d",
num);
num = 0;
Do you know how to pass the "f" to the ast_say_number function? Is it a
bug ?
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2010-12-10 11:04 tilghman Summary Female gender missing
for digit "one" in holdtime announcement => [fr] Female gender missing for digit
"one" in holdtime announcement
======================================================================
More information about the asterisk-bugs
mailing list