@voicenter-team/opensips-js 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SessionDirection = void 0;
|
4
|
+
const RTCSession_1 = require("jssip/lib/RTCSession");
|
5
|
+
Object.defineProperty(exports, "SessionDirection", { enumerable: true, get: function () { return RTCSession_1.SessionDirection; } });
|
package/build/index.js
CHANGED
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const jssip_1 = __importDefault(require("jssip"));
|
16
16
|
const UA_1 = __importDefault(require("./helpers/UA"));
|
17
|
-
const RTCSession_1 = require("jssip/lib/RTCSession");
|
18
17
|
const p_iteration_1 = require("p-iteration");
|
19
18
|
const time_helper_1 = require("./helpers/time.helper");
|
20
19
|
const filter_helper_1 = require("./helpers/filter.helper");
|
@@ -272,7 +271,7 @@ class OpenSIPSJS extends UA_1.default {
|
|
272
271
|
}
|
273
272
|
_cancelAllOutgoingUnanswered() {
|
274
273
|
Object.values(this.getActiveCalls).filter(call => {
|
275
|
-
return call.direction ===
|
274
|
+
return call.direction === 'outgoing'
|
276
275
|
&& call.status === CALL_STATUS_UNANSWERED;
|
277
276
|
}).forEach(call => this.callTerminate(call._id));
|
278
277
|
}
|
@@ -413,7 +412,7 @@ class OpenSIPSJS extends UA_1.default {
|
|
413
412
|
if (Object.values(activeCalls).filter(call => call.roomId === roomId).length === 0) {
|
414
413
|
this.removeRoom(roomId);
|
415
414
|
if (this.currentActiveRoomId === roomId) {
|
416
|
-
this.currentActiveRoomId =
|
415
|
+
this.currentActiveRoomId = undefined;
|
417
416
|
}
|
418
417
|
}
|
419
418
|
}
|
@@ -648,7 +647,7 @@ class OpenSIPSJS extends UA_1.default {
|
|
648
647
|
incomingInProgress: false,
|
649
648
|
roomId
|
650
649
|
};
|
651
|
-
if (session.direction ===
|
650
|
+
if (session.direction === 'incoming') {
|
652
651
|
newRoomInfo.incomingInProgress = true;
|
653
652
|
this.subscribe(call_event_listener_type_1.CALL_EVENT_LISTENER_TYPE.CALL_CONFIRMED, (call) => {
|
654
653
|
if (session.id === call.id) {
|
@@ -668,13 +667,13 @@ class OpenSIPSJS extends UA_1.default {
|
|
668
667
|
}
|
669
668
|
});
|
670
669
|
}
|
671
|
-
else if (session.direction ===
|
670
|
+
else if (session.direction === 'outgoing') {
|
672
671
|
this._startCallTimer(session.id);
|
673
672
|
}
|
674
673
|
const call = session;
|
675
674
|
call.roomId = roomId;
|
676
675
|
call.localMuted = false;
|
677
|
-
const doAutoAnswer = call.direction ===
|
676
|
+
const doAutoAnswer = call.direction === 'incoming' && this.autoAnswer;
|
678
677
|
if (doAutoAnswer) {
|
679
678
|
this._addCall(call, false);
|
680
679
|
}
|
@@ -720,6 +719,8 @@ class OpenSIPSJS extends UA_1.default {
|
|
720
719
|
session.on('ended', (event) => {
|
721
720
|
this._triggerListener({ listenerType: call_event_listener_type_1.CALL_EVENT_LISTENER_TYPE.CALL_ENDED, session, event });
|
722
721
|
const s = this.getActiveCalls[session.id];
|
722
|
+
if (!s)
|
723
|
+
return;
|
723
724
|
this._activeCallListRemove(s);
|
724
725
|
this._stopCallTimer(session.id);
|
725
726
|
this._removeCallStatus(session.id);
|
@@ -753,7 +754,7 @@ class OpenSIPSJS extends UA_1.default {
|
|
753
754
|
}
|
754
755
|
});
|
755
756
|
this.addCall(session);
|
756
|
-
if (session.direction ===
|
757
|
+
if (session.direction === 'outgoing') {
|
757
758
|
const roomId = this.getActiveCalls[session.id].roomId;
|
758
759
|
this.setCurrentActiveRoomId(roomId);
|
759
760
|
}
|