[asterisk-dev] Sound path

Kevin P. Fleming kpfleming at digium.com
Tue Nov 3 07:16:34 CST 2009


Philip A. Prindeville wrote:
> I was wondering if it would make sense to allow Asterisk to be 
> configured to have a $PATH-like functionality to locate sound files, so 
> that it would search in multiple places until it found a match.

It already does.

> We could use this to allow looking-aside for custom-sounds, alternate 
> languages for bi- or tri-lingual regions (think Switzerland, Belgium, 
> and Canada)... or even putting a custom-sounds directory first so that 
> the contents of "stock" sound files could be overridden with locally 
> produced content.

This is already possible. The channel's LANGUAGE code is split, piece by
piece (separated by underscores), and used to build paths to look for
files. The first file found is used.

This means that, for example, LANGUAGE can be set to en_GB_female_BT,
which would search for files in:

.../sounds/en/GB/female/BT
.../sounds/en/GB/female
.../sounds/en/GB
.../sounds/en
.../sounds

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list