[asterisk-bugs] [Asterisk 0015022]: Language handling for numbers, dates, etc is misbehaving when utilizing sub-regional languages

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 8 09:03:54 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=15022 
====================================================================== 
Reported By:                greenfieldtech
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15022
Category:                   Applications/General
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-05-03 10:50 CDT
Last Modified:              2009-05-08 09:03 CDT
====================================================================== 
Summary:                    Language handling for numbers, dates, etc is
misbehaving when utilizing sub-regional languages
Description: 
Per a discussion at Asterisk Euro DevCon, an issue was raised when a
language is defined as "language_variant" format, for example, "fr_ca"
(Candian French). 

According to KPF and russelb, Asterisk is supposed to play files from the
/var/lib/asterisk/sounds/[LANG_DIRECTORY] and
/var/lib/asterisk/sounds/digits/[LANG_DIRECTORY], while at the same time,
while playing the numbers, utilizing the logic intended for the "language"
identified. However, after testing the edge case, we've discovered that
Asterisk will default to the English grammer, thus, playing the entire
grammer wrong.
====================================================================== 

---------------------------------------------------------------------- 
 (0104453) tzafrir (manager) - 2009-05-08 09:03
 http://bugs.digium.com/view.php?id=15022#c104453 
---------------------------------------------------------------------- 
No need for extra sound files to reproduce this. When verbose enough,
Asterisk will show us what it wants to play.

sweetmorn*CLI> dialplan show custom-saytest
[ Context 'custom-saytest' created by 'pbx_config' ]
  '_X.' =>          1. Answer()                                  
[pbx_config]
                    2. wait(1)                                   
[pbx_config]
                    3. Set(CHANNEL(language)=he)                 
[pbx_config]
                    4. SayNumber(${EXTEN})                       
[pbx_config]
                    5. Set(CHANNEL(language)=he_jr)              
[pbx_config]
                    6. SayNumber(${EXTEN})                       
[pbx_config]

(Same as above, except using the given extension number)



sweetmorn*CLI> core set verbose 3
Verbosity is at least 3
sweetmorn*CLI> channel originate Local/201 at custom-saytest application
Echo
    -- Executing [201 at custom-saytest:1]
Answer("Local/201 at custom-saytest-e55b;2", "") in new stack
    -- Launching Echo() on Local/201 at custom-saytest-e55b;1
    -- Executing [201 at custom-saytest:2]
Wait("Local/201 at custom-saytest-e55b;2", "1") in new stack
    -- Executing [201 at custom-saytest:3]
Set("Local/201 at custom-saytest-e55b;2", "CHANNEL(language)=he") in new
stack
    -- Executing [201 at custom-saytest:4]
SayNumber("Local/201 at custom-saytest-e55b;2", "201") in new stack
    -- ast_say_digits_full: started. num: 201, options="(null)"
    -- ast_say_digits_full: num: 201, state=0, options="(null)", mf=-1
    -- ast_say_digits_full: num: 201, state=0, options="(null)", mf=-1,
tmpnum=0
[May  8 17:00:23] WARNING[30356]: file.c:641 ast_openstream_full: File
digits/200 does not exist in any format
[May  8 17:00:23] WARNING[30356]: file.c:924 ast_streamfile: Unable to
open digits/200 (format 0x40 (slin)): No such file or directory
    -- ast_say_digits_full: num: 1, state=2, options="(null)", mf=-1,
tmpnum=0
[May  8 17:00:23] WARNING[30356]: file.c:641 ast_openstream_full: File
digits/ve does not exist in any format
[May  8 17:00:23] WARNING[30356]: file.c:924 ast_streamfile: Unable to
open digits/ve (format 0x40 (slin)): No such file or directory
    -- ast_say_digits_full: num: 1, state=0, options="(null)", mf=-1,
tmpnum=0
    -- <Local/201 at custom-saytest-e55b;2> Playing 'digits/1.gsm' (language
'he')
    -- Executing [201 at custom-saytest:5]
Set("Local/201 at custom-saytest-e55b;2", "CHANNEL(language)=he_jr") in new
stack
    -- Executing [201 at custom-saytest:6]
SayNumber("Local/201 at custom-saytest-e55b;2", "201") in new stack
    -- <Local/201 at custom-saytest-e55b;2> Playing 'digits/2.gsm' (language
'he_jr')
    -- <Local/201 at custom-saytest-e55b;2> Playing 'digits/hundred.gsm'
(language 'he_jr')
    -- <Local/201 at custom-saytest-e55b;2> Playing 'digits/1.gsm' (language
'he_jr')
    -- Auto fallthrough, channel 'Local/201 at custom-saytest-e55b;2' status
is 'UNKNOWN'


As we can see, for the language 'he', 201 is:

  200
  1

This is because Hebrew has a word for 200 (??????).

For the language 'he_jr, however, we get:

  2
  houndred
  1

which is from the original English saynumber function. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-08 09:03 tzafrir        Note Added: 0104453                          
======================================================================




More information about the asterisk-bugs mailing list