@voicenter-team/opensips-js 1.0.123 → 1.0.125

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.
@@ -16835,7 +16835,7 @@ class A8 {
16835
16835
  }
16836
16836
  class fa {
16837
16837
  static canGetMediaDevices() {
16838
- return !navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? (console.log("enumerateDevices() not supported."), !1) : !0;
16838
+ return !(!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices);
16839
16839
  }
16840
16840
  static async getDevices(e) {
16841
16841
  return fa.canGetMediaDevices() ? (await navigator.mediaDevices.enumerateDevices()).filter((n) => n.kind === e) : [];
@@ -16894,9 +16894,9 @@ class fa {
16894
16894
  }
16895
16895
  static async changeAudioOutput(e, t) {
16896
16896
  if (!(!e || !t))
16897
- if (console.log("changeAudioOutput element", e), console.log("changeAudioOutput deviceId", t), typeof e.sinkId < "u")
16897
+ if (typeof e.sinkId < "u")
16898
16898
  try {
16899
- await e.setSinkId(t), console.log(`Success, audio output device attached: ${t}`);
16899
+ await e.setSinkId(t);
16900
16900
  } catch (n) {
16901
16901
  let i = n;
16902
16902
  n.name === "SecurityError" && (i = `You need to use HTTPS for selecting audio output device: ${n}`), console.error(i);
@@ -16980,7 +16980,7 @@ class N8 {
16980
16980
  });
16981
16981
  let e;
16982
16982
  this._connection.onicecandidate = (t) => {
16983
- if (console.log("AAA onicecandidate", t), this._connection.signalingState !== "stable" && this._connection.signalingState !== "have-local-offer") {
16983
+ if (this._connection.signalingState !== "stable" && this._connection.signalingState !== "have-local-offer") {
16984
16984
  console.log("skipining icecandidate event screensharing ", this._connection.signalingState, t);
16985
16985
  return;
16986
16986
  }
@@ -71406,7 +71406,7 @@ class o_e extends Dw {
71406
71406
  if (e && e.length > 0)
71407
71407
  switch (this.maskEffectType) {
71408
71408
  case iv.bokehEffect:
71409
- console.log("applyBokehEffect"), await this.applyBokehEffect(e);
71409
+ await this.applyBokehEffect(e);
71410
71410
  break;
71411
71411
  case iv.backgroundImageEffect:
71412
71412
  await this.applyBackgroundImageEffect(e);
@@ -71467,7 +71467,7 @@ class Cg extends Ds.EventEmitter {
71467
71467
  return $e;
71468
71468
  }
71469
71469
  constructor(e) {
71470
- Ie.debug("new"), super(), console.log("constructor call"), this._id = null, this._ua = e, this._status = $e.STATUS_NULL, this._dialog = null, this._earlyDialogs = {}, this._contact = null, this._from_tag = null, this._to_tag = null, this.lastTransaction = 0, this._connection = null, this._connectionPromiseQueue = Promise.resolve(), this._request = null, this._is_canceled = !1, this._cancel_reason = "", this._is_confirmed = !1, this._late_sdp = !1, this._rtcOfferConstraints = null, this._rtcAnswerConstraints = null, this._localMediaStream = null, this._localMediaStreamLocallyGenerated = !1, this._rtcReady = !0, this._iceReady = !1, this._timers = {
71470
+ Ie.debug("new"), super(), this._id = null, this._ua = e, this._status = $e.STATUS_NULL, this._dialog = null, this._earlyDialogs = {}, this._contact = null, this._from_tag = null, this._to_tag = null, this.lastTransaction = 0, this._connection = null, this._connectionPromiseQueue = Promise.resolve(), this._request = null, this._is_canceled = !1, this._cancel_reason = "", this._is_confirmed = !1, this._late_sdp = !1, this._rtcOfferConstraints = null, this._rtcAnswerConstraints = null, this._localMediaStream = null, this._localMediaStreamLocallyGenerated = !1, this._rtcReady = !0, this._iceReady = !1, this._timers = {
71471
71471
  ackTimer: null,
71472
71472
  expiresTimer: null,
71473
71473
  invite2xxTimer: null,
@@ -71485,7 +71485,7 @@ class Cg extends Ds.EventEmitter {
71485
71485
  urls: "stun:turn.voicenter.co",
71486
71486
  credential: "kxsjahnsdjns3eds23esd",
71487
71487
  username: "turn2es21e"
71488
- }], this.opaque_id = this.generateOpaqueId(), this.screen_share_opaque_id = this.generateOpaqueId(), this._data = {}, this.isAudioOn = !0, this.isVideoOn = !0;
71488
+ }], this.opaque_id = this.generateOpaqueId(), this.screen_share_opaque_id = this.generateOpaqueId(), this._data = {}, this.isAudioOn = !0, this.isVideoOn = !0, this.mediaConstraints = {};
71489
71489
  }
71490
71490
  /**
71491
71491
  * User API
@@ -71585,14 +71585,16 @@ class Cg extends Ds.EventEmitter {
71585
71585
  const s = e, a = Yt.cloneObject(n.eventHandlers), o = Yt.cloneArray(n.extraHeaders), u = Yt.cloneObject(n.mediaConstraints, {
71586
71586
  audio: !0,
71587
71587
  video: !0
71588
- }), c = n.mediaStream || null, d = Yt.cloneObject(n.pcConfig, { iceServers: [] }), p = n.rtcConstraints || null, m = n.rtcOfferConstraints || null;
71588
+ });
71589
+ this.mediaConstraints = { ...u };
71590
+ const c = n.mediaStream || null, d = Yt.cloneObject(n.pcConfig, { iceServers: [] }), p = n.rtcConstraints || null, m = n.rtcOfferConstraints || null;
71589
71591
  if (this._rtcOfferConstraints = m, this._rtcAnswerConstraints = n.rtcAnswerConstraints || null, this._data = n.data || this._data, e === void 0)
71590
71592
  throw new TypeError("Not enough arguments");
71591
71593
  if (this._status !== $e.STATUS_NULL)
71592
71594
  throw new ll.InvalidStateError(this._status);
71593
71595
  if (!window.RTCPeerConnection)
71594
71596
  throw new ll.NotSupportedError("WebRTC not supported");
71595
- if (console.log("target", e), e = this._ua.normalizeTarget(e), console.log("normalizeTarget target", e), this.room_id = e.user, this.target = e, !e)
71597
+ if (e = this._ua.normalizeTarget(e), this.room_id = e.user, this.target = e, !e)
71596
71598
  throw new TypeError(`Invalid target: ${s}`);
71597
71599
  this._sessionTimers.enabled && Yt.isDecimal(n.sessionTimersExpires) && (n.sessionTimersExpires >= ye.MIN_SESSION_EXPIRES ? this._sessionTimers.defaultExpires = n.sessionTimersExpires : this._sessionTimers.defaultExpires = ye.SESSION_EXPIRES);
71598
71600
  for (const b in a)
@@ -71607,7 +71609,7 @@ class Cg extends Ds.EventEmitter {
71607
71609
  this._ua,
71608
71610
  y,
71609
71611
  o
71610
- ), this._id = this._request.call_id + this._from_tag, this._createRTCConnection(d, p), this._direction = "outgoing", this._local_identity = this._request.from, this._remote_identity = this._request.to, console.log("this._remote_identity", this._remote_identity), i && i(this), this._newJanusSession("local", this._request), this._sendInitialRequest(u, m, c);
71612
+ ), this._id = this._request.call_id + this._from_tag, this._createRTCConnection(d, p), this._direction = "outgoing", this._local_identity = this._request.from, this._remote_identity = this._request.to, i && i(this), this._newJanusSession("local", this._request), this._sendInitialRequest(u, m, c);
71611
71613
  }
71612
71614
  connectScreenShare(e = {}) {
71613
71615
  new N8(this).connect(e);
@@ -71722,7 +71724,7 @@ class Cg extends Ds.EventEmitter {
71722
71724
  if (s)
71723
71725
  return s;
71724
71726
  if (i.audio || i.video)
71725
- return this._localMediaStreamLocallyGenerated = !0, navigator.mediaDevices.getUserMedia(i).catch((S) => {
71727
+ return this._localMediaStreamLocallyGenerated = !0, this.loadStream().catch((S) => {
71726
71728
  throw this._status === $e.STATUS_TERMINATED ? new Error("terminated") : (t.reply(480), this._failed("local", null, ye.causes.USER_DENIED_MEDIA_ACCESS), Ie.warn('emit "getusermediafailed" [error:%o]', S), this.emit("getusermediafailed", S), new Error("getUserMedia() failed"));
71727
71729
  });
71728
71730
  }).then((S) => {
@@ -71813,7 +71815,7 @@ class Cg extends Ds.EventEmitter {
71813
71815
  extraHeaders: n,
71814
71816
  body: i
71815
71817
  }), u.terminate(), this.closeSession());
71816
- }), this._ended("local", null, t), this._dialog = u, console.log("SET DIALOG terminate"), this._ua.newDialog(u);
71818
+ }), this._ended("local", null, t), this._dialog = u, this._ua.newDialog(u);
71817
71819
  } else {
71818
71820
  const u = {
71819
71821
  janus: "leave"
@@ -72183,7 +72185,7 @@ class Cg extends Ds.EventEmitter {
72183
72185
  * In dialog Request Reception
72184
72186
  */
72185
72187
  receiveRequest(e) {
72186
- if (console.log("mmm receiveRequest 1", e), Ie.debug("receiveRequest()"), e.method === ye.CANCEL)
72188
+ if (Ie.debug("receiveRequest()"), e.method === ye.CANCEL)
72187
72189
  (this._status === $e.STATUS_WAITING_FOR_ANSWER || this._status === $e.STATUS_ANSWERED) && (this._status = $e.STATUS_CANCELED, this._request.reply(487), this._failed("remote", e, ye.causes.CANCELED));
72188
72190
  else
72189
72191
  switch (e.method) {
@@ -72223,7 +72225,7 @@ class Cg extends Ds.EventEmitter {
72223
72225
  this._status === $e.STATUS_CONFIRMED || this._status === $e.STATUS_WAITING_FOR_ACK ? (e.reply(200), this._ended("remote", e, ye.causes.BYE)) : this._status === $e.STATUS_INVITE_RECEIVED || this._status === $e.STATUS_WAITING_FOR_ANSWER ? (e.reply(200), this._request.reply(487, "BYE Received"), this._ended("remote", e, ye.causes.BYE)) : e.reply(403, "Wrong Status");
72224
72226
  break;
72225
72227
  case ye.INVITE:
72226
- console.log("mmm invite 1"), this._status === $e.STATUS_CONFIRMED ? e.hasHeader("replaces") ? this._receiveReplaces(e) : this._receiveReinvite(e) : e.reply(403, "Wrong Status");
72228
+ this._status === $e.STATUS_CONFIRMED ? e.hasHeader("replaces") ? this._receiveReplaces(e) : this._receiveReinvite(e) : e.reply(403, "Wrong Status");
72227
72229
  break;
72228
72230
  case ye.INFO:
72229
72231
  if (this._status === $e.STATUS_1XX_RECEIVED || this._status === $e.STATUS_WAITING_FOR_ANSWER || this._status === $e.STATUS_ANSWERED || this._status === $e.STATUS_WAITING_FOR_ACK || this._status === $e.STATUS_CONFIRMED) {
@@ -72333,7 +72335,7 @@ class Cg extends Ds.EventEmitter {
72333
72335
  }, Pd.TIMER_H);
72334
72336
  }
72335
72337
  _createRTCConnection(e, t) {
72336
- console.log("pcConfig", e), console.log("rtcConstraints", t), this.stunServers, this._connection = new RTCPeerConnection(e, t), this._connection.addEventListener("iceconnectionstatechange", () => {
72338
+ this.stunServers, this._connection = new RTCPeerConnection(e, t), this._connection.addEventListener("iceconnectionstatechange", () => {
72337
72339
  this._connection.iceConnectionState === "failed" && this.terminate({
72338
72340
  cause: ye.causes.RTP_TIMEOUT,
72339
72341
  status_code: 408,
@@ -72403,12 +72405,12 @@ class Cg extends Ds.EventEmitter {
72403
72405
  const i = t === "UAS" ? e.to_tag : e.from_tag, s = t === "UAS" ? e.from_tag : e.to_tag, a = e.call_id + i + s;
72404
72406
  let o = this._earlyDialogs[a];
72405
72407
  if (n)
72406
- return o ? !0 : (o = new em(this, e, t, em.C.STATUS_EARLY), console.log("SET DIALOG early"), o.error ? (console.log("early_dialog error", o.error), Ie.debug(o.error), this._failed("remote", e, ye.causes.INTERNAL_ERROR), !1) : (this._earlyDialogs[a] = o, !0));
72408
+ return o ? !0 : (o = new em(this, e, t, em.C.STATUS_EARLY), o.error ? (Ie.debug(o.error), this._failed("remote", e, ye.causes.INTERNAL_ERROR), !1) : (this._earlyDialogs[a] = o, !0));
72407
72409
  {
72408
72410
  if (this._from_tag = e.from_tag, this._to_tag = e.to_tag, o)
72409
- return o.update(e, t), console.log("SET DIALOG 1"), this._dialog = o, delete this._earlyDialogs[a], !0;
72411
+ return o.update(e, t), this._dialog = o, delete this._earlyDialogs[a], !0;
72410
72412
  const u = new em(this, e, t);
72411
- return u.error ? (console.log("dialog.error", u.error), Ie.debug(u.error), this._failed("remote", e, ye.causes.INTERNAL_ERROR), !1) : (this._dialog = u, !0);
72413
+ return u.error ? (Ie.debug(u.error), this._failed("remote", e, ye.causes.INTERNAL_ERROR), !1) : (this._dialog = u, !0);
72412
72414
  }
72413
72415
  }
72414
72416
  /**
@@ -72670,7 +72672,7 @@ class Cg extends Ds.EventEmitter {
72670
72672
  if (n)
72671
72673
  return n;
72672
72674
  if (e.audio || e.video)
72673
- return this._localMediaStreamLocallyGenerated = !0, navigator.mediaDevices.getUserMedia(e).catch((s) => {
72675
+ return this._localMediaStreamLocallyGenerated = !0, this.loadStream().catch((s) => {
72674
72676
  throw this._status === $e.STATUS_TERMINATED ? new Error("terminated") : (this._failed("local", null, ye.causes.USER_DENIED_MEDIA_ACCESS), Ie.warn('emit "getusermediafailed" [error:%o]', s), this.emit("getusermediafailed", s), s);
72675
72677
  });
72676
72678
  }).then((s) => {
@@ -72718,11 +72720,15 @@ class Cg extends Ds.EventEmitter {
72718
72720
  async setupMediaStream() {
72719
72721
  await this.requestAudioAndVideoPermissions(), await this.processPlugins();
72720
72722
  }
72723
+ async changeMediaConstraints(e) {
72724
+ this.mediaConstraints = { ...e }, await this.processPlugins(), this.addTracks(this.stream.getTracks()), this._ua.emit("changeMainVideoStream", {
72725
+ name: this.display_name,
72726
+ stream: this.stream
72727
+ });
72728
+ }
72721
72729
  async loadStream() {
72722
- const e = {
72723
- audio: this.isAudioOn,
72724
- video: this.isVideoOn
72725
- };
72730
+ const e = {};
72731
+ this.isAudioOn ? this.mediaConstraints.audio ? e.audio = this.mediaConstraints.audio : e.audio = !0 : e.audio = !1, this.isVideoOn ? this.mediaConstraints.video ? e.video = this.mediaConstraints.video : e.video = !0 : e.video = !1;
72726
72732
  let t = null;
72727
72733
  try {
72728
72734
  t = await navigator.mediaDevices.getUserMedia(e);
@@ -72736,7 +72742,9 @@ class Cg extends Ds.EventEmitter {
72736
72742
  return t;
72737
72743
  }
72738
72744
  addTracks(e) {
72739
- e.forEach((t) => {
72745
+ this._connection.getSenders().forEach((t) => {
72746
+ this._connection.removeTrack(t);
72747
+ }), e.forEach((t) => {
72740
72748
  this._connection.addTrack(t);
72741
72749
  });
72742
72750
  }
@@ -72823,7 +72831,6 @@ class Cg extends Ds.EventEmitter {
72823
72831
  body: JSON.stringify(n),
72824
72832
  eventHandlers: {
72825
72833
  onSuccessResponse: async (s) => {
72826
- console.log("_sendTrickleMessage", s);
72827
72834
  }
72828
72835
  }
72829
72836
  });
@@ -72981,8 +72988,8 @@ class Cg extends Ds.EventEmitter {
72981
72988
  * Reception of Response for Initial INVITE
72982
72989
  */
72983
72990
  _receiveInviteResponse(e) {
72984
- if (Ie.debug("receiveInviteResponse()"), console.log("_receiveInviteResponse response", e), console.log("dialog", this._dialog), this._dialog && e.status_code >= 200 && e.status_code <= 299 && !this.ackSent)
72985
- if (console.log("IF 1 dialog"), this._dialog.id.call_id === e.call_id && this._dialog.id.local_tag === e.from_tag && this._dialog.id.remote_tag === e.to_tag) {
72991
+ if (Ie.debug("receiveInviteResponse()"), this._dialog && e.status_code >= 200 && e.status_code <= 299 && !this.ackSent)
72992
+ if (this._dialog.id.call_id === e.call_id && this._dialog.id.local_tag === e.from_tag && this._dialog.id.remote_tag === e.to_tag) {
72986
72993
  this.ackSent = !0, this.sendRequest(ye.ACK);
72987
72994
  return;
72988
72995
  } else {
@@ -73537,7 +73544,7 @@ m=message 2856 TCP/TLS/MSRP *
73537
73544
  a=accept-types:text/plain text/html
73538
73545
  a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization_user}.${this._ua._configuration.realm}:2856/${this.auth_id};ws
73539
73546
  `
73540
- ), this._newMSRPSession("local", this._request), this._id = this._request.call_id + this._from_tag, console.log("dialog be", this._dialog), new Dc(this._ua, this._request, {
73547
+ ), this._newMSRPSession("local", this._request), this._id = this._request.call_id + this._from_tag, new Dc(this._ua, this._request, {
73541
73548
  onRequestTimeout: () => {
73542
73549
  this.onRequestTimeout(), console.log("to");
73543
73550
  },
@@ -73549,12 +73556,11 @@ a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization
73549
73556
  this._request = s;
73550
73557
  },
73551
73558
  onReceiveResponse: (s) => {
73552
- this._receiveInviteResponse(s), console.log("dialog af", this._dialog), s.status_code === 200 && (s.parseSDP(!0), this._status = Tt.STATUS_CONFIRMED, this.target_addr = s.sdp.media[0].invalid[1].value.replaceAll("path:", "").split(" ").reverse(), this.status = "active", this.emit("active"), this.emit("confirmed"));
73559
+ this._receiveInviteResponse(s), s.status_code === 200 && (s.parseSDP(!0), this._status = Tt.STATUS_CONFIRMED, this.target_addr = s.sdp.media[0].invalid[1].value.replaceAll("path:", "").split(" ").reverse(), this.status = "active", this.emit("active"), this.emit("confirmed"));
73553
73560
  }
73554
73561
  }).send(), this._status = Tt.STATUS_INVITE_SENT;
73555
73562
  }
73556
73563
  terminate(e = {}) {
73557
- console.log("terminate", this);
73558
73564
  const t = e.cause || ye.causes.BYE, n = Yt.cloneArray(e.extraHeaders), i = e.body;
73559
73565
  let s, a = e.status_code, o = e.reason_phrase;
73560
73566
  if (this._status === Tt.STATUS_TERMINATED)
@@ -73565,13 +73571,13 @@ a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization
73565
73571
  case Tt.STATUS_1XX_RECEIVED:
73566
73572
  if (a && (a < 200 || a >= 700))
73567
73573
  throw new TypeError(`Invalid status_code: ${a}`);
73568
- a && (o = o || ye.REASON_PHRASE[a] || "", s = `SIP ;cause=${a} ;text="${o}"`), this._status === Tt.STATUS_NULL || this._status === Tt.STATUS_INVITE_SENT ? (this._is_canceled = !0, this._cancel_reason = s) : this._status === Tt.STATUS_1XX_RECEIVED && this._request.cancel(s), this._status = Tt.STATUS_CANCELED, console.log("failed 1"), this._failed("local", null, ye.causes.CANCELED);
73574
+ a && (o = o || ye.REASON_PHRASE[a] || "", s = `SIP ;cause=${a} ;text="${o}"`), this._status === Tt.STATUS_NULL || this._status === Tt.STATUS_INVITE_SENT ? (this._is_canceled = !0, this._cancel_reason = s) : this._status === Tt.STATUS_1XX_RECEIVED && this._request.cancel(s), this._status = Tt.STATUS_CANCELED, this._failed("local", null, ye.causes.CANCELED);
73569
73575
  break;
73570
73576
  case Tt.STATUS_WAITING_FOR_ANSWER:
73571
73577
  case Tt.STATUS_ANSWERED:
73572
- if (a = a || 480, console.log("REPLY 480"), a < 300 || a >= 700)
73578
+ if (a = a || 480, a < 300 || a >= 700)
73573
73579
  throw new TypeError(`Invalid status_code: ${a}`);
73574
- this._request.reply(a, o, n, i), console.log("failed 2"), this._failed("local", null, ye.causes.REJECTED);
73580
+ this._request.reply(a, o, n, i), this._failed("local", null, ye.causes.REJECTED);
73575
73581
  break;
73576
73582
  case Tt.STATUS_WAITING_FOR_ACK:
73577
73583
  case Tt.STATUS_CONFIRMED:
@@ -73591,7 +73597,7 @@ a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization
73591
73597
  }), u.terminate());
73592
73598
  }), this._ended("local", null, t), this._dialog = u, this._ua.newDialog(u);
73593
73599
  } else
73594
- console.log("here it is"), this.sendRequest(ye.BYE, {
73600
+ this.sendRequest(ye.BYE, {
73595
73601
  extraHeaders: n,
73596
73602
  body: i
73597
73603
  }), this._ended("local", null, t);
@@ -73607,15 +73613,12 @@ a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization
73607
73613
  "From-Path",
73608
73614
  `msrp://${this.credentials.username}.${this.credentials.realm}:2856/${this.auth_id};ws`
73609
73615
  ), e && t.addHeader("Authorization", e.toString());
73610
- let n = t.toString();
73611
- console.log(n);
73612
- let i = [];
73616
+ let n = t.toString(), i = [];
73613
73617
  for (var s = 0; s < n.length; s++)
73614
73618
  i.push(n.charCodeAt(s).toString(16));
73615
- console.log(i), this._connection.send(t.toString());
73619
+ this._connection.send(t.toString());
73616
73620
  }
73617
73621
  onmessage(e) {
73618
- console.log("onmessage", e);
73619
73622
  const t = new gc(e.data);
73620
73623
  if (this.status === "auth" && t.code === 401) {
73621
73624
  const n = this.parseAuth(t.getHeader("WWW-Authenticate")), i = new V6(this.credentials);
@@ -73625,7 +73628,7 @@ a=path:${e.getHeader("Use-Path")} msrp://${this._ua._configuration.authorization
73625
73628
  body: null
73626
73629
  }, n, Yt.createRandomToken(12)), this.authenticate(i);
73627
73630
  }
73628
- this.status === "auth" && t.code === 200 && this._direction === "outgoing" ? (this.my_addr.push(t.getHeader("To-Path")), this.my_addr.push(t.getHeader("Use-Path")), this.status = "active", this.inviteParty(t)) : this.status === "auth" && t.code === 200 && this._direction === "incoming" ? (this.my_addr.push(t.getHeader("To-Path")), this.my_addr.push(t.getHeader("Use-Path")), this.status = "active", this.acceptParty(t), this.emit("confirmed")) : t.method === "SEND" && (this._sendOk(t), this._sendReport(t), t.direction = "incoming", this.emit("newMessage", t), this._msgHistory.push(t), this.emit("msgHistoryUpdate", this._msgHistory), console.log("======================================================================")), t.code === 480 && this._close();
73631
+ this.status === "auth" && t.code === 200 && this._direction === "outgoing" ? (this.my_addr.push(t.getHeader("To-Path")), this.my_addr.push(t.getHeader("Use-Path")), this.status = "active", this.inviteParty(t)) : this.status === "auth" && t.code === 200 && this._direction === "incoming" ? (this.my_addr.push(t.getHeader("To-Path")), this.my_addr.push(t.getHeader("Use-Path")), this.status = "active", this.acceptParty(t), this.emit("confirmed")) : t.method === "SEND" && (this._sendOk(t), this._sendReport(t), t.direction = "incoming", this.emit("newMessage", t), this._msgHistory.push(t), this.emit("msgHistoryUpdate", this._msgHistory)), t.code === 480 && this._close();
73629
73632
  }
73630
73633
  onclose() {
73631
73634
  console.log("close");
@@ -74283,6 +74286,10 @@ class Sde extends bde {
74283
74286
  for (const e in this._janus_sessions)
74284
74287
  this._janus_sessions[e].connectScreenShare();
74285
74288
  }
74289
+ changeMediaConstraints(e) {
74290
+ for (const t in this._janus_sessions)
74291
+ this._janus_sessions[t].changeMediaConstraints(e);
74292
+ }
74286
74293
  startBlur() {
74287
74294
  for (const e in this._janus_sessions)
74288
74295
  this._janus_sessions[e].connectBlur();
@@ -74397,7 +74404,7 @@ class Sde extends bde {
74397
74404
  receiveRequest(e) {
74398
74405
  var s, a, o, u;
74399
74406
  const t = e.method;
74400
- if (console.log("-----------"), e.ruri.user !== this._configuration.uri.user && e.ruri.user !== this._contact.uri.user) {
74407
+ if (e.ruri.user !== this._configuration.uri.user && e.ruri.user !== this._contact.uri.user) {
74401
74408
  ns.debug("Request-URI does not point to us"), e.method !== $t.ACK && e.reply_sl(404);
74402
74409
  return;
74403
74410
  }
@@ -74579,31 +74586,21 @@ function Cde(r) {
74579
74586
  function Ede(r) {
74580
74587
  const e = r.transport;
74581
74588
  let t = r.message;
74582
- if (t = yde.parseMessage(t, this), !t) {
74583
- console.log("if 1 return");
74584
- return;
74585
- }
74586
- if (this._status === _l.STATUS_USER_CLOSED && t instanceof Ac.IncomingRequest) {
74587
- console.log("if 2 return");
74588
- return;
74589
- }
74590
- if (!c8(t, this, e)) {
74591
- console.log("if 3 return");
74592
- return;
74593
- }
74594
- if (t instanceof Ac.IncomingRequest)
74595
- t.transport = e, this.receiveRequest(t);
74596
- else if (t instanceof Ac.IncomingResponse) {
74597
- let n;
74598
- switch (t.method) {
74599
- case $t.INVITE:
74600
- n = this._transactions.ict[t.via_branch], n && n.receiveResponse(t);
74601
- break;
74602
- case $t.ACK:
74603
- break;
74604
- default:
74605
- n = this._transactions.nict[t.via_branch], n && n.receiveResponse(t);
74606
- break;
74589
+ if (t = yde.parseMessage(t, this), !!t && !(this._status === _l.STATUS_USER_CLOSED && t instanceof Ac.IncomingRequest) && c8(t, this, e)) {
74590
+ if (t instanceof Ac.IncomingRequest)
74591
+ t.transport = e, this.receiveRequest(t);
74592
+ else if (t instanceof Ac.IncomingResponse) {
74593
+ let n;
74594
+ switch (t.method) {
74595
+ case $t.INVITE:
74596
+ n = this._transactions.ict[t.via_branch], n && n.receiveResponse(t);
74597
+ break;
74598
+ case $t.ACK:
74599
+ break;
74600
+ default:
74601
+ n = this._transactions.nict[t.via_branch], n && n.receiveResponse(t);
74602
+ break;
74603
+ }
74607
74604
  }
74608
74605
  }
74609
74606
  }
@@ -74738,7 +74735,7 @@ class Pw extends G$ {
74738
74735
  this._receiveInviteResponse(s);
74739
74736
  }
74740
74737
  });
74741
- if (await this.generateStream(), console.log("this.stream", this.stream), !this.stream || !this.stream.getTracks().length)
74738
+ if (await this.generateStream(), !this.stream || !this.stream.getTracks().length)
74742
74739
  return;
74743
74740
  this.addTracks(this.stream.getTracks());
74744
74741
  const t = {
@@ -82365,10 +82362,9 @@ class Ub {
82365
82362
  return e.add(i), this.emptyDrawerRect = i, i;
82366
82363
  }
82367
82364
  addImage(e, t) {
82368
- console.log("this.stage.width()", this.stage.width()), console.log("this.stage.height()", this.stage.height()), console.log("imageObj.width", t.width), console.log("imageObj.height", t.height);
82369
82365
  let n, i;
82370
82366
  const s = t.width / t.height;
82371
- this.stage.width() < t.width ? (n = this.stage.width(), i = this.stage.width() / s) : (n = t.width, i = t.width / s), console.log("imageWidth", n), console.log("imageHeight", i);
82367
+ this.stage.width() < t.width ? (n = this.stage.width(), i = this.stage.width() / s) : (n = t.width, i = t.width / s);
82372
82368
  const a = new bc.Image({
82373
82369
  image: t,
82374
82370
  x: (this.stage.width() - n) / 2,
@@ -82505,7 +82501,7 @@ class u_e extends Pw {
82505
82501
  const e = this.selectors.document.getElementById(this.selectors.container);
82506
82502
  e.style.setProperty("min-width", "100%"), e.style.setProperty("height", "100%");
82507
82503
  const t = e.clientWidth, n = e.clientHeight, i = this.selectors.document.getElementById(this.selectors.drawerContainer);
82508
- console.log("konvaContainer", i), this.konvaDrawer = new Ub({
82504
+ this.konvaDrawer = new Ub({
82509
82505
  container: i,
82510
82506
  width: t,
82511
82507
  height: n
@@ -82516,10 +82512,8 @@ class u_e extends Pw {
82516
82512
  async drawImageWhiteboard() {
82517
82513
  const e = this.selectors.document.getElementById(this.selectors.container);
82518
82514
  e.style.setProperty("min-width", "100%"), e.style.setProperty("height", "100%");
82519
- const t = e.clientWidth, n = e.clientHeight;
82520
- console.log("wrapperEl width", t), console.log("wrapperEl height", n);
82521
- const i = await dde(this.imageSrc), s = this.selectors.document.getElementById(this.selectors.drawerContainer);
82522
- console.log("konvaContainer", s), this.konvaDrawer = new Ub({
82515
+ const t = e.clientWidth, n = e.clientHeight, i = await dde(this.imageSrc), s = this.selectors.document.getElementById(this.selectors.drawerContainer);
82516
+ this.konvaDrawer = new Ub({
82523
82517
  container: s,
82524
82518
  width: t,
82525
82519
  height: n
@@ -85784,7 +85778,7 @@ class Bge {
85784
85778
  this.clearVolumeInterval(e);
85785
85779
  }
85786
85780
  clearVolumeInterval(e) {
85787
- console.log("clearVolumeInterval", e), clearInterval(this.intervals[e]), delete this.intervals[e];
85781
+ clearInterval(this.intervals[e]), delete this.intervals[e];
85788
85782
  }
85789
85783
  clearAllIntervals() {
85790
85784
  Object.keys(this.intervals).forEach((e) => {
@@ -86022,9 +86016,7 @@ class Vge {
86022
86016
  sendDTMF(e, t) {
86023
86017
  if (!/^[A-D0-9]+$/g.test(t))
86024
86018
  throw new Error("Not allowed character in DTMF input");
86025
- console.log("callId", e), console.log("value", t);
86026
- const i = this.extendedCalls[e];
86027
- console.log("call", i), i.sendDTMF(t);
86019
+ this.extendedCalls[e].sendDTMF(t);
86028
86020
  }
86029
86021
  setIsMuted(e) {
86030
86022
  this.muted = e, this.context.emit("changeIsMuted", e);
@@ -86558,6 +86550,9 @@ class Gge {
86558
86550
  stopVideo() {
86559
86551
  this.context.enableJanusVideo(!1);
86560
86552
  }
86553
+ changeMediaConstraints(e) {
86554
+ this.context.changeMediaConstraints(e);
86555
+ }
86561
86556
  startScreenShare() {
86562
86557
  this.context.startScreenShare();
86563
86558
  }