[Home]

Summary:ASTERISK-05245: [patch] LANGUAGE variable not used in PlayBack/BackGround?
Reporter:Roy Sigurd Karlsbakk (rkarlsba)Labels:
Date Opened:2005-10-05 09:58:45Date Closed:2011-06-07 14:10:19
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20051009__file.diff.txt
( 1) 5391.txt
Description:hi

http://www.voip-info.org/wiki-Asterisk+multi-language states that setting the language with SetLanguage or perhaps Set(LANGUAGE()), multilanguage support should work. however, setting it to 'no' and trying to playback the file nwu/no/velkommen really doesn't work.

   -- Executing BackGround("SIP/006-c0d7", "nwu/velkommen") in new stack
Oct  5 16:56:40 WARNING[5493]: file.c:492 ast_openstream_full: File nwu/velkommen does not exist in any format
Oct  5 16:56:40 WARNING[5493]: file.c:804 ast_streamfile: Unable to open nwu/velkommen (format ulaw): No such file or directory
Oct  5 16:56:40 WARNING[5493]: pbx.c:5590 pbx_builtin_background: ast_streamfile failed on SIP/006-c0d7 for nwu/velkommen
Comments:By: Clod Patry (junky) 2005-10-05 10:03:41

i saw a bug few weeks ago related to that.
which head version?

show me all your dialplan for that extension.

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-10-05 10:13:50

I just tried updating to latest CVS (2005-10-05 17:10 CEST) and the problem persists

dialplan is listed below

exten => 21986970,1,Answer
exten => 21986970,2,SetLanguage(no)
exten => 21986970,3,Set(LANGUAGE()=no)
exten => 21986970,4,Macro(ring,3)
exten => 21986970,5,GotoIfTime(08:00-18:00|mon-fri|*|*?velkommen)
exten => 21986970,6,Background(nwu/aapningstider)
exten => 21986970,7,Hangup
exten => 21986970,8(velkommen),Background(nwu/velkommen)
exten => 21986970,9,Macro(ring,3)
exten => 21986970,10,Macro(queue,nwu,t)

By: Clod Patry (junky) 2005-10-05 11:29:22

You could try that patch.
The problem seems to be the preflang and the filename3 just flipped.

In that way:
exten => 5391,1,Answer();
exten => 5391,2,SetLanguage(no);
exten => 5391,3,Background(nwu/velkommen)

that extension will use the file /var/lib/asterisk/sounds/no/nwu/velkommen.gsm
-----
exten => 5392,1,Set(LANGUAGE()=no);
exten => 5392,2,Playback(vm-message);

and that extension will use /var/lib/asterisk/sounds/no/vm-message.gsm
------

exten => 5393,1,Playback(vm-message);
will use the default language probably /var/lib/asterisk/sounds/vm-message.gsm


So we use the preflang as the root of our sound dir.


Disclaimer on file.

Build on Revision: 1.76

w

By: Clod Patry (junky) 2005-10-05 12:51:18

That patch affects say digits/say number, so isnt good.
i need to finish something before.

By: Clod Patry (junky) 2005-10-06 11:24:20

asterisk:/var/lib/asterisk/sounds/fr# ln -s /var/lib/asterisk/sounds/digits/fr/ digits
asterisk:/var/lib/asterisk/sounds/fr# ll
total 36
-rw-r-----  1 deptaudio deptaudio 4785 Mar 11  2005 agent-pass.gsm
-rw-r-----  1 deptaudio deptaudio 7425 Mar 11  2005 auth-incorrect.gsm
-rw-r-----  1 deptaudio deptaudio 1584 Mar 11  2005 auth-thankyou.gsm
lrwxrwxrwx  1 root      root        35 Oct  6 12:22 digits -> /var/lib/asterisk/sounds/digits/fr/
-rw-r-----  1 deptaudio deptaudio 1584 Mar 11  2005 thank-you.gsm
-rw-r-----  1 deptaudio deptaudio 8382 Mar 11  2005 vm-goodbye.gsm
asterisk:/var/lib/asterisk/sounds/fr#

will solves your problem with this current patch.

By: Tilghman Lesher (tilghman) 2005-10-06 15:59:13

You've got the directories backwards:

The path it is trying to access is:

/var/lib/asterisk/sounds/no/nwu/velkommen

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-10-06 16:22:31

er
the documentation clearly states that the multilingual asterisk should try  $asthomelib/$lang/file

isn't that so?

roy

By: Tilghman Lesher (tilghman) 2005-10-06 22:47:55

asthomelib=/var/lib/asterisk/sounds
lang=no
file=nwu/velkommen

By: Clod Patry (junky) 2005-10-08 17:33:53

RoyK: did you try the patch?
it's gonna stream your file "/var/lib/asterisk/sounds/no/nwu/velkommen.gsm"

By: Kevin P. Fleming (kpfleming) 2005-10-13 19:10:39

The code that constructs those filename has not been changed since 2003; I find it hard to believe that the behavior has changed recently. Do we know that there is actually a problem here, or is this just a misunderstanding (or incorrect documentation)?

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-10-14 03:55:58

well
the patch works for me
how am I supposed to do this without the patch?

By: Tilghman Lesher (tilghman) 2005-10-14 10:26:13

Let's split the difference with my patch.  It'll try both before failing.

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-10-28 05:38:02

it looks like junky's patch breaks SayDigit's multilanguage support

By: Clod Patry (junky) 2005-10-28 08:11:43

see my note from (0034555)

and solution: (0034606).

of course, replace fr by no.

By: Mark Spencer (markster) 2005-10-30 14:36:02.000-0600

This is a configuration issue.  CVS head is working fine.

Consider the following directory tree:

/var/lib/asterisk/sounds/tmp/no/foo.wav
/var/lib/asterisk/sounds/tmp/foo.wav

If you do:

Playback(tmp/foo)

You hear
/var/lib/asterisk/sounds/tmp/foo.wav


Set(LANGUAGE()=no)
Playback(tmp/foo)

You hear
/var/lib/asterisk/sounds/tmp/no/foo.wav