@vgroup/dialbox 0.8.6 → 0.8.7

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.
@@ -2314,6 +2314,7 @@ class CallProgressComponent {
2314
2314
  this.isParticipantPanelLoading = false;
2315
2315
  this.pendingNewCallHeldParticipant = null;
2316
2316
  this.isCallCancelled = false;
2317
+ this.isNewCallLoader = false;
2317
2318
  this.isMinimised = false;
2318
2319
  this.showDisconnectModal = false;
2319
2320
  this.call = this.twilioService.call;
@@ -2346,6 +2347,7 @@ class CallProgressComponent {
2346
2347
  }
2347
2348
  else if (((_c = changes['callData'].currentValue) === null || _c === void 0 ? void 0 : _c.displayNum) || ((_d = changes['callData'].currentValue) === null || _d === void 0 ? void 0 : _d.from)) {
2348
2349
  this.currentCall = Object.assign(Object.assign({}, changes['callData'].currentValue), { id: '125', img: 'assets/images/user.jpg', isIncomingCall: false, isHold: false, isMute: false, isConference: false, isAcceptCall: true, dial: true, phone: (_e = changes['callData'].currentValue) === null || _e === void 0 ? void 0 : _e.phone, participantId: '121', name: ((_f = changes['callData'].currentValue) === null || _f === void 0 ? void 0 : _f.name) || ((_g = changes['callData'].currentValue) === null || _g === void 0 ? void 0 : _g.fromName) || ((_h = changes['callData'].currentValue) === null || _h === void 0 ? void 0 : _h.toName) || '', time: this.timer });
2350
+ this.isNewCallLoader = true;
2349
2351
  this.onAddNewCall(changes['callData'].currentValue);
2350
2352
  }
2351
2353
  }
@@ -2656,6 +2658,7 @@ class CallProgressComponent {
2656
2658
  this.isRinging = false;
2657
2659
  this.isConcurrentIncoming = false;
2658
2660
  if (this.call) {
2661
+ console.log('call disconnect 566');
2659
2662
  this.call.disconnect();
2660
2663
  }
2661
2664
  this.currentCallList = [];
@@ -2686,6 +2689,7 @@ class CallProgressComponent {
2686
2689
  this.deviceNumberList = this.callerIdList.map((res) => res.number);
2687
2690
  let data = (_27 = this.newIncomingCallsList.find((item) => { var _a; return (item === null || item === void 0 ? void 0 : item.conferenceId) == ((_a = this.callAction) === null || _a === void 0 ? void 0 : _a.conferenceId); })) === null || _27 === void 0 ? void 0 : _27.participants.find((resData) => resData === null || resData === void 0 ? void 0 : resData.host);
2688
2691
  if ((data === null || data === void 0 ? void 0 : data.isLeft) || !data) {
2692
+ this.isNewCallLoader = true;
2689
2693
  this.rejoinHost(this.callAction);
2690
2694
  }
2691
2695
  }
@@ -2758,9 +2762,11 @@ class CallProgressComponent {
2758
2762
  clientSid: (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.parameters) === null || _b === void 0 ? void 0 : _b['CallSid'],
2759
2763
  recordId: rejoinParticipentInfo === null || rejoinParticipentInfo === void 0 ? void 0 : rejoinParticipentInfo.id
2760
2764
  });
2765
+ this.isNewCallLoader = false;
2761
2766
  this.conferenceCallIDForParticipantList = rejoinParticipentInfo === null || rejoinParticipentInfo === void 0 ? void 0 : rejoinParticipentInfo.conferenceId;
2762
2767
  }
2763
2768
  catch (error) {
2769
+ this.isNewCallLoader = false;
2764
2770
  console.error('Error in addClientParticipant:', error);
2765
2771
  }
2766
2772
  };
@@ -2964,12 +2970,13 @@ class CallProgressComponent {
2964
2970
  }
2965
2971
  this.conferenceId = (_b = response === null || response === void 0 ? void 0 : response.callauth) === null || _b === void 0 ? void 0 : _b.id;
2966
2972
  this.isCallCancelled = false;
2967
- if (response.status == 200) {
2973
+ if ((response === null || response === void 0 ? void 0 : response.status) == 200) {
2968
2974
  this.pendingNewCallHeldParticipant = null;
2969
2975
  const { id: callAuthId, recordCall, tokenData } = yield this.getCallAuthId(response);
2970
2976
  this.recordCall = recordCall; // Store the recordCall value
2971
2977
  yield this.connectToDevice(callAuthId, callData, tokenData);
2972
2978
  yield this.pollCallStatus(callAuthId);
2979
+ console.log('Call initiated successfully:', response);
2973
2980
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
2974
2981
  var _c, _d, _e, _f, _g;
2975
2982
  try {
@@ -2997,6 +3004,7 @@ class CallProgressComponent {
2997
3004
  countrycode: '',
2998
3005
  deviceId: this.deviceId,
2999
3006
  });
3007
+ this.isNewCallLoader = false;
3000
3008
  if (isNewConference) {
3001
3009
  this.conferenceCallIDForParticipantList = (_f = response === null || response === void 0 ? void 0 : response.callauth) === null || _f === void 0 ? void 0 : _f.id;
3002
3010
  }
@@ -3005,6 +3013,7 @@ class CallProgressComponent {
3005
3013
  this.extensionService.isLoadershow.next(false);
3006
3014
  this.isLoadershown.emit(false);
3007
3015
  }
3016
+ this.showRingAnimation = false;
3008
3017
  // this.conferenceCallIDForParticipantList = response?.callauth?.id;
3009
3018
  // await this.getAllParticipants(response?.callauth?.id);
3010
3019
  }
@@ -4628,15 +4637,16 @@ class CallProgressComponent {
4628
4637
  }
4629
4638
  }
4630
4639
  ngOnDestroy() {
4640
+ var _a, _b, _c;
4631
4641
  this.callData.dial = false;
4632
- setTimeout(() => {
4633
- var _a, _b, _c;
4634
- if (!((_a = this.newIncomingCallsList) === null || _a === void 0 ? void 0 : _a.length)) {
4635
- (_b = this.twilioService.device) === null || _b === void 0 ? void 0 : _b.disconnectAll();
4636
- this.call.disconnect();
4637
- (_c = this.device) === null || _c === void 0 ? void 0 : _c.destroy();
4638
- }
4639
- }, 1500);
4642
+ // setTimeout(() => {
4643
+ if (!((_a = this.newIncomingCallsList) === null || _a === void 0 ? void 0 : _a.length) && !this.isNewCallLoader) {
4644
+ console.log('Destroying device and disconnecting all calls 2572');
4645
+ (_b = this.twilioService.device) === null || _b === void 0 ? void 0 : _b.disconnectAll();
4646
+ this.call.disconnect();
4647
+ (_c = this.device) === null || _c === void 0 ? void 0 : _c.destroy();
4648
+ }
4649
+ // }, 1500);
4640
4650
  if (this.timerSubscription) {
4641
4651
  this.timerSubscription.unsubscribe();
4642
4652
  }
@@ -5046,6 +5056,7 @@ class DialboxComponent {
5046
5056
  this.isCallInProgress = false;
5047
5057
  setTimeout(() => {
5048
5058
  var _a, _b, _c;
5059
+ console.log('344');
5049
5060
  if (!((_a = this.twilioService.acceptedCallList) === null || _a === void 0 ? void 0 : _a.length)) {
5050
5061
  (_b = this.twilioService.device) === null || _b === void 0 ? void 0 : _b.disconnectAll();
5051
5062
  (_c = this.twilioService.spareDevice) === null || _c === void 0 ? void 0 : _c.disconnectAll();
@@ -5055,15 +5066,14 @@ class DialboxComponent {
5055
5066
  }
5056
5067
  }
5057
5068
  if (!((_e = this.incomingCallsList) === null || _e === void 0 ? void 0 : _e.length)) {
5058
- setTimeout(() => {
5059
- var _a, _b, _c;
5060
- if (!((_a = this.incomingCallsList) === null || _a === void 0 ? void 0 : _a.length)) {
5061
- this.isCallInProgress = false;
5062
- (_b = this.twilioService.device) === null || _b === void 0 ? void 0 : _b.disconnectAll();
5063
- (_c = this.twilioService.spareDevice) === null || _c === void 0 ? void 0 : _c.disconnectAll();
5064
- this.twilioService.acceptedCallList = [];
5065
- }
5066
- }, 2000);
5069
+ // setTimeout(() => {
5070
+ // if(!this.incomingCallsList?.length) {
5071
+ // this.isCallInProgress = false;
5072
+ // this.twilioService.device?.disconnectAll();
5073
+ // this.twilioService.spareDevice?.disconnectAll();
5074
+ // this.twilioService.acceptedCallList = [];
5075
+ // }
5076
+ // }, 5000);
5067
5077
  }
5068
5078
  }));
5069
5079
  this.token = localStorage.getItem('ext_token') || '';
@@ -6062,6 +6072,7 @@ class DialboxComponent {
6062
6072
  this.incomingCallsList = [];
6063
6073
  // Clean up Twilio device when component is destroyed
6064
6074
  if (this.twilioService['device']) {
6075
+ console.log('1402');
6065
6076
  this.twilioService['device'].disconnectAll();
6066
6077
  this.twilioService['device'].destroy();
6067
6078
  }