@voicenter-team/opensips-js 1.0.80 → 1.0.82

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- console.log("JOIN MESSAGE", a), this.sendRequest(G.SUBSCRIBE, {
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
- (await navigator.mediaDevices.getUserMedia(this.getUserMediaConstraints)).getTracks().forEach((t) => t.stop());
22474
- const a = await navigator.mediaDevices.enumerateDevices();
22475
- this.setAvailableMediaDevices(a), await this.setMicrophone(n), await this.setSpeaker(r), navigator.mediaDevices.addEventListener("devicechange", async () => {
22476
- const t = await navigator.mediaDevices.enumerateDevices();
22477
- this.setAvailableMediaDevices(t);
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, console.log("setCallMetrics", r), this.callMetrics = {
22940
+ delete r.callId, this.callMetrics = {
22935
22941
  ...this.callMetrics,
22936
22942
  [n.callId]: r
22937
22943
  }, this.context.emit("changeCallMetrics", this.callMetrics);