iobroker.tr-064 4.2.15 → 4.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +10 -1
- package/admin/index_m.html +13 -8
- package/admin/words.js +4 -4
- package/io-package.json +25 -25
- package/lib/callmonitor.js +5 -1
- package/lib/devices.js +9 -0
- package/lib/phonebook.js +17 -11
- package/main.js +19 -10
- package/package.json +13 -12
- package/.releaseconfig.json +0 -3
- package/lib/tools.js +0 -80
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2015-
|
|
3
|
+
Copyright (c) 2015-2022 soef <soef@gmx.net>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -133,6 +133,15 @@ To use the call monitor feature it must be first enabled in the AVM Fritz!Box.
|
|
|
133
133
|
To enable the call monitor dial ```#96*5*``` and the TCP/IP Port 1012 will be opened. To close the port dial ```#96*4*```.
|
|
134
134
|
|
|
135
135
|
## Changelog
|
|
136
|
+
### 4.2.17 (2022-09-16)
|
|
137
|
+
* (simatec/Apollon77) Prevent duplication of entries in configuration
|
|
138
|
+
* (Apollon77) Make sure active status of devices in jsonDeviceList is correct
|
|
139
|
+
|
|
140
|
+
### 4.2.16 (2022-03-21)
|
|
141
|
+
* (Apollon77) Fix info logs on callee/caller
|
|
142
|
+
* (Apollon77) Add special handling for potential broken external image links in phonebook
|
|
143
|
+
* (Apollon77) Prevent some crash cases reported by Sentry
|
|
144
|
+
|
|
136
145
|
### 4.2.15 (2021-12-08)
|
|
137
146
|
* (bluefox) fix crash case (Sentry IOBROKER-TR-064-35)
|
|
138
147
|
|
|
@@ -255,7 +264,7 @@ To enable the call monitor dial ```#96*5*``` and the TCP/IP Port 1012 will be o
|
|
|
255
264
|
## License
|
|
256
265
|
The MIT License (MIT)
|
|
257
266
|
|
|
258
|
-
Copyright (c) 2015-
|
|
267
|
+
Copyright (c) 2015-2022 soef <soef@gmx.net>, ioBroker-Community-Developers
|
|
259
268
|
|
|
260
269
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
261
270
|
of this software and associated documentation files (the "Software"), to deal
|
package/admin/index_m.html
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
' <p>'+ newIndex +'</p>\n' +
|
|
92
92
|
' </td>\n' +
|
|
93
93
|
' <td>\n' +
|
|
94
|
-
'
|
|
94
|
+
' <input type="text" class="validate">\n' +
|
|
95
95
|
' </td>\n' +
|
|
96
96
|
' <td>\n' +
|
|
97
97
|
' <input type="text" class="validate">\n' +
|
|
@@ -144,10 +144,12 @@
|
|
|
144
144
|
//look for devices on router
|
|
145
145
|
function deviceLookup(onChange) {
|
|
146
146
|
$('.load-wait').show();
|
|
147
|
-
|
|
147
|
+
console.log('deviceLookup started');
|
|
148
148
|
sendTo('tr-064.' + instance, 'discovery', {onlyActive: true, reread: false}, function (result) {
|
|
149
|
+
$('#chooseDevice').empty();
|
|
149
150
|
$('.load-wait').hide();
|
|
150
151
|
let arr = JSON.parse(result);
|
|
152
|
+
console.log('Got ' + arr.length + ' devices');
|
|
151
153
|
|
|
152
154
|
for (let i = 0; i < arr.length; i++) {
|
|
153
155
|
let newRow = '<tr>\n' +
|
|
@@ -226,19 +228,22 @@
|
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
//
|
|
231
|
+
//default sort by name =)
|
|
230
232
|
$('#modalDeviceName').click();
|
|
231
233
|
});
|
|
232
234
|
}
|
|
233
235
|
|
|
234
236
|
// the function loadSettings has to exist ...
|
|
235
237
|
function load(settings, onChange) {
|
|
238
|
+
console.log('load started');
|
|
236
239
|
if (systemConfig) {
|
|
237
240
|
secret = (systemConfig && systemConfig.native && systemConfig.native.secret) || 'Zgfr56gFe87jJOM';
|
|
241
|
+
console.log('load started: system config existing');
|
|
238
242
|
loadHelper(settings, onChange);
|
|
239
243
|
return;
|
|
240
244
|
}
|
|
241
245
|
socket.emit('getObject', 'system.config', function (err, obj) {
|
|
246
|
+
console.log('load started: system config loaded');
|
|
242
247
|
secret = (obj.native ? obj.native.secret : '') || 'Zgfr56gFe87jJOM';
|
|
243
248
|
loadHelper(settings, onChange);
|
|
244
249
|
});
|
|
@@ -300,19 +305,19 @@
|
|
|
300
305
|
|
|
301
306
|
if ($key.attr('type') === 'checkbox') {
|
|
302
307
|
// do not call onChange direct, because onChange could expect some arguments
|
|
303
|
-
$key.prop('checked', sObj).on('change', () => onChange())
|
|
304
|
-
;
|
|
308
|
+
$key.prop('checked', sObj).on('change', () => onChange());
|
|
305
309
|
} else {
|
|
306
310
|
// do not call onChange direct, because onChange could expect some arguments
|
|
307
311
|
$key.val(sObj)
|
|
308
312
|
.on('change', () => onChange())
|
|
309
|
-
.on('keyup', () => onChange())
|
|
310
|
-
;
|
|
313
|
+
.on('keyup', () => onChange());
|
|
311
314
|
}
|
|
312
315
|
});
|
|
313
316
|
|
|
317
|
+
$('#devices').empty();
|
|
314
318
|
//read devices from settings and show in table
|
|
315
319
|
let countDevices = settings.devices.length;
|
|
320
|
+
console.log('countDevices: ' + countDevices);
|
|
316
321
|
if (countDevices > 0) {
|
|
317
322
|
for (let i = 0; i < countDevices; i++) {
|
|
318
323
|
addDeviceRow(onChange, settings.devices[i].name, settings.devices[i].ip, settings.devices[i].mac);
|
|
@@ -499,7 +504,7 @@
|
|
|
499
504
|
<th class="translate" id="deviceName">name</th>
|
|
500
505
|
<th class="translate" id="deviceIP">ip</th>
|
|
501
506
|
<th class="translate" id="deviceMac">MAC</th>
|
|
502
|
-
<th class="translate" id="deviceDelete"
|
|
507
|
+
<th class="translate" id="deviceDelete"> </th>
|
|
503
508
|
</tr>
|
|
504
509
|
</thead>
|
|
505
510
|
<tbody id="devices">
|
package/admin/words.js
CHANGED
|
@@ -8,9 +8,9 @@ systemDictionary = {
|
|
|
8
8
|
"Calllists": { "en": "Calllists", "de": "Anruflisten", "ru": "Calllists", "pt": "Listas de chamadas", "nl": "Calllists", "fr": "Listes d'appels", "it": "Calllists", "es": "Calistas", "pl": "Listy połączeń", "zh-cn": "通话清单"},
|
|
9
9
|
"Cannot find any device": { "en": "Cannot find new devices", "de": "Kein neues Gerät gefunden", "ru": "Ничего не найдено", "pt": "Não é possível encontrar novos dispositivos", "nl": "Kan geen nieuwe apparaten vinden", "fr": "Impossible de trouver de nouveaux appareils", "it": "Non riesci a trovare nuovi dispositivi", "es": "No puedo encontrar nuevos dispositivos", "pl": "Nie można znaleźć nowych urządzeń", "zh-cn": "无法找到新的设备"},
|
|
10
10
|
"Choose Device": { "en": "Choose Device", "de": "Gerät auswählen", "ru": "Выберите устройство", "pt": "Escolha o dispositivo", "nl": "Kies apparaat", "fr": "Choisissez un appareil", "it": "Scegli dispositivo", "es": "Elegir dispositivo", "pl": "Wybierz urządzenie", "zh-cn": "选择设备"},
|
|
11
|
-
"Close": { "en": "Close", "de": "Schließen", "ru": "Закрыть", "pt": "Fechar", "nl": "Dichtbij", "fr": "Fermer", "it": "Vicino", "es": "Cerca", "pl": "Blisko", "zh-cn": "
|
|
11
|
+
"Close": { "en": "Close", "de": "Schließen", "ru": "Закрыть", "pt": "Fechar", "nl": "Dichtbij", "fr": "Fermer", "it": "Vicino", "es": "Cerca", "pl": "Blisko", "zh-cn": "关闭"},
|
|
12
12
|
"Create Json device list": { "en": "Create JSON device list", "de": "JSON Geräteliste erstellen", "ru": "Создать список устройств JSON", "pt": "Criar lista de dispositivos JSON", "nl": "Maak een JSON-apparatenlijst", "fr": "Créer une liste de périphériques JSON", "it": "Crea un elenco di dispositivi JSON", "es": "Crear lista de dispositivos JSON", "pl": "Utwórz listę urządzeń JSON", "zh-cn": "创建JSON设备列表"},
|
|
13
|
-
"Devices": { "en": "Devices", "de": "Geräte", "ru": "Устройства", "pt": "Dispositivos", "nl": "
|
|
13
|
+
"Devices": { "en": "Devices", "de": "Geräte", "ru": "Устройства", "pt": "Dispositivos", "nl": "Apparaten", "fr": "Dispositifs", "it": "dispositivi", "es": "Dispositivos", "pl": "Urządzenia", "zh-cn": "设备"},
|
|
14
14
|
"ERROR": { "en": "Error", "de": "Fehler", "ru": "ОШИБКА", "pt": "ERRO", "nl": "FOUT", "fr": "ERREUR", "it": "ERRORE", "es": "ERROR", "pl": "BŁĄD", "zh-cn": "错误"},
|
|
15
15
|
"Enable adapter first": { "en": "Please enable the TR-064 instance first", "de": "Bitte die TR-064 Instanz starten", "ru": "Сначала активируйте драйвер", "pt": "Ativar adaptador primeiro", "nl": "Schakel eerst de adapter in", "fr": "Activer d'abord l'adaptateur", "it": "Abilitare prima l'adattatore", "es": "Habilitar primero el adaptador", "pl": "Włącz najpierw adapter", "zh-cn": "第一个启用适配器"},
|
|
16
16
|
"Find a device": { "en": "Search for devices", "de": "Geräte suchen", "ru": "Список устройств", "pt": "Encontre um dispositivo", "nl": "Zoek een apparaat", "fr": "Trouver un appareil", "it": "Trova un dispositivo", "es": "Encontrar un dispositivo", "pl": "Znajdź urządzenie", "zh-cn": "找到一个设备"},
|
|
@@ -24,7 +24,7 @@ systemDictionary = {
|
|
|
24
24
|
"Missed calls": { "en": "List of missed calls", "de": "Liste der entgangenen Anrufe", "ru": "Список пропущенных звонков", "pt": "Lista de chamadas perdidas", "nl": "Lijst voor gemiste oproepen", "fr": "Liste des appels manqués", "it": "Elenco per chiamate perse", "es": "Lista de llamadas perdidas", "pl": "Lista nieodebranych połączeń", "zh-cn": "列表未接来电"},
|
|
25
25
|
"Name": { "en": "Name", "de": "Name", "ru": "Имя", "pt": "Nome", "nl": "Naam", "fr": "prénom", "it": "Nome", "es": "Nombre", "pl": "Imię", "zh-cn": "名称"},
|
|
26
26
|
"Not enabled": { "en": "You have to start %s before you can use this function!", "de": "%s muss gestartet sein, bevor diese Funktion verwendet werden kann!", "ru": "Вы должны включить / запустить %s адаптер, прежде чем сможете использовать эту функцию!", "pt": "Você precisa ativar / iniciar o adaptador %s antes de poder usar esta função!", "nl": "U moet %s adapter inschakelen / starten voordat u deze functie kunt gebruiken!", "fr": "Vous devez activer / démarrer l'adaptateur %s avant de pouvoir utiliser cette fonction!", "it": "Devi abilitare / avviare l'adattatore %s prima di poter usare questa funzione!", "es": "¡Debe habilitar / iniciar el adaptador %s antes de poder usar esta función!", "pl": "Musisz włączyć / uruchomić %s adapter, aby móc korzystać z tej funkcji!", "zh-cn": "您必须先启用/启动%s适配器,然后才能使用此功能!"},
|
|
27
|
-
"Ok": { "en": "Ok", "de": "Ok", "ru": "Ok", "pt": "
|
|
27
|
+
"Ok": { "en": "Ok", "de": "Ok", "ru": "Ok", "pt": "Ok", "nl": "OK", "fr": "D'accord", "it": "Ok", "es": "De acuerdo", "pl": "Dobrze", "zh-cn": "确定"},
|
|
28
28
|
"Options": { "en": "Options", "de": "Optionen", "ru": "Параметры", "pt": "Opções", "nl": "opties", "fr": "Les options", "it": "Opzioni", "es": "Opciones", "pl": "Opcje", "zh-cn": "选件"},
|
|
29
29
|
"Outbound": { "en": "List of outbound calls", "de": "Liste der ausgehenden Anrufe", "ru": "Список исходящих звонков", "pt": "Listar para chamadas de saída", "nl": "Lijst voor uitgaande oproepen", "fr": "Liste des appels sortants", "it": "Elenco per le chiamate in uscita", "es": "Lista para llamadas salientes", "pl": "Lista połączeń wychodzących", "zh-cn": "列出的电话"},
|
|
30
30
|
"Password": { "en": "Password", "de": "Passwort", "ru": "Пароль", "pt": "Senha", "nl": "Wachtwoord", "fr": "Mot de passe", "it": "Parola d'ordine", "es": "Contraseña", "pl": "Hasło", "zh-cn": "密码"},
|
|
@@ -32,7 +32,7 @@ systemDictionary = {
|
|
|
32
32
|
"Please wait, looking for devices...": { "en": "Please wait…", "de": "Bitte warten…", "ru": "Подождите...", "pt": "Por favor, espere...", "nl": "Even geduld aub...", "fr": "S'il vous plaît, attendez...", "it": "Attendere prego...", "es": "Por favor espera...", "pl": "Proszę czekać...", "zh-cn": "请等等..."},
|
|
33
33
|
"Polling interval (sec)": { "en": "Data polling interval (sec)", "de": "Datenabfrage Intervall (Sek.)", "ru": "Интервал опроса (сек)", "pt": "Intervalo de pesquisa (seg)", "nl": "Polling-interval (sec)", "fr": "Intervalle d'interrogation (sec)", "it": "Intervallo di polling (sec)", "es": "Intervalo de sondeo (seg.)", "pl": "Interwał odpytywania (s)", "zh-cn": "投票时间间隔(sec)"},
|
|
34
34
|
"Select a device": { "en": "Select a device", "de": "Gerät auswählen", "ru": "Выберите устройство", "pt": "Selecione um dispositivo", "nl": "Selecteer een apparaat", "fr": "Sélectionnez un appareil", "it": "Seleziona un dispositivo", "es": "Seleccione un dispositivo", "pl": "Wybierz urządzenie", "zh-cn": "选择一个设备"},
|
|
35
|
-
"Settings": { "en": "Settings", "de": "Einstellungen", "ru": "Настройки", "pt": "
|
|
35
|
+
"Settings": { "en": "Settings", "de": "Einstellungen", "ru": "Настройки", "pt": "Configurações", "nl": "instellingen", "fr": "Réglages", "it": "impostazioni", "es": "Ajustes", "pl": "Ustawienia", "zh-cn": "设置"},
|
|
36
36
|
"TR 064 adapter settings": { "en": "TR-064 Instance Settings", "de": "TR-064 Instanz-Einstellungen", "ru": "Список устройств", "pt": "Configurações do adaptador TR-064", "nl": "TR-064 Adapterinstellingen", "fr": "Réglages de l’adaptateur TR-064", "it": "Impostazioni dell'adattatore TR-064", "es": "Ajustes del adaptador TR-064", "pl": "Ustawienia adaptera TR-064", "zh-cn": "TR064设置适配器"},
|
|
37
37
|
"TR-064 adapter settings": { "en": "TR-064 instance settings", "de": "TR-064 Instanz-Einstellungen", "ru": "Настройки драйвера TR-064", "pt": "Configurações do adaptador TR-064", "nl": "TR-064 adapterinstellingen", "fr": "Paramètres de l'adaptateur TR-064", "it": "Impostazioni dell'adattatore TR-064", "es": "Ajustes del adaptador TR-064", "pl": "Ustawienia adaptera TR-064", "zh-cn": "TR-064设置适配器"},
|
|
38
38
|
"Use CallList": { "en": "Activate Calllist", "de": "Anrufliste aktivieren", "ru": "Список звонков", "pt": "Use a Lista de Chamada", "nl": "Gebruik oproeplijst", "fr": "Utiliser la liste d'appels", "it": "Usa lista chiamate", "es": "Usar lista de llamadas", "pl": "Użyj listy połączeń", "zh-cn": "使用Calllist"},
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "tr-064",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.17",
|
|
5
5
|
"news": {
|
|
6
|
+
"4.2.17": {
|
|
7
|
+
"en": "Prevent duplication of entries in configuration\nMake sure active status of devices in jsonDeviceList is correct",
|
|
8
|
+
"de": "Verhindern Sie die Vervielfältigung von Einträgen in der Konfiguration\nStellen Sie sicher, dass der aktive Status von Geräten in json Gerät Liste ist korrekt",
|
|
9
|
+
"ru": "Предотвратить дублирование записей в конфигурации\nУбедитесь, что активный статус устройств в json Устройства Список правильный",
|
|
10
|
+
"pt": "Impedir a duplicação de entradas na configuração\nCertifique-se de status ativo de dispositivos em json Dispositivo A lista é correta",
|
|
11
|
+
"nl": "Vertaling:\nZorg voor actieve status van apparaten in Json Vernietiging. List is correct",
|
|
12
|
+
"fr": "Prévenir les doubles emplois dans la configuration\nAssurez-vous de l'état actif des appareils en json Dispositif La liste est correcte",
|
|
13
|
+
"it": "Prevenire la duplicazione delle voci nella configurazione\nAssicurarsi lo stato attivo dei dispositivi in json Dispositivo La lista è corretta",
|
|
14
|
+
"es": "Prevenir la duplicación de entradas en configuración\nAsegúrese de que el estado activo de los dispositivos en json Dispositivo La lista es correcta",
|
|
15
|
+
"pl": "Wynalezienie wpisów w konfiguracji\nUmożliwić czynny status urządzeń w jsonie. Device Lista jest prawidłowa",
|
|
16
|
+
"zh-cn": "B. 组合中物品的预防重复\nB. 确保在丛金中确保装置的积极参与 证人 名单正确"
|
|
17
|
+
},
|
|
18
|
+
"4.2.16": {
|
|
19
|
+
"en": "Fix info logs on callee/caller\nAdd special handling for potential broken external image links in phonebook\nPrevent some crash cases reported by Sentry",
|
|
20
|
+
"de": "Korrigieren Sie Info-Protokolle auf Angerufenem/Anrufer\nFügen Sie eine spezielle Behandlung für potenziell defekte externe Bildlinks im Telefonbuch hinzu\nVerhindern Sie einige von Sentry gemeldete Absturzfälle",
|
|
21
|
+
"ru": "Исправить журналы информации о вызываемом / вызывающем абоненте\nДобавить специальную обработку для потенциально неработающих ссылок на внешние изображения в телефонной книге.\nПредотвращение некоторых случаев сбоев, о которых сообщает Sentry.",
|
|
22
|
+
"pt": "Corrigir registros de informações no chamador/chamador\nAdicione tratamento especial para possíveis links de imagens externas quebrados na agenda telefônica\nPrevenir alguns casos de travamento relatados pelo Sentinela",
|
|
23
|
+
"nl": "Fix info logs op bellee/beller\nVoeg speciale afhandeling toe voor mogelijk verbroken externe afbeeldingslinks in het telefoonboek\nVoorkom enkele door Sentry gemelde crashgevallen",
|
|
24
|
+
"fr": "Correction des journaux d'informations sur l'appelé/appelant\nAjouter une gestion spéciale pour les liens d'images externes potentiellement rompus dans le répertoire\nEmpêcher certains cas de plantage signalés par Sentry",
|
|
25
|
+
"it": "Correggi i registri delle informazioni sul chiamato/chiamante\nAggiungi una gestione speciale per potenziali collegamenti di immagini esterne interrotti nella rubrica\nPrevenire alcuni casi di crash segnalati da Sentry",
|
|
26
|
+
"es": "Arreglar registros de información en el destinatario/persona que llama\nAgregue un manejo especial para posibles enlaces de imágenes externas rotas en la agenda telefónica\nEvitar algunos casos de bloqueo informados por Sentry",
|
|
27
|
+
"pl": "Napraw dzienniki informacji na rozmówcy/rozmówcy\nDodaj specjalną obsługę potencjalnych uszkodzonych linków do obrazów zewnętrznych w książce telefonicznej\nZapobiegaj niektórym przypadkom awarii zgłaszanych przez Sentry",
|
|
28
|
+
"zh-cn": "修复被调用者/调用者的信息日志\n为电话簿中可能损坏的外部图像链接添加特殊处理\n防止 Sentry 报告的一些崩溃案例"
|
|
29
|
+
},
|
|
6
30
|
"4.2.15": {
|
|
7
31
|
"en": "fix crash case (Sentry IOBROKER-TR-064-35)",
|
|
8
32
|
"de": "Crashfall beheben (Sentry IOBROKER-TR-064-35)",
|
|
@@ -62,30 +86,6 @@
|
|
|
62
86
|
"es": "corregir la detección de reinicio de identificación para llamadas individuales",
|
|
63
87
|
"pl": "naprawiono wykrywanie resetowania identyfikatora dla pojedynczych połączeń",
|
|
64
88
|
"zh-cn": "修复单个呼叫的ID重置检测"
|
|
65
|
-
},
|
|
66
|
-
"4.2.10": {
|
|
67
|
-
"en": "better handle caller id resets by reboots/FW updates to also update list specific counter and log when this happened",
|
|
68
|
-
"de": "Besseres Behandeln des Zurücksetzens der Anrufer-ID durch Neustarts / FW-Aktualisierungen, um auch den listenspezifischen Zähler zu aktualisieren und zu protokollieren, wenn dies passiert ist",
|
|
69
|
-
"ru": "лучше обрабатывать сброс идентификатора вызывающего абонента при перезагрузке / обновлении прошивки, чтобы также обновлять счетчик конкретного списка и регистрировать, когда это произошло",
|
|
70
|
-
"pt": "lidar melhor com redefinições de identificador de chamadas por reinicializações / atualizações de FW para também atualizar o contador específico da lista e registrar quando isso aconteceu",
|
|
71
|
-
"nl": "Beller-ID-resets beter afhandelen door reboots / FW-updates om ook de lijstspecifieke teller en het logboek bij te werken wanneer dit gebeurde",
|
|
72
|
-
"fr": "mieux gérer les réinitialisations de l'identifiant de l'appelant par des redémarrages / mises à jour du micrologiciel pour également mettre à jour le compteur spécifique de la liste et le journal lorsque cela s'est produit",
|
|
73
|
-
"it": "gestire meglio i ripristini dell'ID chiamante tramite riavvio / aggiornamenti FW per aggiornare anche il contatore specifico dell'elenco e il registro quando ciò è accaduto",
|
|
74
|
-
"es": "manejar mejor los reinicios del identificador de llamadas mediante reinicios / actualizaciones de FW para actualizar también el contador específico de la lista y el registro cuando esto sucedió",
|
|
75
|
-
"pl": "Lepsza obsługa resetowania identyfikatora dzwoniącego przez ponowne uruchomienie / aktualizacje FW, aby również zaktualizować określony licznik listy i dziennik, kiedy to się stało",
|
|
76
|
-
"zh-cn": "通过重新启动/固件更新更好地处理呼叫者ID重置,以便还更新列表特定计数器并在发生这种情况时进行记录"
|
|
77
|
-
},
|
|
78
|
-
"4.2.9": {
|
|
79
|
-
"en": "try to better handle calllist resets on FW updates\nMake sure jsonDeviceList do not get deleted on start\nBetter handle not initialized calllist templates",
|
|
80
|
-
"de": "Versuchen Sie, das Zurücksetzen der Anrufliste bei FW-Updates besser zu handhaben\nStellen Sie sicher, dass jsonDeviceList beim Start nicht gelöscht wird\nBehandeln Sie nicht initialisierte Anruflistenvorlagen besser",
|
|
81
|
-
"ru": "попытаться лучше обрабатывать сбросы списка вызывающих при обновлениях прошивки\nУбедитесь, что jsonDeviceList не удаляется при запуске\nЛучшая обработка неинициализированных шаблонов списков вызовов",
|
|
82
|
-
"pt": "tente lidar melhor com as redefinições da lista de chamadas nas atualizações do FW\nCertifique-se de que jsonDeviceList não seja excluído na inicialização\nMelhor lidar com modelos de lista de chamadas não inicializados",
|
|
83
|
-
"nl": "probeer calllist-resets op FW-updates beter af te handelen\nZorg ervoor dat jsonDeviceList niet wordt verwijderd bij het starten\nBeter omgaan met niet-geïnitialiseerde oproeplijstsjablonen",
|
|
84
|
-
"fr": "essayez de mieux gérer les réinitialisations de la liste d'appels sur les mises à jour du micrologiciel\nAssurez-vous que jsonDeviceList ne soit pas supprimé au démarrage\nMieux gérer les modèles de liste d'appels non initialisés",
|
|
85
|
-
"it": "provare a gestire meglio i ripristini delle liste di chiamata sugli aggiornamenti FW\nAssicurati che jsonDeviceList non venga eliminato all'avvio\nGestire meglio i modelli di elenchi di chiamate non inizializzati",
|
|
86
|
-
"es": "intente manejar mejor los restablecimientos de la lista de llamadas en las actualizaciones de FW\nAsegúrese de que jsonDeviceList no se elimine al iniciar\nManeje mejor las plantillas de listas de llamadas no inicializadas",
|
|
87
|
-
"pl": "spróbuj lepiej radzić sobie z resetowaniem listy wywołań przy aktualizacjach FW\nUpewnij się, że jsonDeviceList nie zostaną usunięte podczas uruchamiania\nLepsza obsługa niezainicjowanych szablonów list wywołań",
|
|
88
|
-
"zh-cn": "尝试更好地处理固件更新中的呼叫清单重置\n确保jsonDeviceList不会在启动时被删除\n更好地处理未初始化的呼叫列表模板"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"title": "TR-064",
|
package/lib/callmonitor.js
CHANGED
|
@@ -110,7 +110,11 @@ function CallMonitor(adapter, devices, phonebook) {
|
|
|
110
110
|
dev.setChannel(name, name);
|
|
111
111
|
for (const i of Object.keys(message)) {
|
|
112
112
|
if (i[0] !== '_') {
|
|
113
|
-
|
|
113
|
+
if (i === 'callee' || i === 'caller') {
|
|
114
|
+
dev.set(i, { val: message[i].toString(), common: { name: i, type: 'string', role: 'state' }});
|
|
115
|
+
} else {
|
|
116
|
+
dev.set(i, message[i]);
|
|
117
|
+
}
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
dev.set('timestamp', timestamp);
|
package/lib/devices.js
CHANGED
|
@@ -87,6 +87,9 @@ function valType(val) {
|
|
|
87
87
|
return 9;
|
|
88
88
|
}
|
|
89
89
|
const sVal = val.toString();
|
|
90
|
+
if (sVal !== '0' && sVal.startsWith('0') && !sVal.startsWith('0.')) {
|
|
91
|
+
return sVal;
|
|
92
|
+
}
|
|
90
93
|
|
|
91
94
|
const number = parseInt(sVal);
|
|
92
95
|
if (number.toString() === sVal) {
|
|
@@ -334,9 +337,15 @@ function Devices(adapter, onReady) {
|
|
|
334
337
|
}
|
|
335
338
|
|
|
336
339
|
adapter.getDevices((err, devices) => {
|
|
340
|
+
if (err || !devices) {
|
|
341
|
+
return typeof callback === 'function' && callback(-1);
|
|
342
|
+
}
|
|
337
343
|
doIt(devices);
|
|
338
344
|
|
|
339
345
|
adapter.getChannels('', (err, channels) => {
|
|
346
|
+
if (err || !channels) {
|
|
347
|
+
return typeof callback === 'function' && callback(-1);
|
|
348
|
+
}
|
|
340
349
|
doIt(channels);
|
|
341
350
|
typeof callback === 'function' && callback(0);
|
|
342
351
|
});
|
package/lib/phonebook.js
CHANGED
|
@@ -169,17 +169,23 @@ Phonebook.prototype.read = function (bo, cb) {
|
|
|
169
169
|
phonebookId: phonebookId
|
|
170
170
|
};
|
|
171
171
|
if (contact.person.imageurl && self.ownUrl) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
172
|
+
|
|
173
|
+
const ar = /^(.*)\/download.lua\?path=(http[^=&]+)&*.*$/.exec(contact.person.imageurl);
|
|
174
|
+
if (ar && ar[2]) {
|
|
175
|
+
newEntry.imageurl = ar[2];
|
|
176
|
+
} else {
|
|
177
|
+
//newEntry.imageurl = self.ownUrl + contact.person.imageurl.replace(/^.*?path\=/, '');
|
|
178
|
+
newEntry.imageurl = self.ownUrl.replace(/{imageurl}/, contact.person.imageurl);
|
|
179
|
+
//if (!/^https*:\/\//.test(newEntry.imageurl)) {
|
|
180
|
+
// newEntry.imageurl = self.NewPhonebookURL.replace (/\/phonebook.lua\?/, contact.person.imageurl + '&');
|
|
181
|
+
//}
|
|
182
|
+
// if (contact.person.imageurl.indexOf('://') >= 0) {
|
|
183
|
+
// newEntry.imageurl = contact.person.imageurl.replace(/^.*(https*:\/\/.?)/, '$1');
|
|
184
|
+
// } else {
|
|
185
|
+
// newEntry.imageurl = self.NewPhonebookURL.replace (/\/phonebook.lua\?/, contact.person.imageurl + '&');
|
|
186
|
+
// //testLoadInmage(newEntry.imageurl);
|
|
187
|
+
// }
|
|
188
|
+
}
|
|
183
189
|
}
|
|
184
190
|
adapter.log.debug('Phonebook ' + phonebookId + ' New Entry: ' + JSON.stringify(newEntry));
|
|
185
191
|
self.push(newEntry);
|
package/main.js
CHANGED
|
@@ -152,7 +152,7 @@ const CHANNEL_CALLLISTS = 'calllists';
|
|
|
152
152
|
const CHANNEL_CALLMONITOR = 'callmonitor';
|
|
153
153
|
|
|
154
154
|
let devStates;
|
|
155
|
-
|
|
155
|
+
let allDevices = [];
|
|
156
156
|
const ipActive = {};
|
|
157
157
|
|
|
158
158
|
const states = {
|
|
@@ -249,8 +249,9 @@ function onMessage(obj) {
|
|
|
249
249
|
let onlyActive;
|
|
250
250
|
let reread;
|
|
251
251
|
|
|
252
|
+
adapter.log.debug('onMessage: ' + JSON.stringify(obj));
|
|
252
253
|
switch (obj.command) {
|
|
253
|
-
case 'discovery':
|
|
254
|
+
case 'discovery': {
|
|
254
255
|
if (typeof obj.message === 'object') {
|
|
255
256
|
onlyActive = obj.message.onlyActive;
|
|
256
257
|
reread = obj.message.reread;
|
|
@@ -259,28 +260,36 @@ function onMessage(obj) {
|
|
|
259
260
|
return false;
|
|
260
261
|
}
|
|
261
262
|
if (!reread && allDevices.length > 0 && allDevices.onlyActive === onlyActive) {
|
|
263
|
+
adapter.log.debug('Discovery result: ' + JSON.stringify(allDevices));
|
|
262
264
|
adapter.sendTo(obj.from, obj.command, JSON.stringify(allDevices), obj.callback);
|
|
263
265
|
return true;
|
|
264
266
|
}
|
|
265
|
-
|
|
267
|
+
|
|
268
|
+
const newAllDevices = [];
|
|
269
|
+
newAllDevices.onlyActive = onlyActive;
|
|
270
|
+
let responseSent = false;
|
|
266
271
|
|
|
267
272
|
tr064Client.forEachHostEntry((err, device, cnt, all) => {
|
|
268
273
|
const active = !!(~~device.NewActive);
|
|
269
274
|
|
|
270
275
|
if (!onlyActive || active) {
|
|
271
|
-
|
|
276
|
+
newAllDevices.push({
|
|
272
277
|
name: device.NewHostName,
|
|
273
278
|
ip: device.NewIPAddress,
|
|
274
279
|
mac: device.NewMACAddress,
|
|
275
280
|
active: active
|
|
276
281
|
});
|
|
277
282
|
}
|
|
278
|
-
|
|
279
|
-
|
|
283
|
+
adapter.log.debug('Discovery Add (' + cnt + '/' + all + '): ' + device.NewHostName + ' ' + device.NewIPAddress + ' ' + device.NewMACAddress + ' ' + device.NewActive);
|
|
284
|
+
if (cnt + 1 >= all && !responseSent) {
|
|
285
|
+
responseSent = true;
|
|
286
|
+
allDevices = newAllDevices;
|
|
287
|
+
adapter.log.debug('Discovery result: ' + JSON.stringify(allDevices));
|
|
288
|
+
adapter.sendTo(obj.from, obj.command, JSON.stringify(newAllDevices), obj.callback);
|
|
280
289
|
}
|
|
281
290
|
});
|
|
282
291
|
return true;
|
|
283
|
-
|
|
292
|
+
}
|
|
284
293
|
default:
|
|
285
294
|
adapter.log.warn('Unknown command: ' + obj.command);
|
|
286
295
|
break;
|
|
@@ -820,7 +829,7 @@ TR064.prototype.command = function (command, callback) {
|
|
|
820
829
|
} catch(e) {
|
|
821
830
|
return;
|
|
822
831
|
} //xxx
|
|
823
|
-
if (typeof o.params !== 'object' || o.params === null) {
|
|
832
|
+
if (!o || typeof o.params !== 'object' || o.params === null) {
|
|
824
833
|
return;
|
|
825
834
|
}
|
|
826
835
|
|
|
@@ -1087,7 +1096,7 @@ function createConfiguredDevices(callback) {
|
|
|
1087
1096
|
}
|
|
1088
1097
|
dev.setChannelEx(device.NewHostName, { common: { name: device.NewHostName + ' (' + device.NewIPAddress + ')', role: 'channel' }, native: { mac: device.NewMACAddress }} );
|
|
1089
1098
|
setActive(dev, device.NewActive, device.NewIPAddress, device.NewMACAddress);
|
|
1090
|
-
arr.push( { active: !!device.NewActive, ip: device.NewIPAddress, name: device.NewHostName, mac: device.NewMACAddress } );
|
|
1099
|
+
arr.push( { active: !!(~~device.NewActive), ip: device.NewIPAddress, name: device.NewHostName, mac: device.NewMACAddress } );
|
|
1091
1100
|
});
|
|
1092
1101
|
}
|
|
1093
1102
|
|
|
@@ -1110,7 +1119,7 @@ function updateDevices(callback) {
|
|
|
1110
1119
|
dev.setChannelEx(device.NewHostName);
|
|
1111
1120
|
setActive(dev, device.NewActive, device.NewIPAddress, device.NewMACAddress);
|
|
1112
1121
|
if (adapter.config.jsonDeviceList) {
|
|
1113
|
-
arr.push( { active: !!device.NewActive, ip: device.NewIPAddress, name: device.NewHostName, mac: device.NewMACAddress } );
|
|
1122
|
+
arr.push( { active: !!(~~device.NewActive), ip: device.NewIPAddress, name: device.NewHostName, mac: device.NewMACAddress } );
|
|
1114
1123
|
}
|
|
1115
1124
|
});
|
|
1116
1125
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.tr-064",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.17",
|
|
4
4
|
"description": "ioBroker tr-064 Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "soef",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"mdns-discovery": "^0.2.6",
|
|
32
32
|
"tr-O64": "^0.2.4",
|
|
33
33
|
"xml2js": "^0.4.23",
|
|
34
|
-
"@iobroker/adapter-core": "^2.
|
|
34
|
+
"@iobroker/adapter-core": "^2.6.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@alcalzone/release-script": "^3.
|
|
38
|
-
"@alcalzone/release-script-plugin-iobroker": "^3.
|
|
39
|
-
"@alcalzone/release-script-plugin-license": "^3.
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"eslint": "^
|
|
37
|
+
"@alcalzone/release-script": "^3.5.9",
|
|
38
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
|
|
39
|
+
"@alcalzone/release-script-plugin-license": "^3.5.9",
|
|
40
|
+
"@iobroker/adapter-dev": "^1.1.0",
|
|
41
|
+
"@iobroker/dev-server": "^0.5.0",
|
|
42
|
+
"@iobroker/testing": "^4.1.0",
|
|
43
|
+
"mocha": "^10.0.0",
|
|
44
|
+
"chai": "^4.3.6",
|
|
45
|
+
"eslint": "^8.23.1"
|
|
46
46
|
},
|
|
47
47
|
"main": "main.js",
|
|
48
48
|
"scripts": {
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"release": "release-script",
|
|
54
54
|
"release-patch": "release-script patch --yes",
|
|
55
55
|
"release-minor": "release-script minor --yes",
|
|
56
|
-
"release-major": "release-script major --yes"
|
|
56
|
+
"release-major": "release-script major --yes",
|
|
57
|
+
"translate": "translate-adapter"
|
|
57
58
|
},
|
|
58
59
|
"engines": {
|
|
59
60
|
"node": ">=8.0.0"
|
package/.releaseconfig.json
DELETED
package/lib/tools.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Tests whether the given variable is a real object and not an Array
|
|
5
|
-
* @param {any} it The variable to test
|
|
6
|
-
* @returns {it is Record<string, any>}
|
|
7
|
-
*/
|
|
8
|
-
function isObject(it) {
|
|
9
|
-
// This is necessary because:
|
|
10
|
-
// typeof null === 'object'
|
|
11
|
-
// typeof [] === 'object'
|
|
12
|
-
// [] instanceof Object === true
|
|
13
|
-
return Object.prototype.toString.call(it) === '[object Object]';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Tests whether the given variable is really an Array
|
|
18
|
-
* @param {any} it The variable to test
|
|
19
|
-
* @returns {it is any[]}
|
|
20
|
-
*/
|
|
21
|
-
function isArray(it) {
|
|
22
|
-
if (Array.isArray != null) {
|
|
23
|
-
return Array.isArray(it);
|
|
24
|
-
}
|
|
25
|
-
return Object.prototype.toString.call(it) === '[object Array]';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Translates text using the Google Translate API
|
|
30
|
-
* @param {string} text The text to translate
|
|
31
|
-
* @param {string} targetLang The target languate
|
|
32
|
-
* @param {string} yandex api key
|
|
33
|
-
* @returns {Promise<string>}
|
|
34
|
-
*/
|
|
35
|
-
async function translateText(text, targetLang, yandex) {
|
|
36
|
-
if (targetLang === 'en') {
|
|
37
|
-
return text;
|
|
38
|
-
}
|
|
39
|
-
if (yandex) {
|
|
40
|
-
return await translateYandex(text, targetLang, yandex);
|
|
41
|
-
} else {
|
|
42
|
-
return await translateGoogle(text, targetLang);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function translateYandex(text, targetLang, yandex) {
|
|
47
|
-
if (targetLang === 'zh-cn') {
|
|
48
|
-
targetLang = 'zh';
|
|
49
|
-
}
|
|
50
|
-
try {
|
|
51
|
-
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${yandex}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
|
|
52
|
-
const response = await axios({url, timeout: 15000});
|
|
53
|
-
if (response.data && response.data['text']) {
|
|
54
|
-
return response.data['text'][0];
|
|
55
|
-
}
|
|
56
|
-
throw new Error('Invalid response for translate request');
|
|
57
|
-
} catch (e) {
|
|
58
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function translateGoogle(text, targetLang) {
|
|
63
|
-
try {
|
|
64
|
-
const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
|
|
65
|
-
const response = await axios({url, timeout: 15000});
|
|
66
|
-
if (isArray(response.data)) {
|
|
67
|
-
// we got a valid response
|
|
68
|
-
return response.data[0][0][0];
|
|
69
|
-
}
|
|
70
|
-
throw new Error('Invalid response for translate request');
|
|
71
|
-
} catch (e) {
|
|
72
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
module.exports = {
|
|
77
|
-
isArray,
|
|
78
|
-
isObject,
|
|
79
|
-
translateText
|
|
80
|
-
};
|