@voicenter-team/opensips-js 1.0.12 → 1.0.14

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.
Files changed (2) hide show
  1. package/build/index.js +14 -5
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -567,8 +567,14 @@ class OpenSIPSJS extends UA_1.default {
567
567
  if (target.toString().length === 0) {
568
568
  return console.error('Target must be passed');
569
569
  }
570
- this._updateCallStatus({ callId, isTransferring: true });
571
570
  const call = activeCalls[callId];
571
+ console.log('callTransfer', call);
572
+ if (!call._is_confirmed && !call._is_canceled) {
573
+ console.log('refer', `sip:${target}@${this.sipDomain}`);
574
+ call.refer(`sip:${target}@${this.sipDomain}`);
575
+ return;
576
+ }
577
+ this._updateCallStatus({ callId, isTransferring: true });
572
578
  call.refer(`sip:${target}@${this.sipDomain}`);
573
579
  this.updateCall(call);
574
580
  }
@@ -664,6 +670,7 @@ class OpenSIPSJS extends UA_1.default {
664
670
  incomingInProgress: false,
665
671
  roomId
666
672
  });
673
+ this.deleteRoomIfEmpty(roomId);
667
674
  }
668
675
  });
669
676
  }
@@ -719,9 +726,9 @@ class OpenSIPSJS extends UA_1.default {
719
726
  session.on('ended', (event) => {
720
727
  this._triggerListener({ listenerType: call_event_listener_type_1.CALL_EVENT_LISTENER_TYPE.CALL_ENDED, session, event });
721
728
  const s = this.getActiveCalls[session.id];
722
- if (!s)
723
- return;
724
- this._activeCallListRemove(s);
729
+ if (s) {
730
+ this._activeCallListRemove(s);
731
+ }
725
732
  this._stopCallTimer(session.id);
726
733
  this._removeCallStatus(session.id);
727
734
  this._removeCallMetrics(session.id);
@@ -738,7 +745,9 @@ class OpenSIPSJS extends UA_1.default {
738
745
  this.callAddingInProgress = undefined;
739
746
  }
740
747
  const s = this.getActiveCalls[session.id];
741
- this._activeCallListRemove(s);
748
+ if (s) {
749
+ this._activeCallListRemove(s);
750
+ }
742
751
  this._stopCallTimer(session.id);
743
752
  this._removeCallStatus(session.id);
744
753
  this._removeCallMetrics(session.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/opensips-js",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "The JS package for opensips",
5
5
  "default": "src/index.ts",
6
6
  "main": "build/index.js",