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 func language
- Asterisk sip language parameter in sip.conf
- Asterisk multi-language: How to set up a multi-language version of Asterisk
- Asterisk sound files international
- Asterisk config indications.conf: Configuration of language/country-specific tones
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ