voice-client: Make it possible to set echo cancelling.

Ref: #425
This commit is contained in:
Kent Ekholm 2019-03-27 17:34:31 +01:00
parent 7222f366dd
commit 9573b64759
5 changed files with 40 additions and 2 deletions

View file

@ -59,6 +59,11 @@ ifeq ($(CONFIG_TARGET_intel_mips),y)
-e 's/broadcom/intel/g' \
$(1)/etc/config/voice_client \
$(1)/etc/asterisk_templates/*
sed -i \
-e '/echo_cancel/d' \
-e "/config.*tel_advanced.*TEL/a \ option 'echo_cancel' '1'" \
$(1)/etc/config/voice_client
endif
endef

View file

@ -1854,6 +1854,7 @@ configure_tel()
local dtmfcompatibility
local dialoutmsec
local fac
local echocancel
config_get jbenable TEL jbenable
config_get jbforce TEL jbforce
@ -1862,6 +1863,7 @@ configure_tel()
config_get dtmfmode SIP dtmfmode
config_get dialoutmsec TEL dialoutmsec
config_get fac TEL fac
config_get echocancel TEL echo_cancel
CHANNEL_FAC="$CHANNEL_FAC $fac"
# Convert whitespace to commas
@ -1878,6 +1880,7 @@ configure_tel()
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$(getLineName).tmp
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$(getLineName).tmp
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$(getLineName).tmp
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$(getLineName).tmp
if [ "$dtmfmode" == "compatibility" ] ; then
dtmfcompatibility="1"

View file

@ -2,7 +2,7 @@
# Voice library for Broadcom boards
getChipVendor() {
echo broadcom
echo brcm
}
getChannelName() {
@ -28,3 +28,18 @@ getAllLines() {
getLineIdx() {
echo $1
}
getEchoCancellingValue() {
case $1 in
0)
echo '0'
;;
1)
echo '1'
;;
*)
# Unknown value
echo ''
;;
esac
}

View file

@ -35,3 +35,18 @@ getLineIdx() {
i=$1
echo $((i+1))
}
getEchoCancellingValue() {
case $1 in
0)
echo 'off'
;;
1)
echo 'nlec'
;;
*)
# Unknown value
echo ''
;;
esac
}

View file

@ -67,7 +67,7 @@ case "$1" in
;;
lines)
subchannels=$(asterisk -x "$(getLineName) show status" 2>/dev/null | grep Subchannel | sort -u | wc -l)
subchannels=$(asterisk -x "$(getChipVendor) show status" 2>/dev/null | grep Subchannel | sort -u | wc -l)
[ $subchannels -eq 0 ] && subchannels=2
json_init
json_add_int num_subchannels $subchannels