mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-07 01:41:25 +01:00
Fixes for telephone line naming.
Ref: 345
This commit is contained in:
parent
fd1add50ef
commit
63ca2e0541
1 changed files with 11 additions and 9 deletions
|
|
@ -2068,25 +2068,27 @@ set_line_name()
|
|||
local maxlinenum=$2
|
||||
local curname name_ix ix item lnum
|
||||
local line_name=$(getLineName)
|
||||
local line_name_len=${#line_name}
|
||||
local tel_line=$1
|
||||
|
||||
line=${1:${#line_name}}
|
||||
line=${tel_line:${line_name_len}}
|
||||
|
||||
# delete non-existing lines from config #
|
||||
case $brcm_line in
|
||||
brcm[0-9])
|
||||
lnum=${1:4:1}
|
||||
[ $((lnum+1)) -gt $maxlinenum ] && uci -q delete voice_client.$1
|
||||
case $tel_line in
|
||||
${line_name}[0-9])
|
||||
lnum=${tel_line:${line_name_len}:1}
|
||||
[ $((lnum+1)) -gt $maxlinenum ] && uci -q delete voice_client.$tel_line
|
||||
;;
|
||||
esac
|
||||
#########################################
|
||||
|
||||
config_get curname $brcm_line name
|
||||
config_get curname $tel_line name
|
||||
[ -n "$curname" ] && return
|
||||
|
||||
name_ix=""
|
||||
ix=0
|
||||
for item in $(db get hw.board.VoicePortOrder); do
|
||||
if [ "$item" == "$brcm_line" ]; then
|
||||
if [ "$item" == "$tel_line" ]; then
|
||||
name_ix=$ix
|
||||
break
|
||||
fi
|
||||
|
|
@ -2097,7 +2099,7 @@ set_line_name()
|
|||
if [ -n "$name_ix" ]; then
|
||||
for item in $(db get hw.board.VoicePortNames); do
|
||||
if [ $ix -eq $name_ix ]; then
|
||||
uci_set voice_client $brcm_line name \
|
||||
uci_set voice_client $tel_line name \
|
||||
"$(echo "$item" |tr "[_]" "[ ]")"
|
||||
return
|
||||
fi
|
||||
|
|
@ -2105,7 +2107,7 @@ set_line_name()
|
|||
done
|
||||
fi
|
||||
|
||||
uci_set voice_client $brcm_line name $brcm_line
|
||||
uci_set voice_client $tel_line name $tel_line
|
||||
}
|
||||
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue