From b9d57f04dc8109652fbd346279a57911e119a0ff Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 7 May 2023 14:22:56 +0200 Subject: [PATCH] `oh-sipclient`: Various fixes & improvements (#1857) Closes #1690. Closes #1691. * Improves alert message shown when HTTP is used to clearly indicate that the SIP widget will only work with HTTPS. * Fixes an error thrown when the SIP widget was not properly initialized and leaves foreground. * Upgrades JsSIP. * Improves styling to use 100% of available height. -- Signed-off-by: Florian Hotze --- .../doc/components/oh-sipclient-card.md | 5 +++ .../doc/components/oh-sipclient.md | 5 +++ bundles/org.openhab.ui/web/package-lock.json | 38 ++++++++++++------- bundles/org.openhab.ui/web/package.json | 2 +- .../definitions/widgets/system/sipclient.js | 1 + .../widgets/system/oh-sipclient.vue | 37 +++++++++++------- 6 files changed, 61 insertions(+), 27 deletions(-) diff --git a/bundles/org.openhab.ui/doc/components/oh-sipclient-card.md b/bundles/org.openhab.ui/doc/components/oh-sipclient-card.md index 539ebdef5..a0f2fda3c 100644 --- a/bundles/org.openhab.ui/doc/components/oh-sipclient-card.md +++ b/bundles/org.openhab.ui/doc/components/oh-sipclient-card.md @@ -113,6 +113,11 @@ Usage is explained at the [`oh-sipclient` component docs](/docs/ui/components/oh Default video aspect ratio used to size the widget before video is loaded. Defaults to 4/3, 16/9 and 1 are common alternatives. + + + SIP registration can be disabled in case you only want to initiate calls, but not receive calls with the SIP widgets. + + diff --git a/bundles/org.openhab.ui/doc/components/oh-sipclient.md b/bundles/org.openhab.ui/doc/components/oh-sipclient.md index 4c9f449b0..de420ffeb 100644 --- a/bundles/org.openhab.ui/doc/components/oh-sipclient.md +++ b/bundles/org.openhab.ui/doc/components/oh-sipclient.md @@ -117,6 +117,11 @@ This can be achieved by configuring the widget as usual, but setting SIP usernam Default video aspect ratio used to size the widget before video is loaded. Defaults to 4/3, 16/9 and 1 are common alternatives. + + + SIP registration can be disabled in case you only want to initiate calls, but not receive calls with the SIP widgets. + + diff --git a/bundles/org.openhab.ui/web/package-lock.json b/bundles/org.openhab.ui/web/package-lock.json index 6d6d97a22..1f6ef30aa 100644 --- a/bundles/org.openhab.ui/web/package-lock.json +++ b/bundles/org.openhab.ui/web/package-lock.json @@ -29,7 +29,7 @@ "framework7-icons": "^3.0.1", "framework7-vue": "^5.7.12", "jse-eval": "^1.5.1", - "jssip": "^3.9.1", + "jssip": "^3.10.0", "leaflet": "^1.7.1", "leaflet-providers": "^1.11.0", "lodash": "^4.17.20", @@ -3915,6 +3915,11 @@ "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", "dev": true }, + "node_modules/@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + }, "node_modules/@types/glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", @@ -3991,7 +3996,8 @@ "node_modules/@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==" + "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==", + "dev": true }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -14022,12 +14028,12 @@ } }, "node_modules/jssip": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.9.1.tgz", - "integrity": "sha512-hl8jxkte4p0zHl9Nen03rdwP8lbBwMy3SnrmzVf7f+Jhvnz7gF/WXdFi35zpEpxAmxFLczxD4U8ATK/CHEwhqw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.10.0.tgz", + "integrity": "sha512-iJj+bhnNl0S296sUDc2ZjIbAetnelzZ92aWARyW01oKZ0X8t+5aGrYfJdMFliLFm8hxMcnkep3vmSRGe/yRjsA==", "dependencies": { - "@types/debug": "^4.1.5", - "@types/node": "^14.14.34", + "@types/debug": "^4.1.7", + "@types/events": "^3.0.0", "debug": "^4.3.1", "events": "^3.3.0", "sdp-transform": "^2.14.1" @@ -27509,6 +27515,11 @@ "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", "dev": true }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + }, "@types/glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", @@ -27585,7 +27596,8 @@ "@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==" + "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==", + "dev": true }, "@types/parse-json": { "version": "4.0.0", @@ -35880,12 +35892,12 @@ } }, "jssip": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.9.1.tgz", - "integrity": "sha512-hl8jxkte4p0zHl9Nen03rdwP8lbBwMy3SnrmzVf7f+Jhvnz7gF/WXdFi35zpEpxAmxFLczxD4U8ATK/CHEwhqw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.10.0.tgz", + "integrity": "sha512-iJj+bhnNl0S296sUDc2ZjIbAetnelzZ92aWARyW01oKZ0X8t+5aGrYfJdMFliLFm8hxMcnkep3vmSRGe/yRjsA==", "requires": { - "@types/debug": "^4.1.5", - "@types/node": "^14.14.34", + "@types/debug": "^4.1.7", + "@types/events": "^3.0.0", "debug": "^4.3.1", "events": "^3.3.0", "sdp-transform": "^2.14.1" diff --git a/bundles/org.openhab.ui/web/package.json b/bundles/org.openhab.ui/web/package.json index 3a10b122c..85596771b 100644 --- a/bundles/org.openhab.ui/web/package.json +++ b/bundles/org.openhab.ui/web/package.json @@ -81,7 +81,7 @@ "framework7-icons": "^3.0.1", "framework7-vue": "^5.7.12", "jse-eval": "^1.5.1", - "jssip": "^3.9.1", + "jssip": "^3.10.0", "leaflet": "^1.7.1", "leaflet-providers": "^1.11.0", "lodash": "^4.17.20", diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/system/sipclient.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/system/sipclient.js index 8959aacd1..a52d025f3 100644 --- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/system/sipclient.js +++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/system/sipclient.js @@ -13,5 +13,6 @@ export default () => [ pb('enableVideo', 'Enable Video', 'Enable video calling'), pb('enableLocalVideo', 'Enable Local Video View', 'Display the local camera on video calls'), pt('defaultVideoAspectRatio', 'Default Aspect Ratio', 'Default video aspect ratio used to size the widget before video is loaded. Defaults to 4/3, 16/9 and 1 are common alternatives.').a(), + pb('disableRegister', 'Disable REGISTER', 'SIP registration can be disabled in case you only want to initiate calls, but not receive calls with the SIP widgets.').a(), pb('enableSIPDebug', 'Enable SIP debugging to the browser console (dev tools)').a() ] diff --git a/bundles/org.openhab.ui/web/src/components/widgets/system/oh-sipclient.vue b/bundles/org.openhab.ui/web/src/components/widgets/system/oh-sipclient.vue index ebc610264..78dddf7e4 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/system/oh-sipclient.vue +++ b/bundles/org.openhab.ui/web/src/components/widgets/system/oh-sipclient.vue @@ -10,23 +10,23 @@