System information
The default directory used is /var/lib/asterisk/sounds/en, so how do you change that?
There are two ways. One is to set the language in the channel configuration file that
calls are arriving through using the language directive. For example, the line:
language=en_UK
placed in chan_dahdi.conf, sip.conf, and so on (to apply generally, or for just a given
channel or profile) will tell Asterisk to use sound files found in /var/lib/asterisk/sounds/
en_UK (which could contain British-accented prompts) for all calls that come in
through those channels.
The other way is to change the language during a phone call through the dialplan. This
(along with many attributes of an individual call) can be set using the CHANNEL() dialplan
function. See Chapter 10 for a full treatment of dialplan functions.
The following example would allow the caller to choose one of three languages in which
to continue the call:
; gives the choice of (1) French, (2) Spanish, or (3) German
exten => s,1,Background(choose-language)
same => n,WaitExten(5)
exten => 1,1,Set(CHANNEL(language)=fr)
exten => 2,1,Set(CHANNEL(language)=es)
exten => 3,1,Set(CHANNEL(language)=de)
; the next priority for extensions 1, 2, or 3 would be handled here
exten => _[123],n,Goto(menu,s,1)
If the caller pressed 1 sounds would be played from /var/lib/asterisk/sounds/fr, if he
pressed 2 the sounds would come from /var/lib/asterisk/sounds/es, and so on.
As already mentioned, the names of these directories are arbitrary and do not need to
be only two characters long—the main thing is that you match the name of the sub-
directory you have created in the language directive in the channel configuration, or
when you set the CHANNEL(language) argument in the dialplan.
Time/Date Stamps and Pronunciation
Asterisk uses the Linux system time from the host server, as you would expect, but we
may have users of the system who are in different time zones, or even in different coun-
tries. Voicemail is where the rubber hits the road, as this is where users come into
contact with time/date stamp information.
Consider a scenario where some users of the system are based in the US, while others
are in the UK.
As well as the time difference, another thing to consider is the way people in the two
locations are used to hearing date and time information—in the US, dates are usually
Asterisk | 191