webitel-sdk 0.1.86 → 0.1.87

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.
@@ -23387,7 +23387,6 @@ const API_HEADER_TOKEN = 'X-Webitel-Access';
23387
23387
  const WEBSOCKET_AUTHENTICATION_CHALLENGE = 'authentication_challenge';
23388
23388
  const WEBSOCKET_DEFAULT_DEVICE_CONFIG = 'user_default_device';
23389
23389
  const WEBSOCKET_AGENT_SESSION = 'cc_agent_session';
23390
- const WEBSOCKET_PING = 'ping';
23391
23390
  // const WEBSOCKET_CALL_BY_USER = 'call_by_user'
23392
23391
  const WEBSOCKET_MAKE_OUTBOUND_CALL = 'call_invite';
23393
23392
  const WEBSOCKET_MAKE_USER_CALL = 'call_user';
@@ -23414,7 +23413,6 @@ class Client extends EventEmitter {
23414
23413
  this.eventHandler = new EventEmitter();
23415
23414
  this.callStore = new Map();
23416
23415
  this.conversationStore = new Map();
23417
- this.pingTimer = null;
23418
23416
  this.basePath = `${formatBaseUri(_config.storageEndpoint || _config.endpoint)}`;
23419
23417
  }
23420
23418
  async connect() {
@@ -23577,11 +23575,6 @@ class Client extends EventEmitter {
23577
23575
  token: this._config.token,
23578
23576
  });
23579
23577
  }
23580
- async ping() {
23581
- return this.request(WEBSOCKET_PING, {
23582
- ping: 1,
23583
- });
23584
- }
23585
23578
  sessionInfo() {
23586
23579
  return this.connectionInfo.session;
23587
23580
  }
@@ -23820,20 +23813,8 @@ class Client extends EventEmitter {
23820
23813
  this.eventHandler.emit(TASK_EVENT, e.status, task);
23821
23814
  }
23822
23815
  }
23823
- async pingServer() {
23824
- if (this.pingTimer) {
23825
- await this.ping();
23826
- }
23827
- if (this.connectionInfo.ping_interval) {
23828
- // @ts-ignore
23829
- this.pingTimer = setTimeout(this.pingServer.bind(this), +this.connectionInfo.ping_interval);
23830
- }
23831
- }
23832
23816
  async connected(info) {
23833
23817
  this.connectionInfo = info;
23834
- if (info.ping_interval) {
23835
- await this.pingServer();
23836
- }
23837
23818
  if (!this.useWebPhone()) {
23838
23819
  return;
23839
23820
  }
@@ -23880,9 +23861,6 @@ class Client extends EventEmitter {
23880
23861
  }
23881
23862
  this.socket.on('message', this.onMessage.bind(this));
23882
23863
  this.socket.on('close', (code) => {
23883
- if (this.pingTimer) {
23884
- clearTimeout(this.pingTimer);
23885
- }
23886
23864
  this.log.error('socket close code: ', code);
23887
23865
  this.eventHandler.off('*');
23888
23866
  if (code !== 1000) {