Asterisk multi-language
Page Contents
Setting up a Multi-Language Asterisk Installation
Many Asterisk Dialplan commands cause Asterisk to play sound files from the /var/lib/asterisk/sounds directory structure. Many of these sounds are recordings of phrases and sentences such as, "Please hold while I try that extension." Asterisk supports the automatic selection of different language editions of these sound files.
When Asterisk looks for a particular sound file, such as transfer.gsm, it will first look in a subdirectory corresponding with the currently selected language. For example, if the currently selected language "de", the Asterisk will first look for the file /var/lib/asterisk/sounds/de/transfer.gsm. If this file or the "de" directory does not exist, then Asterisk will look for the file /var/lib/asterisk/sounds/transfer.gsm, which is usually an English-language default recording.
If an Asterisk command specifies a sound file in a subdirectory, Asterisk looks in that subdirectory for the language subdirectory. For example, the SayDigits command may play the sound file "digits/6". Asterisk will, if the language code is "de", first look for /var/lib/asterisk/sounds/digits/de/6.gsm before falling back to /var/lib/asterisk/sounds/digits/6.gsm.
Setting the Language
The default language for a particular channel is set in that channel's configuration file. Look for a setting like:language=en
in the [general] section.
You may specify any text (up to 20 characters long) as the language code. When playing sounds from the /var/lib/asterisk/sounds directory, Asterisk will look for a subdirectory with the same name as the currently selected language.
You can override the channel's default language using the SetLanguage command in your Dialplan. You may use the ${LANGUAGE} channel variable to discover what the currently selected language code is.
(:exclaim:) The language code specified in the channel configuration files and using the SetLanguage command is quite separate from the country code specified in the indications.conf file used to select country-specific tones (dialtone, ring tone, busy tone etc) by the Playtones command.
Dialplan Commands
The Dialplan Commands that use the multi-language feature of Asterisk include:- Authenticate: Authenticate a user
- Playback: Play a sound file
- ControlPlayback: Play a sound file with fast forward, rewind and exit controls
- Background: Play a sound file while executing other commands
- MeetMeCount: Say the number of participants in a specified conference
- MeetMe: Says something at the beginning and with the 'admin' mode set
- MeetMeAdmin: Says something at the beginning
- SayUnixTime: Say the date and/or time
- SayAlpha: Say the name of a letter of the alphabet
- SayDigits: Say the name of a digit (0 to 9)
- SayNumber: Say a number ("one hundred and twenty two")
- SayPhonetic: Say the "Alpha Bravo Charlie" names of letters
- VMAuthenticate: Authenticate with Voicemail passwords
- Voicemail: Leave a voicemail message
- VoicemailMain: Access voicemail messages
Tip
This "language selection" feature does not have to be restricted just to making different language files. You could, for example, choose to have your voice prompts recorded by a male speaker and a female speaker. A channel configuration file might set:language=female
and you could override that with a call to SetLanguage(male). If you requested Asterisk to play the 'transfer' sound file, then Asterisk will look in /var/lib/asterisk/sounds/male/transfer.gsm directory, and if not found, revert to the default /var/lib/asterisk/sounds/transfer.gsm.
See also
- Asterisk chinese voicemail intro: Speak Intro voice with chinese usage
- Asterisk sound files international
- SetLanguage
- beroNet Technologies: They have an alternative SayNumber command with International support in a .cfg file.
- Asterisk International
Asterisk | Configuration

Comments