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.
@@ -26512,7 +26512,6 @@
26512
26512
  var WEBSOCKET_AUTHENTICATION_CHALLENGE = 'authentication_challenge';
26513
26513
  var WEBSOCKET_DEFAULT_DEVICE_CONFIG = 'user_default_device';
26514
26514
  var WEBSOCKET_AGENT_SESSION = 'cc_agent_session';
26515
- var WEBSOCKET_PING = 'ping';
26516
26515
  // const WEBSOCKET_CALL_BY_USER = 'call_by_user'
26517
26516
  var WEBSOCKET_MAKE_OUTBOUND_CALL = 'call_invite';
26518
26517
  var WEBSOCKET_MAKE_USER_CALL = 'call_user';
@@ -26539,7 +26538,6 @@
26539
26538
  _this.eventHandler = new eeTs.EventEmitter();
26540
26539
  _this.callStore = new Map();
26541
26540
  _this.conversationStore = new Map();
26542
- _this.pingTimer = null;
26543
26541
  _this.basePath = "" + formatBaseUri(_config.storageEndpoint || _config.endpoint);
26544
26542
  return _this;
26545
26543
  }
@@ -26789,15 +26787,6 @@
26789
26787
  });
26790
26788
  });
26791
26789
  };
26792
- Client.prototype.ping = function () {
26793
- return tslib.__awaiter(this, void 0, void 0, function () {
26794
- return tslib.__generator(this, function (_a) {
26795
- return [2 /*return*/, this.request(WEBSOCKET_PING, {
26796
- ping: 1,
26797
- })];
26798
- });
26799
- });
26800
- };
26801
26790
  Client.prototype.sessionInfo = function () {
26802
26791
  return this.connectionInfo.session;
26803
26792
  };
@@ -27158,43 +27147,14 @@
27158
27147
  this.eventHandler.emit(TASK_EVENT, e.status, task);
27159
27148
  }
27160
27149
  };
27161
- Client.prototype.pingServer = function () {
27162
- return tslib.__awaiter(this, void 0, void 0, function () {
27163
- return tslib.__generator(this, function (_a) {
27164
- switch (_a.label) {
27165
- case 0:
27166
- if (!this.pingTimer) return [3 /*break*/, 2];
27167
- return [4 /*yield*/, this.ping()];
27168
- case 1:
27169
- _a.sent();
27170
- _a.label = 2;
27171
- case 2:
27172
- if (this.connectionInfo.ping_interval) {
27173
- // @ts-ignore
27174
- this.pingTimer = setTimeout(this.pingServer.bind(this), +this.connectionInfo.ping_interval);
27175
- }
27176
- return [2 /*return*/];
27177
- }
27178
- });
27179
- });
27180
- };
27181
27150
  Client.prototype.connected = function (info) {
27182
27151
  return tslib.__awaiter(this, void 0, void 0, function () {
27183
27152
  return tslib.__generator(this, function (_a) {
27184
- switch (_a.label) {
27185
- case 0:
27186
- this.connectionInfo = info;
27187
- if (!info.ping_interval) return [3 /*break*/, 2];
27188
- return [4 /*yield*/, this.pingServer()];
27189
- case 1:
27190
- _a.sent();
27191
- _a.label = 2;
27192
- case 2:
27193
- if (!this.useWebPhone()) {
27194
- return [2 /*return*/];
27195
- }
27196
- return [2 /*return*/, this.registerCallClient(new SipPhone(this.instanceId, this._config.debug))];
27153
+ this.connectionInfo = info;
27154
+ if (!this.useWebPhone()) {
27155
+ return [2 /*return*/];
27197
27156
  }
27157
+ return [2 /*return*/, this.registerCallClient(new SipPhone(this.instanceId, this._config.debug))];
27198
27158
  });
27199
27159
  });
27200
27160
  };
@@ -27246,9 +27206,6 @@
27246
27206
  }
27247
27207
  _this.socket.on('message', _this.onMessage.bind(_this));
27248
27208
  _this.socket.on('close', function (code) {
27249
- if (_this.pingTimer) {
27250
- clearTimeout(_this.pingTimer);
27251
- }
27252
27209
  _this.log.error('socket close code: ', code);
27253
27210
  _this.eventHandler.off('*');
27254
27211
  if (code !== 1000) {