From d0691411d78cb686014bf3c034c5795dce5adcec Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 28 Nov 2022 14:35:45 -0800 Subject: [PATCH] sip: fix hard coded value --- plugins/sip/package-lock.json | 4 ++-- plugins/sip/package.json | 2 +- plugins/sip/src/main.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sip/package-lock.json b/plugins/sip/package-lock.json index b3de2f84e..dc8e00285 100644 --- a/plugins/sip/package-lock.json +++ b/plugins/sip/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/sip", - "version": "0.0.3", + "version": "0.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/sip", - "version": "0.0.3", + "version": "0.0.4", "dependencies": { "@homebridge/camera-utils": "^2.0.4", "rxjs": "^7.5.5", diff --git a/plugins/sip/package.json b/plugins/sip/package.json index d627a4e16..02199645d 100644 --- a/plugins/sip/package.json +++ b/plugins/sip/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/sip", - "version": "0.0.3", + "version": "0.0.4", "scripts": { "scrypted-setup-project": "scrypted-setup-project", "prescrypted-setup-project": "scrypted-package-json", diff --git a/plugins/sip/src/main.ts b/plugins/sip/src/main.ts index 93f9094fb..4ba448490 100644 --- a/plugins/sip/src/main.ts +++ b/plugins/sip/src/main.ts @@ -181,7 +181,7 @@ class SipCamera extends ScryptedDeviceBase implements Intercom, Camera, VideoCam const from = this.storage.getItem('sipfrom'); const to = this.storage.getItem('sipto'); const localIp = from.split(':')[0].split('@')[1]; - const localPort = from.split(':')[1] ?? 5060; + const localPort = parseInt(from.split(':')[1]) || 5060; if (!from || !to || !localIp || !localPort) { this.console.error('SIP From: and To: URIs not specified!'); @@ -191,7 +191,7 @@ class SipCamera extends ScryptedDeviceBase implements Intercom, Camera, VideoCam this.console.log(`SIP: Calling doorbell: From: ${from}, To: ${to}`); this.console.log(`SIP: localIp: ${localIp}, localPort: ${localPort}`); - let sipOptions: SipOptions = { from: "sip:" + from, to: "sip:" + to, localIp: "10.10.10.70", localPort: 5060 }; + let sipOptions: SipOptions = { from: "sip:" + from, to: "sip:" + to, localIp, localPort }; sip = await SipSession.createSipSession(this.console, this.name, sipOptions); sip.onCallEnded.subscribe(cleanup);