[asterisk-bugs] [JIRA] (ASTERISK-17088) [fr] Female gender missing for digit "one" in holdtime announcement

Joshua Colp (JIRA) noreply at issues.asterisk.org
Tue Dec 19 08:00:08 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-17088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua Colp updated ASTERISK-17088:
-----------------------------------

    Assignee:     (was: Clod Patry)

> [fr] Female gender missing for digit "one" in holdtime announcement
> -------------------------------------------------------------------
>
>                 Key: ASTERISK-17088
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-17088
>             Project: Asterisk
>          Issue Type: Bug
>          Components: Applications/app_queue
>    Affects Versions: 13.18.4
>            Reporter: Fossard Florent
>            Severity: Minor
>         Attachments: J17088.diff
>
>
> 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()



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list