opensips-js-vue 0.1.7 → 0.1.8
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/library/index.d.ts +9 -9
- package/library/super.mjs +20 -13
- package/library/super.mjs.map +1 -1
- package/library/super.umd.js +2 -2
- package/library/super.umd.js.map +1 -1
- package/package.json +2 -2
package/library/index.d.ts
CHANGED
|
@@ -96,14 +96,6 @@ export declare type conferenceStartListener = () => void
|
|
|
96
96
|
|
|
97
97
|
export declare type connectionListener = (value: boolean) => void
|
|
98
98
|
|
|
99
|
-
declare interface ConnectOptions {
|
|
100
|
-
domain: string
|
|
101
|
-
username: string
|
|
102
|
-
modules: Array<'audio' | 'video'>
|
|
103
|
-
password?: string
|
|
104
|
-
authorization_jwt?: string
|
|
105
|
-
}
|
|
106
|
-
|
|
107
99
|
export declare interface CustomLoggerType {
|
|
108
100
|
log: CommonLogMethodType
|
|
109
101
|
warn: CommonLogMethodType
|
|
@@ -247,6 +239,14 @@ export declare type MSRPSessionListener = IncomingMSRPSessionListener | Outgoing
|
|
|
247
239
|
|
|
248
240
|
export declare type OnTransportCallback = (parsed: object, message: string) => void
|
|
249
241
|
|
|
242
|
+
export declare interface OpensipsConnectOptions {
|
|
243
|
+
domain: string
|
|
244
|
+
username: string
|
|
245
|
+
modules: Array<'audio' | 'video'>
|
|
246
|
+
password?: string
|
|
247
|
+
authorization_jwt?: string
|
|
248
|
+
}
|
|
249
|
+
|
|
250
250
|
export declare interface OpenSIPSEventMap extends UAEventMap {
|
|
251
251
|
ready: readyListener
|
|
252
252
|
connection: connectionListener
|
|
@@ -412,7 +412,7 @@ export declare interface VsipAPI {
|
|
|
412
412
|
export declare const vsipAPI: VsipAPI;
|
|
413
413
|
|
|
414
414
|
declare interface VsipAPIActions {
|
|
415
|
-
init(credentials:
|
|
415
|
+
init(credentials: OpensipsConnectOptions, pnExtraHeaders?: PNExtraHeaders, opensipsConfiguration?: Partial<InitOpensipsConfiguration>): Promise<unknown>
|
|
416
416
|
unregister: () => void
|
|
417
417
|
register: () => void
|
|
418
418
|
disconnect: () => void
|
package/library/super.mjs
CHANGED
|
@@ -20182,6 +20182,7 @@ function Zh(l) {
|
|
|
20182
20182
|
}
|
|
20183
20183
|
function ed(l, s, n) {
|
|
20184
20184
|
return re(this, null, function* () {
|
|
20185
|
+
console.log("LLL processAudioVolume", s);
|
|
20185
20186
|
const i = l.createMediaStreamSource(s), a = l.createMediaStreamDestination(), e = l.createGain();
|
|
20186
20187
|
return i.connect(e), e.connect(a), e.gain.value = n, a.stream;
|
|
20187
20188
|
});
|
|
@@ -23507,7 +23508,7 @@ class Qy {
|
|
|
23507
23508
|
output: "default"
|
|
23508
23509
|
}, this.callStatus = {}, this.callTime = {}, this.callMetrics = {}, this.timeIntervals = {}, this.metricConfig = {
|
|
23509
23510
|
refreshEvery: 1e3
|
|
23510
|
-
}, this.activeStreamValue = null, this.initialStreamValue = null, this.managedAudioContext = new zy(), this.context = s, this.context.on(
|
|
23511
|
+
}, this.activeStreamValue = null, this.initialStreamValue = null, this.managedAudioContext = new zy(), this.context = s, console.log("LLL audio onstructor"), this.context.on(
|
|
23511
23512
|
this.context.newRTCSessionEventName,
|
|
23512
23513
|
this.newRTCSessionCallback.bind(this)
|
|
23513
23514
|
), this.VUMeter = new Yy({
|
|
@@ -23887,6 +23888,7 @@ class Qy {
|
|
|
23887
23888
|
}
|
|
23888
23889
|
getActiveStream() {
|
|
23889
23890
|
return re(this, null, function* () {
|
|
23891
|
+
console.log("getActiveStream", this.initialStreamValue);
|
|
23890
23892
|
const s = yield ed(yield this.managedAudioContext.getContext(), this.initialStreamValue, this.microphoneInputLevel * 2);
|
|
23891
23893
|
return s.getTracks().forEach((n) => n.enabled = !this.isMuted), yield this.setActiveStream(s), s;
|
|
23892
23894
|
});
|
|
@@ -23969,8 +23971,11 @@ class Qy {
|
|
|
23969
23971
|
const d = (((n = e.connection) == null ? void 0 : n.getSenders()) || [])[0];
|
|
23970
23972
|
if (e.connection && d)
|
|
23971
23973
|
try {
|
|
23972
|
-
|
|
23973
|
-
|
|
23974
|
+
console.log("LLL in roomReconfigure");
|
|
23975
|
+
const _ = yield this.getActiveStream();
|
|
23976
|
+
console.log("LLL in roomReconfigure processedStream", _);
|
|
23977
|
+
const u = _.getTracks();
|
|
23978
|
+
yield d.replaceTrack(u[0]), this.muteReconfigure(e);
|
|
23974
23979
|
} catch (_) {
|
|
23975
23980
|
console.error(_);
|
|
23976
23981
|
}
|
|
@@ -24249,7 +24254,7 @@ class Qy {
|
|
|
24249
24254
|
event: i
|
|
24250
24255
|
});
|
|
24251
24256
|
const _ = this.getActiveCalls[n.id];
|
|
24252
|
-
_ && this.activeCallListRemove(_), this.stopCallTimer(n.id), this.removeCallStatus(n.id), this.removeCallMetrics(n.id), Object.keys(this.extendedCalls).length || (this.setIsMuted(!1), (d = this.initialStreamValue) == null || d.getTracks().forEach((u) => u.stop()), this.initialStreamValue = null), this.context.isWaitingForSessionHangup() && !this.hasActiveAnsweredCalls && this.context.stopSessionAfterWaiting();
|
|
24257
|
+
_ && this.activeCallListRemove(_), this.stopCallTimer(n.id), this.removeCallStatus(n.id), this.removeCallMetrics(n.id), Object.keys(this.extendedCalls).length || (this.setIsMuted(!1), (d = this.initialStreamValue) == null || d.getTracks().forEach((u) => u.stop()), console.log("LLL this.initialStreamValue = null 1"), this.initialStreamValue = null), this.context.isWaitingForSessionHangup() && !this.hasActiveAnsweredCalls && this.context.stopSessionAfterWaiting();
|
|
24253
24258
|
}), n.on("progress", (i) => {
|
|
24254
24259
|
var a, e;
|
|
24255
24260
|
this.context.logger.log("Session in progress for", (e = (a = n._remote_identity) == null ? void 0 : a._uri) == null ? void 0 : e._user), this.context.triggerListener({
|
|
@@ -24265,7 +24270,7 @@ class Qy {
|
|
|
24265
24270
|
event: i
|
|
24266
24271
|
}), n.id === this.callAddingInProgress && (this.callAddingInProgress = void 0);
|
|
24267
24272
|
const _ = this.getActiveCalls[n.id];
|
|
24268
|
-
_ && this.activeCallListRemove(_), this.stopCallTimer(n.id), this.removeCallStatus(n.id), this.removeCallMetrics(n.id), Object.keys(this.extendedCalls).length || (this.setIsMuted(!1), (d = this.initialStreamValue) == null || d.getTracks().forEach((u) => u.stop()), this.initialStreamValue = null), this.context.isWaitingForSessionHangup() && !this.hasActiveAnsweredCalls && this.context.stopSessionAfterWaiting();
|
|
24273
|
+
_ && this.activeCallListRemove(_), this.stopCallTimer(n.id), this.removeCallStatus(n.id), this.removeCallMetrics(n.id), Object.keys(this.extendedCalls).length || (this.setIsMuted(!1), (d = this.initialStreamValue) == null || d.getTracks().forEach((u) => u.stop()), console.log("LLL this.initialStreamValue = null 2"), this.initialStreamValue = null), this.context.isWaitingForSessionHangup() && !this.hasActiveAnsweredCalls && this.context.stopSessionAfterWaiting();
|
|
24269
24274
|
}), n.on("confirmed", (i) => {
|
|
24270
24275
|
var a, e;
|
|
24271
24276
|
this.context.logger.log("Session confirmed for", (e = (a = n._remote_identity) == null ? void 0 : a._uri) == null ? void 0 : e._user), this.context.triggerListener({
|
|
@@ -24341,9 +24346,9 @@ class Qy {
|
|
|
24341
24346
|
return re(this, null, function* () {
|
|
24342
24347
|
try {
|
|
24343
24348
|
const s = Date.now(), n = yield navigator.mediaDevices.getUserMedia(this.getUserMediaConstraints);
|
|
24344
|
-
this.initialStreamValue && (this.initialStreamValue.getTracks().forEach((i, a) => {
|
|
24349
|
+
console.log("LLL this.getUserMediaConstraints", this.getUserMediaConstraints), this.initialStreamValue && (this.initialStreamValue.getTracks().forEach((i, a) => {
|
|
24345
24350
|
i.stop();
|
|
24346
|
-
}), this.initialStreamValue = null), this.initialStreamValue = n;
|
|
24351
|
+
}), console.log("LLL this.initialStreamValue = null 3"), this.initialStreamValue = null), console.log("LLL this.initialStreamValue = stream", n), this.initialStreamValue = n;
|
|
24347
24352
|
} catch (s) {
|
|
24348
24353
|
throw s;
|
|
24349
24354
|
}
|
|
@@ -24352,8 +24357,10 @@ class Qy {
|
|
|
24352
24357
|
triggerAddStream(s, n) {
|
|
24353
24358
|
return re(this, null, function* () {
|
|
24354
24359
|
const i = this.muteWhenJoin || this.isMuted;
|
|
24355
|
-
this.setIsMuted(i), this.initialStreamValue || (yield this.setupStream());
|
|
24356
|
-
const a = yield this.managedAudioContext.getContext()
|
|
24360
|
+
this.setIsMuted(i), console.log("LLL triggerAddStream this.initialStreamValue", this.initialStreamValue), this.initialStreamValue || (yield this.setupStream());
|
|
24361
|
+
const a = yield this.managedAudioContext.getContext();
|
|
24362
|
+
console.log("LLL triggerAddStream", this.initialStreamValue);
|
|
24363
|
+
const e = yield ed(a, this.initialStreamValue, this.microphoneInputLevel * 2), d = this.isMuted || this.muteWhenJoin;
|
|
24357
24364
|
e.getTracks().forEach((g) => {
|
|
24358
24365
|
g.enabled = !d;
|
|
24359
24366
|
}), yield this.setActiveStream(e), yield n.connection.getSenders()[0].replaceTrack(e.getTracks()[0]);
|
|
@@ -24381,7 +24388,7 @@ class Qy {
|
|
|
24381
24388
|
this.holdCall(d._id, !0);
|
|
24382
24389
|
}
|
|
24383
24390
|
a.connection.addEventListener("track", (e) => {
|
|
24384
|
-
this.triggerAddStream(e, a);
|
|
24391
|
+
console.log("LLL initCall triggerAddStream"), this.triggerAddStream(e, a);
|
|
24385
24392
|
});
|
|
24386
24393
|
}
|
|
24387
24394
|
processRoomChange(i) {
|
|
@@ -24844,7 +24851,7 @@ class tE extends __ {
|
|
|
24844
24851
|
}
|
|
24845
24852
|
class nE extends Ov {
|
|
24846
24853
|
constructor(s, n) {
|
|
24847
|
-
if (!s.modules.length)
|
|
24854
|
+
if (console.log("LLL opensips constructor"), !s.modules.length)
|
|
24848
24855
|
throw new Error("options.modules should include at least 1 module");
|
|
24849
24856
|
const i = nt(ie({}, s.configuration), {
|
|
24850
24857
|
sockets: s.socketInterfaces.map((a) => new Qv.WebSocketInterface(a))
|
|
@@ -24896,11 +24903,11 @@ class nE extends Ov {
|
|
|
24896
24903
|
this.emit("reconnectionAttemptsLimitReached", void 0);
|
|
24897
24904
|
}
|
|
24898
24905
|
begin() {
|
|
24899
|
-
if (this.isConnected()) {
|
|
24906
|
+
if (console.log("LLL begin"), this.isConnected()) {
|
|
24900
24907
|
console.error("Connection is already established");
|
|
24901
24908
|
return;
|
|
24902
24909
|
}
|
|
24903
|
-
return this.modules.includes(nl.AUDIO) && (this.audio = new Qy(this)), this.modules.includes(nl.MSRP) && (this.msrp = new Zy(this)), this.modules.includes(nl.VIDEO) && (this.video = new Jy(this)), this.on(
|
|
24910
|
+
return this.modules.includes(nl.AUDIO) && (console.log("LLL new AudioModule"), this.audio = new Qy(this)), this.modules.includes(nl.MSRP) && (this.msrp = new Zy(this)), this.modules.includes(nl.VIDEO) && (this.video = new Jy(this)), this.on(
|
|
24904
24911
|
this.registeredEventName,
|
|
24905
24912
|
() => {
|
|
24906
24913
|
this.logger.log("Successfully registered to", this.options.socketInterfaces[0]), this.setInitialized(!0);
|