[asterisk-bugs] [Asterisk 0012379]: Changes in #0012115 break Voicemail multi-language capability

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Apr 8 13:44:52 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12379 
====================================================================== 
Reported By:                kuj
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12379
Category:                   Core-General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.19 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-07-2008 17:08 CDT
Last Modified:              04-08-2008 13:44 CDT
====================================================================== 
Summary:                    Changes in
http://bugs.digium.com/view.php?id=0012115 break Voicemail multi-language
capability
Description: 
Voicemail will not play user-recorded alternate-language greetings any
longer with the changes introduced to function fileexists_core (file.c) in
the fixes for http://bugs.digium.com/view.php?id=0012115. Fileexists_core now
sports a check for absolute
pathname upfront and will return those absolute pathnames without adding a
language specific (sub-) directory. Consequently, VM greetings (greet, busy
and unavail) cannot switch from the default language to a secondary
language.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0012115 MoH file playback is broken
has duplicate       0012383 Background() application ignores the ch...
====================================================================== 

---------------------------------------------------------------------- 
 kuj - 04-08-08 13:44  
---------------------------------------------------------------------- 
Looking at the code again and playing with the languageprefix=yes option, I
do not think that the test for an absolute pathname that was added to
fileexists_core() is essential to fix the issues in
http://bugs.digium.com/view.php?id=0012115. Rather, it
looks like the intent of the absolute path test was to optimize the
function to not "waste cycles" when the combination of absolute path and
languageprefix=yes resulted in a new path that wasn't "well defined".

With languageprefix=yes, an absolute path and the test for absolute path
removed from fileexists_core(), the function will still find the valid
filenames. It just wastes some cycles on also looking for "not well
defined" files. I.e. for a MoH music title, it looks for 

   de/var/lib/asterisk/moh/title
   /var/lib/asterisk/moh/title

and will successfully play the latter. I call the first filename "not well
defined" as we don't know which base directory it is relative to. So the
real issue is the implementation of languageprefix=yes in conjunction with
absolute paths. My suggestion would be to

 - re-enable language specific content by removing the absolute path test
from fileexists_core(), and
 - modify fileexists_test() so it tests for an absolute language-specific
filename/path, but only when the filename argument is absolute to begin
with.

In other words, with my MoH example from above, modify fileexists_test so
it checks "/de/var/lib/asterisk/moh/title" instead of "de/var/lib/.....".
That would for the first time create "defined behavior" for prefix mode and
absolute paths. fileexists_test would look somewhat like:

        if (ast_language_is_prefix) { /* new layout */
                if (lang) {
                   if (is_absolute_path(filename)){
                        snprintf(buf, buflen, "/%s/%s", lang, filename);
                   } else {
                        snprintf(buf, buflen, "%s/%s", lang, filename);
                   }
                } else {
                        snprintf(buf, buflen, "%s", filename);
                }
        } else { /* old layout */ ... 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-08-08 13:44  kuj            Note Added: 0085146                          
======================================================================




More information about the asterisk-bugs mailing list