@vgroup/dialbox 0.8.23 → 0.8.24

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.
@@ -3072,7 +3072,7 @@ class CallProgressComponent {
3072
3072
  yield this.pollCallStatus(callAuthId);
3073
3073
  console.log('Call initiated successfully:', response);
3074
3074
  (() => __awaiter(this, void 0, void 0, function* () {
3075
- var _f, _g, _h, _j;
3075
+ var _f, _g, _h, _j, _k;
3076
3076
  try {
3077
3077
  const clientSid = yield this.waitForClientCallSid(isNewConference);
3078
3078
  // Client leg connected (or gave up) – socket idle handling can run normally again
@@ -3120,13 +3120,15 @@ class CallProgressComponent {
3120
3120
  }).catch((err) => err === null || err === void 0 ? void 0 : err.error);
3121
3121
  if (this.isAddParticipantFailed(this.addRes)) {
3122
3122
  this.showAddParticipantError(this.addRes);
3123
+ this.disconnectFailedCall((_h = response === null || response === void 0 ? void 0 : response.callauth) === null || _h === void 0 ? void 0 : _h.id, isNewConference);
3124
+ return;
3123
3125
  }
3124
3126
  this.isNewCallLoader = false;
3125
3127
  if (isNewConference) {
3126
- this.conferenceCallIDForParticipantList = (_h = response === null || response === void 0 ? void 0 : response.callauth) === null || _h === void 0 ? void 0 : _h.id;
3128
+ this.conferenceCallIDForParticipantList = (_j = response === null || response === void 0 ? void 0 : response.callauth) === null || _j === void 0 ? void 0 : _j.id;
3127
3129
  }
3128
3130
  this.isNewAddedCall = false;
3129
- if (((_j = this.newIncomingCallsList) === null || _j === void 0 ? void 0 : _j.length) > 1) {
3131
+ if (((_k = this.newIncomingCallsList) === null || _k === void 0 ? void 0 : _k.length) > 1) {
3130
3132
  this.extensionService.isLoadershow.next(false);
3131
3133
  this.isLoadershown.emit(false);
3132
3134
  }
@@ -3389,6 +3391,33 @@ class CallProgressComponent {
3389
3391
  const message = Array.isArray(res === null || res === void 0 ? void 0 : res.message) ? res.message.join('<br/>') : res === null || res === void 0 ? void 0 : res.message;
3390
3392
  swal('Error', message || 'Failed to add participant. Please try again.', 'error');
3391
3393
  }
3394
+ // addParticipant failed for a newly started call: close its conference (drops our client leg too).
3395
+ // Only call → back to the dialpad; otherwise the socket feed auto-unholds the previously held conference.
3396
+ disconnectFailedCall(conferenceId, isNewConference) {
3397
+ var _a, _b, _c;
3398
+ this.specialCallConferenceIds.delete(conferenceId);
3399
+ if (conferenceId) {
3400
+ this.extensionService.getRemoveParticipants('all', conferenceId).subscribe({
3401
+ error: (err) => console.error('Error closing failed call:', err)
3402
+ });
3403
+ }
3404
+ this.showRingAnimation = false;
3405
+ this.isNewCallLoader = false;
3406
+ this.isNewAddedCall = false;
3407
+ this.showNewCallLoader = false;
3408
+ this.extensionService.isLoadershow.next(false);
3409
+ this.isLoadershown.emit(false);
3410
+ const hasOtherCalls = (_a = this.newIncomingCallsList) === null || _a === void 0 ? void 0 : _a.some((c) => (c === null || c === void 0 ? void 0 : c.conferenceId) != conferenceId);
3411
+ if (isNewConference && hasOtherCalls) {
3412
+ this.pendingAutoUnhold = true;
3413
+ this.unholdPendingConference();
3414
+ }
3415
+ else {
3416
+ (_c = (_b = this.call) === null || _b === void 0 ? void 0 : _b.disconnect) === null || _c === void 0 ? void 0 : _c.call(_b);
3417
+ this.endCallEvent.emit();
3418
+ }
3419
+ this.cdr.detectChanges();
3420
+ }
3392
3421
  initiateCall(payload) {
3393
3422
  return __awaiter(this, void 0, void 0, function* () {
3394
3423
  return yield this.extensionService.initiateCall(payload).toPromise();