voice-client: supported countries ubus method

This commit is contained in:
Sukru Senli 2019-06-27 18:47:17 +02:00
parent a9415b745c
commit 08f2370477
3 changed files with 50 additions and 1 deletions

View file

@ -43,3 +43,32 @@ getEchoCancellingValue() {
;; ;;
esac esac
} }
supportedCountries() {
echo "Australia:AUS"
echo "Belgium:BEL"
echo "Brazil:BRA"
echo "Chile:CHL"
echo "China:CHN"
echo "Czech:CZE"
echo "Denmark:DNK"
echo "ETSI:ETS"
echo "Finland:FIN"
echo "France:FRA"
echo "Germany:DEU"
echo "Hungary:HUN"
echo "India:IND"
echo "Italy:ITA"
echo "Japan:JPN"
echo "Netherlands:NLD"
echo "New Zealand:NZL"
echo "North America:USA"
echo "Spain:ESP"
echo "Sweden:SWE"
echo "Switzerland:CHE"
echo "Norway:NOR"
echo "Taiwan:TWN"
echo "United Kingdoms:GRB"
echo "United Arab Emirates:ARE"
echo "CFG TR57:T57"
}

View file

@ -50,3 +50,7 @@ getEchoCancellingValue() {
;; ;;
esac esac
} }
supportedCountries() {
echo "ETSI:ETS"
}

View file

@ -5,7 +5,7 @@
case "$1" in case "$1" in
list) list)
echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {} }' echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {}, "supported_countries" : {} }'
;; ;;
call) call)
@ -146,6 +146,22 @@ case "$1" in
json_dump json_dump
;; ;;
supported_countries)
vcf="/tmp/voice.supported_countries"
supportedCountries > $vcf
json_init
json_add_array countries
while IFS= read -r line
do
json_add_object ""
json_add_string country "$(echo $line | cut -d':' -f1)"
json_add_string code "$(echo $line | cut -d':' -f2)"
json_select ..
done < "$vcf"
json_dump
rm -f $vcf
;;
esac esac
;; ;;
esac esac