diff --git a/module.xml b/module.xml index 68ff878..0e42187 100644 --- a/module.xml +++ b/module.xml @@ -1,7 +1,7 @@ sccp_manager SCCP Manager - 14.4.0.2 + 14.4.0.3 setup SCCP Connectivity Steve Lad, Alex GP @@ -39,6 +39,7 @@ * Version 14.3.0.31 * - Fix rewrite rules. * Version 14.4.0.1 * - Modify installer to avoid data loss on existing 14.3 fields. Bump Minor version to reflect this. * Version 14.4.0.2 * - Revert error in Installer db calls - IF EXISTS is not valid in MariaDb v5 (package DB) + * Version 14.4.0.3 * - Change method of selecting phonecodepage depending on if is java phone. https://github.com/chan-sccp/sccp_manager diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index 2aa2d97..c79d246 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -677,14 +677,20 @@ trait ajaxHelper { } break; case 'phonecodepage': + // phonecodepage depends on 2 variables - language and phone type (uses java or not). + // Non java phones use ISO8859-1 or CP1251 (Cyrillic); java phones use UTF-8. See @dkgroot. + // Below list is not definitive or necessarily accurate - needs to be maintained. + $nonJavaPhones = array( + '6901', '6911', '6921', '6945', '7902', '7905', '7910', '7911', '7912', '7914', '7915', '7916', '7920', '7925', '7926', '7931', '7935', '7936', '7937', '7940', '7960' + ); // TODO: May be other exceptions so use switch. Historically this is the only one handled if (!empty($get_settings["{$hdr_prefix}devlang"])) { switch ($get_settings["{$hdr_prefix}devlang"]) { case 'Russian_Russian_Federation': - $value = 'CP1251'; + $value = (in_array($get_settings['sccp_hw_type'], $nonJavaPhones, true)) ? 'CP1251' : 'utf-8'; break; default: - $value = 'ISO8859-1'; + $value = (in_array($get_settings['sccp_hw_type'], $nonJavaPhones, true)) ? 'ISO8859-1' : 'utf-8'; break; } }