webitel-sdk 0.1.190 → 0.1.192

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.
@@ -35091,6 +35091,7 @@ class Socket extends EventEmitter {
35091
35091
  close(code) {
35092
35092
  this.socket.close(code || 1000);
35093
35093
  delete this.socket;
35094
+ this.onClose(code || 1000);
35094
35095
  }
35095
35096
  onOpen() {
35096
35097
  this.emit('open');
@@ -35697,8 +35698,9 @@ class Client extends EventEmitter {
35697
35698
  async pingServer() {
35698
35699
  if (this.pingTimer && this.connectionInfo.ping_interval) {
35699
35700
  const t = setTimeout(async () => {
35701
+ this.log.error('close socket without pong');
35700
35702
  this.socket.close(3005);
35701
- }, +this.connectionInfo.ping_interval / 2);
35703
+ }, 2000);
35702
35704
  await this.ping();
35703
35705
  clearTimeout(t);
35704
35706
  }
@@ -35719,7 +35721,7 @@ class Client extends EventEmitter {
35719
35721
  }
35720
35722
  callBySession(session) {
35721
35723
  for (const call of this.allCall()) {
35722
- if (call.sip === session) {
35724
+ if (call.sip && call.sip.id === session.id) {
35723
35725
  return call;
35724
35726
  }
35725
35727
  }