mirror of
https://github.com/koush/scrypted.git
synced 2026-03-20 16:40:24 +00:00
sip: fix hard coded value
This commit is contained in:
4
plugins/sip/package-lock.json
generated
4
plugins/sip/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user