login | register
Tue 02 of Dec, 2008 [12:36 UTC]

voip-info.org

Discuss [2] History

Asterisk cmd SetLanguage

Created by: oej,Last modification on Tue 10 of Jun, 2008 [11:36 UTC] by JustRumours

Synopsis:

 Sets user language

Description:

 SetLanguage(language)

Set the channel language to 'language'. This information is used for the generation of numbers, and to select a natural language file when available.
For example, if language is set to 'fr' and the file 'demo-congrats' is requested to be played, if the file 'fr/demo-congrats' exists, then it will play that file, and if not will play the normal 'demo-congrats'.

New Language syntax for Asterisk v1.2

The SetLanguage() command has been deprecated in favour of

 Set(LANGUAGE()=language)

(make sure you don't insert any blanks othewise the console will report that it changed the language, but the default language will still be played)


The LANGUAGE function can also return the currently set language:

Set(MYLANG=${LANGUAGE()}) 

In an AGI script in asterisk 1.2+ you can do the following:

SET VARIABLE LANGUAGE() fr

That'll change it to french.


New Language syntax for Asterisk v1.4

The LANGUAGE() function that was introduced in Asterisk 1.2 has been deprecated in 1.4 (and removed in 1.6) in favour of

Set(CHANNEL(language)=<lang>)

Example:
Set(CHANNEL(language)=hu)


See also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Comments

Comments Filter
222

333Default internal SIP phone language

by obrousseau, Tuesday 13 of May, 2008 [17:43:09 UTC]
With Trixbox 2.6.0.7 running Asterisk 1.4.9.2

I had to add line "language=fr" under /etc/asterisk/sip_general_custom.conf to turn all internal SIP phone call to french between users and between users and PBX functions.

Also turned "language=fr" in /etc/asterisk/zapata.conf to get all POTS call turned to french by default.
222

333

by grin, Thursday 15 of June, 2006 [20:09:42 UTC]
This information is used for the generation of numbers,
How? How to set number syntax for whateverlanguage? Like saying 'digits/20and' 'digits/2' instead of 'digits/20 'digits/2' ...