opensips-js 0.1.27 → 0.1.29

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.
@@ -18962,14 +18962,16 @@ class nu extends ft.EventEmitter {
18962
18962
  return this._id;
18963
18963
  }
18964
18964
  connect(t = "") {
18965
- t !== "" && (this._direction = "outgoing"), this.target = t, this._connection = new WebSocket(`wss://${this._ua.options.msrpDomain || this._ua._configuration.realm}`, "msrp"), this._connection.binaryType = "arraybuffer", this._connection.onopen = (n) => {
18966
- console.log("open", n), this.onopen();
18967
- }, this._connection.onclose = (n) => {
18968
- console.log("close", n), this.onclose();
18969
- }, this._connection.onmessage = (n) => {
18970
- console.log("msg", n), this.onmessage(n);
18971
- }, this._connection.onerror = (n) => {
18972
- console.log("error", n), this.onerror();
18965
+ t !== "" && (this._direction = "outgoing"), this.target = t;
18966
+ const n = this._ua.options.msrpWs ? "ws" : "wss";
18967
+ this._connection = new WebSocket(`${n}://${this._ua.options.msrpDomain || this._ua._configuration.realm}`, "msrp"), this._connection.binaryType = "arraybuffer", this._connection.onopen = (a) => {
18968
+ console.log("open", a), this.onopen();
18969
+ }, this._connection.onclose = (a) => {
18970
+ console.log("close", a), this.onclose();
18971
+ }, this._connection.onmessage = (a) => {
18972
+ console.log("msg", a), this.onmessage(a);
18973
+ }, this._connection.onerror = (a) => {
18974
+ console.log("error", a), this.onerror();
18973
18975
  };
18974
18976
  }
18975
18977
  _sendKeepAlive() {
@@ -19652,7 +19654,7 @@ class $T {
19652
19654
  this._ua.clearKeepAliveInterval(), this._ua.setLastRegisterTimestamp();
19653
19655
  let d = r.getParam("expires");
19654
19656
  !d && o.hasHeader("expires") && (d = o.getHeader("expires")), d || (d = this._expires), d = Number(d), d < fa && (d = fa);
19655
- const h = d > 64 ? d * 1e3 / 2 + Math.floor((d / 2 - 32) * 1e3 * Math.random()) : d * 1e3 - 5e3;
19657
+ const h = d > 64 ? d * 1e3 / 2 + Math.floor((d / 2 - 32) * 1e3 * Math.random()) : Math.floor(d * 1e3 / 2);
19656
19658
  this._registrationTimer = setTimeout(() => {
19657
19659
  this._registrationTimer = null, this._ua.listeners("registrationExpiring").length === 0 ? this.register() : this._ua.emit("registrationExpiring");
19658
19660
  }, h), r.hasParam("temp-gruu") && (this._ua.contact.temp_gruu = r.getParam("temp-gruu").replace(/"/g, "")), r.hasParam("pub-gruu") && (this._ua.contact.pub_gruu = r.getParam("pub-gruu").replace(/"/g, "")), this._registered || (this._registered = !0, this._ua.registered({ response: o }));