@voicenter-team/opensips-js 1.0.80 → 1.0.82
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/dist/index.d.ts +7 -1
- package/dist/opensips-js.cjs.js +2 -2
- package/dist/opensips-js.es.js +18 -12
- package/dist/opensips-js.iife.js +2 -2
- package/dist/opensips-js.umd.js +2 -2
- package/package.json +1 -1
- package/src/types/rtc.d.ts +1 -1
package/dist/opensips-js.es.js
CHANGED
@@ -17764,7 +17764,7 @@ class Io extends ct.EventEmitter {
|
|
17764
17764
|
* Initial Request Sender
|
17765
17765
|
*/
|
17766
17766
|
_sendInitialRequest(n, r, o) {
|
17767
|
-
this.ackSent = !1;
|
17767
|
+
this.ackSent = !1, this.publisherSubscribeSent = !1;
|
17768
17768
|
const a = new t_(this._ua, this._request, {
|
17769
17769
|
onRequestTimeout: () => {
|
17770
17770
|
this.onRequestTimeout();
|
@@ -17845,7 +17845,7 @@ class Io extends ct.EventEmitter {
|
|
17845
17845
|
this.sendRequest(G.ACK), this.sendRequest(G.BYE);
|
17846
17846
|
return;
|
17847
17847
|
}
|
17848
|
-
if (this.ackSent) {
|
17848
|
+
if (this.ackSent && !this.publisherSubscribeSent) {
|
17849
17849
|
const r = JSON.parse(n.body);
|
17850
17850
|
this.session_id = r.session_id, this.handle_id = r.data.id;
|
17851
17851
|
const a = {
|
@@ -17860,10 +17860,10 @@ class Io extends ct.EventEmitter {
|
|
17860
17860
|
},
|
17861
17861
|
handle_id: this.handle_id
|
17862
17862
|
}, t = ["PTYPE: Publisher"];
|
17863
|
-
|
17863
|
+
this.sendRequest(G.SUBSCRIBE, {
|
17864
17864
|
extraHeaders: t,
|
17865
17865
|
body: JSON.stringify(a)
|
17866
|
-
});
|
17866
|
+
}), this.publisherSubscribeSent = !0;
|
17867
17867
|
}
|
17868
17868
|
if (this._is_canceled) {
|
17869
17869
|
console.log("IF 2 canceled"), n.status_code >= 100 && n.status_code < 200 ? this._request.cancel(this._cancel_reason) : n.status_code >= 200 && n.status_code < 299 && (console.log("IF 2 _acceptAndTerminate"), this._acceptAndTerminate(n));
|
@@ -22442,7 +22442,10 @@ class wv {
|
|
22442
22442
|
return this.availableMediaDevices.filter((n) => n.kind === "audiooutput");
|
22443
22443
|
}
|
22444
22444
|
get getUserMediaConstraints() {
|
22445
|
-
return {
|
22445
|
+
return /Mobi|Android|iPhone/i.test(navigator.userAgent) ? {
|
22446
|
+
video: !1,
|
22447
|
+
audio: !0
|
22448
|
+
} : {
|
22446
22449
|
audio: {
|
22447
22450
|
deviceId: {
|
22448
22451
|
exact: this.selectedMediaDevices.input
|
@@ -22470,12 +22473,15 @@ class wv {
|
|
22470
22473
|
}
|
22471
22474
|
async initializeMediaDevices() {
|
22472
22475
|
const n = localStorage.getItem(to.SELECTED_INPUT_DEVICE) || "default", r = localStorage.getItem(to.SELECTED_OUTPUT_DEVICE) || "default";
|
22473
|
-
|
22474
|
-
|
22475
|
-
|
22476
|
-
|
22477
|
-
|
22478
|
-
|
22476
|
+
try {
|
22477
|
+
const o = await navigator.mediaDevices.getUserMedia(this.getUserMediaConstraints), a = await navigator.mediaDevices.enumerateDevices();
|
22478
|
+
this.setAvailableMediaDevices(a), await this.setMicrophone(n), await this.setSpeaker(r), navigator.mediaDevices.addEventListener("devicechange", async () => {
|
22479
|
+
const t = await navigator.mediaDevices.enumerateDevices();
|
22480
|
+
this.setAvailableMediaDevices(t);
|
22481
|
+
}), o.getTracks().forEach((t) => t.stop());
|
22482
|
+
} catch (o) {
|
22483
|
+
console.error(o);
|
22484
|
+
}
|
22479
22485
|
}
|
22480
22486
|
setCallTime(n) {
|
22481
22487
|
const r = { ...n };
|
@@ -22931,7 +22937,7 @@ class wv {
|
|
22931
22937
|
}
|
22932
22938
|
setCallMetrics(n) {
|
22933
22939
|
const r = { ...n };
|
22934
|
-
delete r.callId,
|
22940
|
+
delete r.callId, this.callMetrics = {
|
22935
22941
|
...this.callMetrics,
|
22936
22942
|
[n.callId]: r
|
22937
22943
|
}, this.context.emit("changeCallMetrics", this.callMetrics);
|