Support voicegeneral 'format' section as list
This commit is contained in:
parent
9bc7c1dded
commit
333458f06c
1 changed files with 13 additions and 6 deletions
|
@ -12,7 +12,7 @@ init_voicemailconf() {
|
||||||
ast_enable_type voicezone
|
ast_enable_type voicezone
|
||||||
ast_enable_type dialplanvoice
|
ast_enable_type dialplanvoice
|
||||||
|
|
||||||
voice_format="wav49|gsm|wav"
|
voice_format=
|
||||||
voice_serveremail=
|
voice_serveremail=
|
||||||
voice_attach=no
|
voice_attach=no
|
||||||
voice_skipms=3000
|
voice_skipms=3000
|
||||||
|
@ -94,6 +94,8 @@ create_voicemailconf() {
|
||||||
local isempty=2
|
local isempty=2
|
||||||
rm -f $file
|
rm -f $file
|
||||||
else
|
else
|
||||||
|
|
||||||
|
[ -z "${voice_format}" ] && voice_format="wav49|gsm|wav"
|
||||||
echo "${asteriskuci_gen}[general]" > $file
|
echo "${asteriskuci_gen}[general]" > $file
|
||||||
for i in ${voicegeneral_list} ; do
|
for i in ${voicegeneral_list} ; do
|
||||||
eval value=\${voice_$i}
|
eval value=\${voice_$i}
|
||||||
|
@ -117,11 +119,16 @@ create_voicemailconf() {
|
||||||
|
|
||||||
handle_voicegeneral() {
|
handle_voicegeneral() {
|
||||||
option_cb() {
|
option_cb() {
|
||||||
|
case "$1" in
|
||||||
|
format|format_ITEM*) append voice_format "$2" "|" ;;
|
||||||
|
format_LENGTH) ;;
|
||||||
|
*)
|
||||||
if valid_voicemail $1 $2 ; then
|
if valid_voicemail $1 $2 ; then
|
||||||
eval voice_$1="$2"
|
eval voice_$1="$2"
|
||||||
else
|
else
|
||||||
logerror "Invalid general voice option: $1"
|
logerror "Invalid general voice option: $1"
|
||||||
fi
|
fi
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue