From 08f2370477bf4d648f4d953c0efc3cd46b58a29b Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Thu, 27 Jun 2019 18:47:17 +0200 Subject: [PATCH] voice-client: supported countries ubus method --- voice-client/files/lib/voice/broadcom.sh | 29 +++++++++++++++++++ voice-client/files/lib/voice/intel.sh | 4 +++ .../files/usr/libexec/rpcd/voice.asterisk | 18 +++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/voice-client/files/lib/voice/broadcom.sh b/voice-client/files/lib/voice/broadcom.sh index 0ad4cce81..70c737d38 100755 --- a/voice-client/files/lib/voice/broadcom.sh +++ b/voice-client/files/lib/voice/broadcom.sh @@ -43,3 +43,32 @@ getEchoCancellingValue() { ;; 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" +} diff --git a/voice-client/files/lib/voice/intel.sh b/voice-client/files/lib/voice/intel.sh index 13f756db4..7e406e047 100755 --- a/voice-client/files/lib/voice/intel.sh +++ b/voice-client/files/lib/voice/intel.sh @@ -50,3 +50,7 @@ getEchoCancellingValue() { ;; esac } + +supportedCountries() { + echo "ETSI:ETS" +} diff --git a/voice-client/files/usr/libexec/rpcd/voice.asterisk b/voice-client/files/usr/libexec/rpcd/voice.asterisk index 7f89c08ed..f9f17635f 100755 --- a/voice-client/files/usr/libexec/rpcd/voice.asterisk +++ b/voice-client/files/usr/libexec/rpcd/voice.asterisk @@ -5,7 +5,7 @@ case "$1" in list) - echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {} }' + echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {}, "supported_countries" : {} }' ;; call) @@ -146,6 +146,22 @@ case "$1" in 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