@vgroup/dialbox 0.5.40 → 0.5.42

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.
@@ -1826,8 +1826,11 @@ class CallProgressComponent {
1826
1826
  var _a;
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
- 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); });
1829
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1830
+ let contact = {};
1831
+ if ((_b = this.contacts) === null || _b === void 0 ? void 0 : _b.length) {
1832
+ 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); });
1833
+ }
1831
1834
  if (this.currentCallList.length > 0) {
1832
1835
  let index = this.currentCallList.findIndex((item) => item.id == res.id);
1833
1836
  if (index == -1 && !res.isLeft) {
@@ -1838,27 +1841,27 @@ class CallProgressComponent {
1838
1841
  }
1839
1842
  }
1840
1843
  else if (index != -1 && res.isLeft) {
1841
- if (((_b = this.currentCallList[index]) === null || _b === void 0 ? void 0 : _b.id) == ((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.id)) {
1844
+ if (((_c = this.currentCallList[index]) === null || _c === void 0 ? void 0 : _c.id) == ((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.id)) {
1842
1845
  this.currentCallList.splice(index, 1);
1843
1846
  this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
1844
- if (((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.isHold) && !((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.isConference)) {
1847
+ if (((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.isHold) && !((_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.isConference)) {
1845
1848
  yield this.onholdOrUnholdParticipant({
1846
- participantId: [(_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.participantId],
1847
- conferenceId: (_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.conferenceId,
1849
+ participantId: [(_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.participantId],
1850
+ conferenceId: (_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.conferenceId,
1848
1851
  hold: false,
1849
- mute: ((_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.mute) || false,
1850
- conference: (_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.isConference
1852
+ mute: ((_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.mute) || false,
1853
+ conference: (_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.isConference
1851
1854
  });
1852
1855
  }
1853
- else if (((_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.isHold) && ((_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.isConference)) {
1856
+ else if (((_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.isHold) && ((_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.isConference)) {
1854
1857
  let conferenceCalllist = this.currentCallList.filter((item) => item.isConference);
1855
1858
  if (conferenceCalllist.length > 0) {
1856
1859
  yield this.onholdOrUnholdParticipant({
1857
1860
  participantId: conferenceCalllist.map((item) => item.participantId),
1858
- conferenceId: (_m = conferenceCalllist[0]) === null || _m === void 0 ? void 0 : _m.conferenceId,
1861
+ conferenceId: (_o = conferenceCalllist[0]) === null || _o === void 0 ? void 0 : _o.conferenceId,
1859
1862
  hold: false,
1860
- mute: ((_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.mute) || false,
1861
- conference: ((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.isConference) || false
1863
+ mute: ((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.mute) || false,
1864
+ conference: ((_q = this.currentCall) === null || _q === void 0 ? void 0 : _q.isConference) || false
1862
1865
  });
1863
1866
  this.isConferenceCallHold = false;
1864
1867
  }
@@ -3549,6 +3552,7 @@ class DialboxComponent {
3549
3552
  this.incomeingCallSocketService.connect(this.deviceId);
3550
3553
  try {
3551
3554
  this.incomeingCallSocketService.listen().subscribe((incomingCallData) => __awaiter(this, void 0, void 0, function* () {
3555
+ var _a;
3552
3556
  // const data = JSON.parse(incomingCallData.data);
3553
3557
  // console.log("WS Event Received:", incomingCallData);
3554
3558
  // console.log("WS Event Received:", incomingCallData.data);
@@ -3586,8 +3590,9 @@ class DialboxComponent {
3586
3590
  if (!this.isIncomingCallnotification) {
3587
3591
  this.callData = [];
3588
3592
  this.incomingCallsList = [];
3593
+ this.isCallInProgress = false;
3594
+ (_a = this.twilioService.device) === null || _a === void 0 ? void 0 : _a.disconnectAll();
3589
3595
  }
3590
- // this.isCallInProgress = false;
3591
3596
  }
3592
3597
  // incomingCallData.participants.length ? incomingCallData.participants.filter((item: any) => !item.isLeft) : [];
3593
3598
  // this.initializeTwilio();