sip: fix hard coded value

This commit is contained in:
Koushik Dutta
2022-11-28 14:35:45 -08:00
parent 09e5cde42c
commit d0691411d7
3 changed files with 5 additions and 5 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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);