The sounds files that come with a2billing right out of the box cannot be always properly found by asterisk. That is because asterisk expects sound files to be arranged in a different manner as stated below.
Quote:
Place the voice prompts into a directory structure as follows (usually within /var/lib/asterisk/:
* sounds/xx
* sounds/digits/xx
* sounds/letters/xx
* sounds/phonetic/xx
where xx is the two letter ISO code of the language in question (nl, fr, de, it, pt, es ...)
(NOTE: The structure for 1.4 is different but it requires a configuration change)
The configuration change (if applicable) is located in /etc/asterisk/asterisk.conf. Unfortunately, it seems to work erratically. I couldn't make it work myself. The setting name is:
Code:
languageprefix = yes ; Use the new sound prefix path syntax
This seems to be a new feature introduced in some Asterisk 1.4. Good luck with it.
I have found out that creating language folders in inside each asterisk folder works better all the time.
Here is the script that I have mentioned earlier and it should find any sound files arranged in the A2Billing Style and move them around using Asterisk Default Style. It was not meant to be a beautiful script and the end result was the only goal here.
Code:
#!/bin/bash
lang=fr
ast_sound=/var/lib/asterisk/sounds
echo Fixing the lang "$lang"
echo ...
echo creating relevant folders
echo mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/digits/$lang
mkdir $ast_sound/followme/$lang
mkdir $ast_sound/letters/$lang
mkdir $ast_sound/phonetic/$lang
mkdir $ast_sound/silence/$lang
echo Moving $lang files in the right folder ...
mv $ast_sound/$lang/dictate/* $ast_sound/dictate/$lang
mv $ast_sound/$lang/digits/* $ast_sound/digits/$lang
mv $ast_sound/$lang/followme/* $ast_sound/followme/$lang
mv $ast_sound/$lang/letters/* $ast_sound/letters/$lang
mv $ast_sound/$lang/phonetic/* $ast_sound/phonetic/$lang
mv $ast_sound/$lang/silence/* $ast_sound/silence/$lang
#rm -rf $lang/dictate/ $lang/digits/ $lang/followme/ $lang/letters/ $lang/phonetic/ $lang/silence/
lang=es
ast_sound=/var/lib/asterisk/sounds
echo Fixing the lang "$lang"
echo ...
echo creating relevant folders
echo mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/digits/$lang
mkdir $ast_sound/followme/$lang
mkdir $ast_sound/letters/$lang
mkdir $ast_sound/phonetic/$lang
mkdir $ast_sound/silence/$lang
echo Moving $lang files in the right folder ...
mv $ast_sound/$lang/dictate/* $ast_sound/dictate/$lang
mv $ast_sound/$lang/digits/* $ast_sound/digits/$lang
mv $ast_sound/$lang/followme/* $ast_sound/followme/$lang
mv $ast_sound/$lang/letters/* $ast_sound/letters/$lang
mv $ast_sound/$lang/phonetic/* $ast_sound/phonetic/$lang
mv $ast_sound/$lang/silence/* $ast_sound/silence/$lang
#rm -rf $lang/dictate/ $lang/digits/ $lang/followme/ $lang/letters/ $lang/phonetic/ $lang/silence/
lang=en
ast_sound=/var/lib/asterisk/sounds
echo Fixing the lang "$lang"
echo ...
echo Moving $lang files in the right folder ...
mv $ast_sound/$lang/dictate/* $ast_sound/dictate/
mv $ast_sound/$lang/digits/* $ast_sound/digits/
mv $ast_sound/$lang/followme/* $ast_sound/followme
mv $ast_sound/$lang/letters/* $ast_sound/letters/
mv $ast_sound/$lang/phonetic/* $ast_sound/phonetic/
mv $ast_sound/$lang/silence/* $ast_sound/silence/
#rm -rf $lang/dictate/ $lang/digits/ $lang/followme/ $lang/letters/ $lang/phonetic/ $lang/silence/
Copy this code and paste it in a file called for instance: /var/lib/asterisk/sounds/fix_a2b_sounds
Then do the following (remove the # from the #rm ... lines if you wish to delete the old folders after moving the files):
Code:
cd /var/lib/asterisk/sounds/
chmod +x fix_a2b_sounds
./fix_a2b_sounds
Don't worry about the warning if some files have not been found. After running the file, everything should run smoothly.
Please note that this requires that you already have the a2billing sound files copied **as is** in the Asterisk sound folder.
You will notice that I have not includes the br language. That is because I am convinced that br **does not stand for Brazilian**. It stands for Breton language and Brazilians speak Portuguese (pt) instead. If you need to support BR, then add this at the end of the file:
Code:
lang=br
ast_sound=/var/lib/asterisk/sounds
echo Fixing the lang "$lang"
echo ...
echo creating relevant folders
echo mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/dictate/$lang
mkdir $ast_sound/digits/$lang
mkdir $ast_sound/followme/$lang
mkdir $ast_sound/letters/$lang
mkdir $ast_sound/phonetic/$lang
mkdir $ast_sound/silence/$lang
echo Moving $lang files in the right folder ...
mv $ast_sound/$lang/dictate/* $ast_sound/dictate/$lang
mv $ast_sound/$lang/digits/* $ast_sound/digits/$lang
mv $ast_sound/$lang/followme/* $ast_sound/followme/$lang
mv $ast_sound/$lang/letters/* $ast_sound/letters/$lang
mv $ast_sound/$lang/phonetic/* $ast_sound/phonetic/$lang
mv $ast_sound/$lang/silence/* $ast_sound/silence/$lang
#rm -rf $lang/dictate/ $lang/digits/ $lang/followme/ $lang/letters/ $lang/phonetic/ $lang/silence/
Good luck