Skip to content

Commit

Permalink
Gigaset N720, tune code tone
Browse files Browse the repository at this point in the history
  • Loading branch information
BnLG committed Feb 13, 2023
1 parent a2eccff commit e4f64a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/wazo-gigaset/N720/templates/base.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<SYMB_ITEM ID="BS_IP_Data.aucS_HTTP_PROXY_URL[%]" class="symb_item" value='""'/>
<SYMB_ITEM ID="BS_IP_Data.uiI_HTTP_PROXY_PORT" class="symb_item" value="8080"/>
<SYMB_ITEM ID="BS_IP_Data.ucI_HTTPLANGUAGE" class="symb_item" value="1"/>
<SYMB_ITEM ID="S_AE_SwConfig.ucCountryCodeTone" class="symb_item" value="{{ XX_country }}"/>

{%- if ntp_enabled %}
<SYMB_ITEM ID="BS_IP_Data.aucS_TIME_NTP_SERVER[%]" class="symb_item" value='"{{ ntp_ip }}"'/>
Expand Down
16 changes: 16 additions & 0 deletions plugins/wazo-gigaset/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ def path_preprocess(self, request):
class BaseGigasetPlugin(StandardPlugin):
_ENCODING = 'UTF-8'

_LOCALE = {
'de_DE': '0',
'en_US': '1',
'es_ES': '6',
'fr_FR': '7',
'fr_CA': '0',
}

_TZ_GIGASET = {
(-12, 0): 0x00,
(-11, 0): 0x01,
Expand Down Expand Up @@ -195,6 +203,13 @@ def _add_phonebook(self, raw_config):
uuid_format = '{scheme}://{hostname}:{port}/0.1/directories/lookup/default/gigaset/{user_uuid}?' # noqa: E501
plugins.add_xivo_phonebook_url_from_format(raw_config, uuid_format)

def _add_country_and_lang(self, raw_config):
locale = raw_config.get('locale')
if locale in self._LOCALE:
raw_config['XX_country'] = self._LOCALE[locale]
else:
raw_config['XX_country'] = '0'

def _add_timezone_code(self, raw_config):
timezone = raw_config.get('timezone', 'Etc/UTC')
tz_db = tzinform.TextTimezoneInfoDB()
Expand Down Expand Up @@ -236,6 +251,7 @@ def configure(self, device, raw_config):
filename = self._dev_specific_filename(device)
tpl = self._tpl_helper.get_dev_template(filename, device)

self._add_country_and_lang(raw_config)
self._add_sip_info(raw_config)
self._add_xx_vars(device, raw_config)
self._add_phonebook(raw_config)
Expand Down

0 comments on commit e4f64a7

Please sign in to comment.