@voicenter-team/opensips-js 1.0.74 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/opensips-js.cjs.js +1 -1
- package/dist/opensips-js.es.js +10 -14
- package/dist/opensips-js.iife.js +1 -1
- package/dist/opensips-js.umd.js +1 -1
- package/package.json +1 -1
package/dist/opensips-js.es.js
CHANGED
|
@@ -20632,7 +20632,7 @@ class bT extends Jg {
|
|
|
20632
20632
|
...r.configuration,
|
|
20633
20633
|
sockets: r.socketInterfaces.map((a) => new uT.WebSocketInterface(a))
|
|
20634
20634
|
};
|
|
20635
|
-
super(o), this.initialized = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.muted = !1, this.isAutoAnswer = !1, this.isDNDEnabled = !1, this.muteWhenJoinEnabled = !1, this.activeRooms = {}, this.activeCalls = {}, this.extendedCalls = {}, this.activeMessages = {}, this.extendedMessages = {}, this.msrpHistory = {}, this.microphoneInputLevelValue =
|
|
20635
|
+
super(o), this.initialized = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.muted = !1, this.isAutoAnswer = !1, this.isDNDEnabled = !1, this.muteWhenJoinEnabled = !1, this.activeRooms = {}, this.activeCalls = {}, this.extendedCalls = {}, this.activeMessages = {}, this.extendedMessages = {}, this.msrpHistory = {}, this.microphoneInputLevelValue = 1, this.speakerVolumeValue = 1, this.availableMediaDevices = [], this.selectedMediaDevices = {
|
|
20636
20636
|
input: "default",
|
|
20637
20637
|
output: "default"
|
|
20638
20638
|
}, this.callStatus = {}, this.callTime = {}, this.callMetrics = {}, this.timeIntervals = {}, this.metricConfig = {
|
|
@@ -20710,12 +20710,6 @@ class bT extends Jg {
|
|
|
20710
20710
|
get getOutputDeviceList() {
|
|
20711
20711
|
return this.availableMediaDevices.filter((r) => r.kind === "audiooutput");
|
|
20712
20712
|
}
|
|
20713
|
-
/*getInputDeviceList: (state) => {
|
|
20714
|
-
return state.availableMediaDevices.filter(device => device.kind === 'audioinput');
|
|
20715
|
-
},
|
|
20716
|
-
getOutputDeviceList: (state) => {
|
|
20717
|
-
return state.availableMediaDevices.filter(device => device.kind === 'audiooutput');
|
|
20718
|
-
}*/
|
|
20719
20713
|
get getUserMediaConstraints() {
|
|
20720
20714
|
return {
|
|
20721
20715
|
audio: {
|
|
@@ -20886,7 +20880,7 @@ class bT extends Jg {
|
|
|
20886
20880
|
const n = /answer-after=0/, a = r.request.getHeader("Call-Info");
|
|
20887
20881
|
return a && n.test(a);
|
|
20888
20882
|
}
|
|
20889
|
-
|
|
20883
|
+
addCall(r, n = !0) {
|
|
20890
20884
|
this.activeCalls = {
|
|
20891
20885
|
...this.activeCalls,
|
|
20892
20886
|
[r._id]: nf(r)
|
|
@@ -20945,7 +20939,7 @@ class bT extends Jg {
|
|
|
20945
20939
|
});
|
|
20946
20940
|
}
|
|
20947
20941
|
getActiveStream() {
|
|
20948
|
-
const r = lf(this.initialStreamValue, this.microphoneInputLevel);
|
|
20942
|
+
const r = lf(this.initialStreamValue, this.microphoneInputLevel * 2);
|
|
20949
20943
|
return r.getTracks().forEach((n) => n.enabled = !this.isMuted), this.setActiveStream(r), r;
|
|
20950
20944
|
}
|
|
20951
20945
|
async setMicrophone(r) {
|
|
@@ -21131,7 +21125,7 @@ class bT extends Jg {
|
|
|
21131
21125
|
...n
|
|
21132
21126
|
};
|
|
21133
21127
|
}
|
|
21134
|
-
async
|
|
21128
|
+
async setupCall(r) {
|
|
21135
21129
|
var d, g;
|
|
21136
21130
|
const n = r.session;
|
|
21137
21131
|
if (this.getActiveCalls[n.id] !== void 0)
|
|
@@ -21153,7 +21147,7 @@ class bT extends Jg {
|
|
|
21153
21147
|
}), this.deleteRoomIfEmpty(a));
|
|
21154
21148
|
})) : n.direction === "outgoing" && this.startCallTimer(n.id);
|
|
21155
21149
|
const s = n, p = this.hasAutoAnswerHeaders(r), h = s.direction === "incoming" && !this.hasActiveCalls && (p || this.autoAnswer);
|
|
21156
|
-
s.roomId = a, s.localMuted = !1, s.autoAnswer = h, h ? this.
|
|
21150
|
+
s.roomId = a, s.localMuted = !1, s.autoAnswer = h, h ? this.addCall(s, !1) : this.addCall(s), this.addCallStatus(n.id), this.addRoom(t), h && this.answerCall(s._id);
|
|
21157
21151
|
}
|
|
21158
21152
|
addMessageSession(r) {
|
|
21159
21153
|
if (!r._id || this.getActiveMessages[r._id] !== void 0)
|
|
@@ -21245,7 +21239,7 @@ class bT extends Jg {
|
|
|
21245
21239
|
session: n,
|
|
21246
21240
|
event: o
|
|
21247
21241
|
}), this.updateCall(n), n.id === this.callAddingInProgress && (this.callAddingInProgress = void 0);
|
|
21248
|
-
}), await this.
|
|
21242
|
+
}), await this.setupCall(r), n.direction === "outgoing") {
|
|
21249
21243
|
const o = this.getActiveCalls[n.id].roomId;
|
|
21250
21244
|
this.setActiveRoom(o);
|
|
21251
21245
|
}
|
|
@@ -21317,7 +21311,9 @@ class bT extends Jg {
|
|
|
21317
21311
|
setMuteWhenJoin(r) {
|
|
21318
21312
|
this.muteWhenJoinEnabled = r, this.emit("changeMuteWhenJoin", r);
|
|
21319
21313
|
}
|
|
21320
|
-
|
|
21314
|
+
setMicrophoneSensitivity(r) {
|
|
21315
|
+
if (r < 0 || r > 2)
|
|
21316
|
+
throw new Error("Value should be in range from 0 to 2!");
|
|
21321
21317
|
this.microphoneInputLevelValue = r, this.roomReconfigure(this.currentActiveRoomId);
|
|
21322
21318
|
}
|
|
21323
21319
|
setSpeakerVolume(r) {
|
|
@@ -21377,7 +21373,7 @@ class bT extends Jg {
|
|
|
21377
21373
|
}
|
|
21378
21374
|
async triggerAddStream(r, n) {
|
|
21379
21375
|
this.setIsMuted(this.muteWhenJoin || this.isMuted), this.initialStreamValue || await this.setupStream();
|
|
21380
|
-
const o = lf(this.initialStreamValue, this.microphoneInputLevel), a = this.isMuted || this.muteWhenJoin;
|
|
21376
|
+
const o = lf(this.initialStreamValue, this.microphoneInputLevel * 2), a = this.isMuted || this.muteWhenJoin;
|
|
21381
21377
|
o.getTracks().forEach((t) => t.enabled = !a), this.setActiveStream(o), await n.connection.getSenders()[0].replaceTrack(o.getTracks()[0]), nv(r, n, this.selectedOutputDevice, this.speakerVolume), this.setupVUMeter(r.stream, n._id), this.getCallQuality(n), this.updateCall(n);
|
|
21382
21378
|
}
|
|
21383
21379
|
initCall(r, n) {
|