[Home]

Summary:ASTERISK-17088: [fr] Female gender missing for digit "one" in holdtime announcement
Reporter:Fossard Florent (ffossard)Labels:
Date Opened:2010-12-09 14:00:29.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Applications/app_queue
Versions:13.18.4 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) J17088.diff
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 ?




****** ADDITIONAL INFORMATION ******

-- Stopped music on hold on IAX2/zoiper-241
-- Hold time for test is 1 minute(s) 0 seconds
-- <IAX2/zoiper-241> Playing 'queue-holdtime.alaw' (language 'fr')
-- <IAX2/zoiper-241> Playing 'digits/1.alaw' (language 'fr')    /* ========= not "digits/1F" ========= */
-- <IAX2/zoiper-241> Playing 'queue-minute.alaw' (language 'fr')
-- Told IAX2/zoiper-241 in test their queue position (which was 1)
-- <IAX2/zoiper-241> Playing 'queue-thankyou.alaw' (language 'fr')
-- Started music on hold, class 'default', on IAX2/zoiper-241



queues.conf
[general]
persistentmembers = yes

[test]
announce-frequency = 30
announce-holdtime = yes
announce-position = no
joinempty = yes
member => SIP/user



extensions.conf
[general]
language=fr

[globals]

[interne]
exten => 1,1,Set(CHANNEL(language)=fr)
same =>    n,queue(test)
same =>    n,hangup()
Comments:By: Clod Patry (junky) 2011-09-26 20:50:04.319-0500

By looking at this bug, I realized the file digits/1F was missing in the core-sounds-fr.

Good catch.

Stay tuned for the fix here.

By: Clod Patry (junky) 2011-09-27 21:00:58.571-0500

By adding "f", it works. However, i cant pass an hardcoded options "f" to all language, since some languages are using an f:
de, es, pt, da.

By using that patch, you will hear digits/1F instead of digits/1.

Let me know how it works for ya.

By: Leif Madsen (lmadsen) 2011-11-01 09:07:56.391-0500

Assigned to reporter to test patch.

By: Leif Madsen (lmadsen) 2011-11-21 14:14:26.428-0600

If you think this is right, can you just commit this change Clod? If not, perhaps get a review first.

By: Clod Patry (junky) 2011-11-21 22:13:35.512-0600

There's a missing prompt in the core-sounds-fr.
I think before commit this change will be to get it recorded by June.

By: Fossard Florent (ffossard) 2011-11-22 13:11:01.307-0600

sorry, no time to test now :(