@vgroup/dialbox 0.5.39 → 0.5.41

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.
@@ -1827,10 +1827,11 @@ class CallProgressComponent {
1827
1827
  this.conferenceId = i == 0 ? this.newIncomingCallsList[i].conferenceId : this.conferenceId;
1828
1828
  this.newIncomingCallsList[i].participants.forEach((res) => __awaiter(this, void 0, void 0, function* () {
1829
1829
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1830
+ let contact = this.contacts.find((resData) => { var _a; return ((_a = resData === null || resData === void 0 ? void 0 : resData.numbersList[0]) === null || _a === void 0 ? void 0 : _a.number) == (res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to); });
1830
1831
  if (this.currentCallList.length > 0) {
1831
1832
  let index = this.currentCallList.findIndex((item) => item.id == res.id);
1832
1833
  if (index == -1 && !res.isLeft) {
1833
- this.currentCallList.push(Object.assign(Object.assign({}, res), { img: 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) }));
1834
+ this.currentCallList.push(Object.assign(Object.assign({}, res), { img: (res === null || res === void 0 ? void 0 : res.image) || (contact === null || contact === void 0 ? void 0 : contact.image) || 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) }));
1834
1835
  if (this.showContactsPanel) {
1835
1836
  this.getAllParticipants(this.currentCall.conferenceSid);
1836
1837
  this.applyFilter();
@@ -1872,11 +1873,11 @@ class CallProgressComponent {
1872
1873
  }
1873
1874
  }
1874
1875
  else if (index != -1) {
1875
- this.currentCallList[index] = Object.assign(Object.assign({}, res), { img: 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) });
1876
+ this.currentCallList[index] = Object.assign(Object.assign({}, res), { img: (res === null || res === void 0 ? void 0 : res.image) || (contact === null || contact === void 0 ? void 0 : contact.image) || 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) });
1876
1877
  }
1877
1878
  }
1878
1879
  else if (!res.isLeft) {
1879
- this.currentCallList.push(Object.assign(Object.assign({}, res), { img: 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) }));
1880
+ this.currentCallList.push(Object.assign(Object.assign({}, res), { img: (res === null || res === void 0 ? void 0 : res.image) || (contact === null || contact === void 0 ? void 0 : contact.image) || 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res.isHold, isMute: false, isConference: res.isConference, isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res.id, conferenceSid: callInfo.conferenceSid, name: res.name || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()) }));
1880
1881
  this.timer = '00:00';
1881
1882
  this.startTimer();
1882
1883
  }
@@ -3548,6 +3549,7 @@ class DialboxComponent {
3548
3549
  this.incomeingCallSocketService.connect(this.deviceId);
3549
3550
  try {
3550
3551
  this.incomeingCallSocketService.listen().subscribe((incomingCallData) => __awaiter(this, void 0, void 0, function* () {
3552
+ var _a;
3551
3553
  // const data = JSON.parse(incomingCallData.data);
3552
3554
  // console.log("WS Event Received:", incomingCallData);
3553
3555
  // console.log("WS Event Received:", incomingCallData.data);
@@ -3585,8 +3587,9 @@ class DialboxComponent {
3585
3587
  if (!this.isIncomingCallnotification) {
3586
3588
  this.callData = [];
3587
3589
  this.incomingCallsList = [];
3590
+ this.isCallInProgress = false;
3591
+ (_a = this.twilioService.device) === null || _a === void 0 ? void 0 : _a.disconnectAll();
3588
3592
  }
3589
- // this.isCallInProgress = false;
3590
3593
  }
3591
3594
  // incomingCallData.participants.length ? incomingCallData.participants.filter((item: any) => !item.isLeft) : [];
3592
3595
  // this.initializeTwilio();
@@ -3965,15 +3968,15 @@ class DialboxComponent {
3965
3968
  }
3966
3969
  }
3967
3970
  incomingCallNotification(callerInfo) {
3968
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3971
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3969
3972
  let incomingCall = {
3970
3973
  conferenceId: 'no',
3971
3974
  isActive: true,
3972
3975
  isIncomingCall: true,
3973
3976
  participantId: (_a = this.incomingCallnotification.data.data) === null || _a === void 0 ? void 0 : _a.participantId,
3974
3977
  participants: [
3975
- { direction: "incoming-call", img: 'assets/images/user.jpg', isIncomingCall: true, isHold: false, isConference: false, isAcceptCall: false, dial: true, phone: (_b = this.incomingCallnotification.data.data) === null || _b === void 0 ? void 0 : _b.fromNumber, to: (_c = this.incomingCallnotification.data.data) === null || _c === void 0 ? void 0 : _c.toNumber,
3976
- from: (_d = this.incomingCallnotification.data.data) === null || _d === void 0 ? void 0 : _d.fromNumber, fromName: (_e = this.incomingCallnotification.data.data) === null || _e === void 0 ? void 0 : _e.fromName, participantId: (_f = this.incomingCallnotification.data.data) === null || _f === void 0 ? void 0 : _f.participantId, name: (_g = this.incomingCallnotification.data.data) === null || _g === void 0 ? void 0 : _g.fromName, time: '', id: (_h = this.incomingCallnotification.data.data) === null || _h === void 0 ? void 0 : _h.participantId }
3978
+ { direction: "incoming-call", img: ((_b = this.incomingCallnotification.data.data) === null || _b === void 0 ? void 0 : _b.image) || 'assets/images/user.jpg', isIncomingCall: true, isHold: false, isConference: false, isAcceptCall: false, dial: true, phone: (_c = this.incomingCallnotification.data.data) === null || _c === void 0 ? void 0 : _c.fromNumber, to: (_d = this.incomingCallnotification.data.data) === null || _d === void 0 ? void 0 : _d.toNumber,
3979
+ from: (_e = this.incomingCallnotification.data.data) === null || _e === void 0 ? void 0 : _e.fromNumber, fromName: (_f = this.incomingCallnotification.data.data) === null || _f === void 0 ? void 0 : _f.fromName, participantId: (_g = this.incomingCallnotification.data.data) === null || _g === void 0 ? void 0 : _g.participantId, name: (_h = this.incomingCallnotification.data.data) === null || _h === void 0 ? void 0 : _h.fromName, time: '', id: (_j = this.incomingCallnotification.data.data) === null || _j === void 0 ? void 0 : _j.participantId }
3977
3980
  ],
3978
3981
  };
3979
3982
  if (callerInfo) {
@@ -3996,7 +3999,7 @@ class DialboxComponent {
3996
3999
  this.notificationCallList = this.notificationCallList.filter((res) => (res === null || res === void 0 ? void 0 : res.endTime) >= now);
3997
4000
  this.incomingCallsList = [...this.incomingCallsList, ...this.notificationCallList];
3998
4001
  this.cdk.detectChanges();
3999
- if ((_j = this.incomingCallnotification.data.data) === null || _j === void 0 ? void 0 : _j.participantId) {
4002
+ if ((_k = this.incomingCallnotification.data.data) === null || _k === void 0 ? void 0 : _k.participantId) {
4000
4003
  this.isCallInProgress = true;
4001
4004
  this.cdk.detectChanges();
4002
4005
  this.isDialpadHidden = false;