@voicenter-team/opensips-js 1.0.96 → 1.0.97

Sign up to get free protection for your applications and to get access to all the features.
@@ -24219,7 +24219,7 @@ class IE extends FT {
24219
24219
  ...s.configuration,
24220
24220
  sockets: s.socketInterfaces.map((o) => new ov.WebSocketInterface(o))
24221
24221
  };
24222
- super(a), this.initialized = !1, this.connected = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.isReconnecting = !1, this.audio = null, this.msrp = null, this.video = null, this.listenersList = {}, this.modules = [], s.pnExtraHeaders && Object.keys(s.pnExtraHeaders).length && this.registrator().setExtraContactUriParams(s.pnExtraHeaders), this.options = s, this.modules = s.modules, n && YT(n) && (this.logger = n);
24222
+ super(a), this.initialized = !1, this.connected = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.isReconnecting = !1, this.activeConnection = !1, this.audio = null, this.msrp = null, this.video = null, this.listenersList = {}, this.modules = [], s.pnExtraHeaders && Object.keys(s.pnExtraHeaders).length && this.registrator().setExtraContactUriParams(s.pnExtraHeaders), this.options = s, this.modules = s.modules, n && YT(n) && (this.logger = n);
24223
24223
  }
24224
24224
  on(s, n) {
24225
24225
  return super.on(s, n);
@@ -24251,15 +24251,18 @@ class IE extends FT {
24251
24251
  ), this.on(
24252
24252
  this.connectedEventName,
24253
24253
  () => {
24254
- this.logger.log("Connected to", this.options.socketInterfaces[0]), this.setConnected(!0), this.isReconnecting = !1;
24254
+ this.logger.log("Connected to", this.options.socketInterfaces[0]), this.setConnected(!0), this.isReconnecting = !1, this.activeConnection = !0;
24255
24255
  }
24256
24256
  ), this.on(
24257
24257
  this.disconnectedEventName,
24258
24258
  () => {
24259
- this.isReconnecting || (this.logger.log("Disconnected from", this.options.socketInterfaces[0]), this.logger.log("Reconnecting to", this.options.socketInterfaces[0]), this.isReconnecting = !0, this.stop(), this.setInitialized(!1), this.setConnected(!1), setTimeout(this.start.bind(this), 5e3));
24259
+ this.isReconnecting || (this.isReconnecting = !0, this.logger.log("Disconnected from", this.options.socketInterfaces[0]), this.logger.log("Reconnecting to", this.options.socketInterfaces[0]), this.stop(), this.setInitialized(!1), this.setConnected(!1), this.activeConnection && setTimeout(this.start.bind(this), 5e3));
24260
24260
  }
24261
24261
  ), this.logger.log("Connecting to", this.options.socketInterfaces[0]), this.start(), this;
24262
24262
  }
24263
+ disconnect() {
24264
+ this.activeConnection = !1, this.stop();
24265
+ }
24263
24266
  /*public get sipOptions () {
24264
24267
  const options = {
24265
24268
  ...this.options.sipOptions,