Compare commits

...

2 Commits
qcom ... vcl

Author SHA1 Message Date
Sukru Senli
145016ea2e voice-client: make line indexing platform independent 2019-06-05 13:47:18 +02:00
Sukru Senli
6bad18a68d voice-client: update default config 2019-06-05 13:46:43 +02:00
2 changed files with 173 additions and 222 deletions

View File

@@ -1,138 +1,138 @@
config 'tel_line' 'brcm0'
option 'extension' '0000'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm0'
option extension '0000'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
option sip_account 'sip0'
config 'tel_line' 'brcm1'
option 'extension' '1111'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm1'
option extension '1111'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
option sip_account 'sip0'
config 'tel_line' 'brcm2'
option 'extension' '2222'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm2'
option extension '2222'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'tel_line' 'brcm3'
option 'extension' '3333'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm3'
option extension '3333'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'tel_line' 'brcm4'
option 'extension' '4444'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm4'
option extension '4444'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'tel_line' 'brcm5'
option 'extension' '5555'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm5'
option extension '5555'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'tel_line' 'brcm6'
option 'extension' '6666'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm6'
option extension '6666'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'tel_line' 'brcm7'
option 'extension' '7777'
option 'sip_account' 'sip0'
option 'noise' '0'
option 'vad' '0'
option 'txgain' 4
option 'rxgain' 4
option 'echo_cancel' 1
option 'callwaiting' '0'
option 'clir' '0'
config tel_line 'brcm7'
option extension '7777'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option callwaiting '0'
option clir '0'
config 'dialplan' 'custom_dialplan'
option 'custom_outgoing_enabled' '0'
option 'custom_incoming_enabled' '0'
option 'custom_hangup_enabled' '0'
option 'all_ports_extension' '#123456'
option 'test_audio_extension' '#123457'
option 'test_echo_extension' '#123458'
option 'record_message_extension' '#999999'
config dialplan 'custom_dialplan'
option custom_outgoing_enabled '0'
option custom_incoming_enabled '0'
option custom_hangup_enabled '0'
option all_ports_extension '#123456'
option test_audio_extension '#123457'
option test_echo_extension '#123458'
option record_message_extension '#999999'
config 'sip_advanced' 'SIP'
option 'rtpstart' '10000'
option 'rtpend' '20000'
option 'dtmfmode' 'rfc2833'
option 'remotehold' 'yes'
option 'contact_line_suffix' '1'
option 'registertimeoutbackoff' '512'
option 'registerattemptsbackoff' '0'
option 'register403timeout' '0'
option 'register503timeout' '0'
option 'registertimeoutguardsecs' '15'
option 'registertimeoutguardlimit' '30'
option 'registertimeoutguardpct' '0.2'
config sip_advanced 'SIP'
option rtpstart '10000'
option rtpend '20000'
option dtmfmode 'rfc2833'
option remotehold 'yes'
option contact_line_suffix '1'
option registertimeoutbackoff '512'
option registerattemptsbackoff '0'
option register403timeout '0'
option register503timeout '0'
option registertimeoutguardsecs '15'
option registertimeoutguardlimit '30'
option registertimeoutguardpct '0.2'
option defaultexpiry '300'
option 'tls_version' 'tlsv1'
option 'tls_cipher' 'DES-CBC3-SHA'
option 'stun_server' ''
option 'dnsmgr' 'no'
option 'dnsmgr_refresh_interval' '300'
option 'srvlookup' 'yes'
option tls_version 'tlsv1'
option tls_cipher 'DES-CBC3-SHA'
option stun_server ''
option dnsmgr 'no'
option dnsmgr_refresh_interval '300'
option srvlookup 'yes'
config 'tel_advanced' 'TEL'
option 'country' 'SWE'
option 'jbenable' 'yes'
option 'jbforce' 'no'
option 'jbmaxsize' '500'
option 'jbimpl' 'adaptive'
option 'genericplc' 'yes'
option 'dialoutmsec' '4000'
option 'cw_enable' 'yes'
config tel_advanced 'TEL'
option country 'SWE'
option jbenable 'yes'
option jbforce 'no'
option jbmaxsize '500'
option jbimpl 'adaptive'
option genericplc 'yes'
option dialoutmsec '4000'
option cw_enable 'yes'
config 'features' 'features'
option 'cbbs_enabled' '1'
option 'callforward_enabled' '1'
option 'callwaiting_enabled' '1'
option 'redial_enabled' '1'
option 'callreturn_enabled' '1'
option 'advanced_register_settings' '1'
config features 'features'
option cbbs_enabled '1'
option callforward_enabled '1'
option callwaiting_enabled '1'
option redial_enabled '1'
option callreturn_enabled '1'
option advanced_register_settings '1'
config log 'LOG'
option console 'notice,warning,error'
@@ -146,31 +146,32 @@ config ringing_status 'RINGING_STATUS'
option shouldring '1'
config call_filter 'call_filter0'
option block_foreign '0'
option block_special_rate '0'
option block_outgoing '0'
option block_incoming '0'
option block_foreign '0'
option block_special_rate '0'
option block_outgoing '0'
option block_incoming '0'
config 'sip_service_provider' 'sip0'
option 'name' 'Account 1'
option 'enabled' '0'
option 'codec0' 'alaw'
config cdr_log 'CDR_LOG'
option cdr_syslog '0'
config sip_service_provider 'sip0'
option name 'Account 1'
option enabled '0'
option codec0 'alaw'
option cbbs_key '5'
option cbbs_maxretry '5'
option cbbs_retrytime '300'
option cbbs_waittime '30'
option 'autoframing' '1'
option 'cfim_on' '*21*'
option 'cfim_off' '#21#'
option 'cfbs_on' '*61*'
option 'cfbs_off' '#61#'
option autoframing '1'
option cfim_on '*21*'
option cfim_off '#21#'
option cfbs_on '*61*'
option cfbs_off '#61#'
option cw_on '*43#'
option cw_off '#43#'
option cw_status '*#43#'
option 'call_return' '*69'
option 'redial' '*66'
option 'is_fax' '0'
option 'transport' 'udp'
option call_return '*69'
option redial '*66'
option is_fax '0'
option transport 'udp'
config cdr_log 'CDR_LOG'
option cdr_syslog '0'

View File

@@ -260,90 +260,41 @@ read_codecs_ptime()
#
read_lines()
{
local lines=""
local call_lines
local fxsIdx fxsEpt dectIdx dectEpt
local line call_lines lineid ldx lines llength clength
local loffset=$(ubus -t 1 call voice.asterisk platform | jsonfilter -e @.lineoffset)
loffset=${loffset:-0}
# Are lines already set by user conf?
config_get call_lines $1 call_lines
config_get call_lines $1 call_lines "0"
# Otherwise set default depending on board HW. This
# is only done at very first boot or a default reset.
if test -z "$call_lines"; then
# Get all FSX voice endpoints. Translate to uppercase with awk
# due to tr [:upper:] doesn't work in our BusyBox.
voicePorts=$(db get hw.board.VoicePortOrder | \
awk '{ print toupper($0) }' | \
sed -e "s/\([[:alpha:]]*\)\([[:digit:]]\)/\1\/\2/g")
voiceNames=$(db get hw.board.VoicePortNames)
hasVoice=0
for line in $call_lines ; do
if test $(db get hw.board.hasVoice) = "1"; then
# Get the first FSX voice endpoint index by
# searching for the name usually used.
fxsIdx=$(echo $voiceNames | \
awk -e '{
i = 1;
while(i <= NF && tolower($i) !~ /^tel.*$/) {
i++;
}
print i;
}'
)
# Convert index to endpoint ID
if test $fxsIdx -gt 0; then
fxsEpt=$(echo $voicePorts | awk '{ print $'$fxsIdx' }')
fi
hasVoice=1
fi
if test $(db get hw.board.hasDect) = "1"; then
# Get the first Dect voice endpoint index by
# searching for the name usually used.
dectIdx=$(echo $voiceNames | \
awk -e '{
i = 1;
while(i <= NF && tolower($i) !~ /^dect.*$/) {
i++;
}
print i;
}
')
if test $dectIdx -gt 0; then
dectEpt=$(echo $voicePorts | awk '{ print $'$dectIdx' }')
fi
hasVoice=1
fi
if test $hasVoice -eq 1; then
call_lines="$dectEpt $fxsEpt"
# Remove leading/trailing spaces
call_lines=$(echo $call_lines | xargs echo -n)
# If we didn't find any endpoint ID we
# fallback to activate them all.
if test -z "$call_lines"; then
call_lines="$voicePorts"
fi
fi
# Save the endpoint IDs we found where the
# GUI expects to find them.
uci_set voice_client "${1}" "call_lines" "$call_lines"
uci_commit voice_client
fi
for i in $call_lines ; do
case $i in
''|*[!0-9]*) lines=$lines"$i&" ;;
*) lines=$lines"$CHANNELNAME/$i&" ;;
# convert line format to <LINENAME><LINEID>
case $line in
[0-9])
line="$LINENAME$line"
;;
"$CHANNELNAME"/[0-9])
clength=$(echo $CHANNELNAME | wc -c)
line="$LINENAME${line:$clength}"
;;
esac
# get the index from line name
# llength=$(echo $LINENAME | wc -c)
# lineid="${lineid:$llength}"
# get the index from uci config order
lineid="$(uci show voice_client | grep =tel_line | grep -wn $line | cut -d ':' -f1)"
[ -n "$lineid" ] || continue
# -1 to get uci config index (which starts from 0)
# +loffset to give correct number of channel driver
ldx=$((lineid-1+loffset))
lines="$lines$CHANNELNAME/$ldx&"
done
lines=$(escape_sed_substitution $lines)
echo "${lines%??}"
}
@@ -1481,7 +1432,6 @@ configure_extensions()
#
configure_extensions_provider()
{
echo COMES HERE
local enabled
local displayname
local user