@vgroup/dialbox 0.6.3-0.18 → 0.6.3-0.19

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.
@@ -1774,6 +1774,7 @@ class CallProgressComponent {
1774
1774
  this.isIncomingCallBtnDisable = false;
1775
1775
  this.isNewAddedCall = false;
1776
1776
  this.deviceNumberList = [];
1777
+ this.ourNumberInfo = {};
1777
1778
  this.micOn = false;
1778
1779
  this.isMinimised = false;
1779
1780
  this.showDisconnectModal = false;
@@ -1830,43 +1831,44 @@ class CallProgressComponent {
1830
1831
  this.deviceNumberList = this.callerIdList.map((res) => res.number);
1831
1832
  }
1832
1833
  this.newIncomingCallsList.forEach((callInfo, i) => {
1834
+ var _a;
1833
1835
  this.conferenceId = i == 0 ? this.newIncomingCallsList[i].conferenceId : this.conferenceId;
1834
- let ourNumber = this.newIncomingCallsList[i].participants.find((resData) => ((this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.from) && (resData === null || resData === void 0 ? void 0 : resData.to) == 'c2c_softphone_client') || (this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.to) && (resData === null || resData === void 0 ? void 0 : resData.direction) == 'incoming-call')) && !(resData === null || resData === void 0 ? void 0 : resData.isLeft));
1835
- console.log(ourNumber, 'ourNumber');
1836
- if (ourNumber === null || ourNumber === void 0 ? void 0 : ourNumber.id) {
1836
+ this.ourNumberInfo = this.newIncomingCallsList[i].participants.find((resData) => ((this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.from) && (resData === null || resData === void 0 ? void 0 : resData.to) == 'c2c_softphone_client') || (this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.to) && (resData === null || resData === void 0 ? void 0 : resData.direction) == 'incoming-call')) && !(resData === null || resData === void 0 ? void 0 : resData.isLeft));
1837
+ console.log(this.ourNumberInfo, 'ourNumber');
1838
+ if ((_a = this.ourNumberInfo) === null || _a === void 0 ? void 0 : _a.id) {
1837
1839
  this.newIncomingCallsList[i].participants.forEach((res) => __awaiter(this, void 0, void 0, function* () {
1838
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
1840
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
1839
1841
  if ((res === null || res === void 0 ? void 0 : res.to) == 'c2c_softphone_client') {
1840
1842
  this.hostnumber = res;
1841
1843
  }
1842
1844
  else {
1843
1845
  let contact = {};
1844
- if ((_a = this.contacts) === null || _a === void 0 ? void 0 : _a.length) {
1846
+ if ((_b = this.contacts) === null || _b === void 0 ? void 0 : _b.length) {
1845
1847
  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 === null || res === void 0 ? void 0 : res.direction) == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to); });
1846
1848
  }
1847
- if (((_b = this.currentCallList) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1849
+ if (((_c = this.currentCallList) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1848
1850
  let index = this.currentCallList.findIndex((item) => (item === null || item === void 0 ? void 0 : item.id) == (res === null || res === void 0 ? void 0 : res.id));
1849
1851
  if (index == -1 && !res.isLeft) {
1850
1852
  this.currentCallList.push(Object.assign(Object.assign({}, res), { img: (res === null || res === void 0 ? void 0 : res.direction) == "incoming-call" ? res === null || res === void 0 ? void 0 : res.toImage : (res === null || res === void 0 ? void 0 : res.fromImage) || (contact === null || contact === void 0 ? void 0 : contact.image) || 'assets/images/user.jpg', isIncomingCall: (res === null || res === void 0 ? void 0 : res.direction) == "incoming-call", isHold: res === null || res === void 0 ? void 0 : res.isHold, isMute: false, isConference: res === null || res === void 0 ? void 0 : res.isConference, isAcceptCall: (res === null || res === void 0 ? void 0 : res.direction) == "incoming-call" ? this.getStatus(res) : true, dial: true, phone: (res === null || res === void 0 ? void 0 : res.direction) == "incoming-call" ? res === null || res === void 0 ? void 0 : res.from : res === null || res === void 0 ? void 0 : res.to, participantId: res === null || res === void 0 ? void 0 : res.id, conferenceSid: callInfo === null || callInfo === void 0 ? void 0 : callInfo.conferenceSid, name: (res === null || res === void 0 ? void 0 : res.name) || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference((res === null || res === void 0 ? void 0 : res.joinedAt) || new Date().toUTCString()) }));
1851
1853
  if (this.showContactsPanel) {
1852
- this.getAllParticipants((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.conferenceSid);
1854
+ this.getAllParticipants((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.conferenceSid);
1853
1855
  this.applyFilter();
1854
1856
  }
1855
1857
  }
1856
1858
  else if (index != -1 && (res === null || res === void 0 ? void 0 : res.isLeft)) {
1857
- if (((_d = this.currentCallList[index]) === null || _d === void 0 ? void 0 : _d.id) == ((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.id)) {
1859
+ if (((_e = this.currentCallList[index]) === null || _e === void 0 ? void 0 : _e.id) == ((_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.id)) {
1858
1860
  this.currentCallList.splice(index, 1);
1859
- this.currentCall = ((_f = this.currentCallList) === null || _f === void 0 ? void 0 : _f.length) > 0 ? this.currentCallList[0] : {};
1860
- if (((_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.isHold) && !((_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.isConference)) {
1861
+ this.currentCall = ((_g = this.currentCallList) === null || _g === void 0 ? void 0 : _g.length) > 0 ? this.currentCallList[0] : {};
1862
+ if (((_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.isHold) && !((_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.isConference)) {
1861
1863
  yield this.onholdOrUnholdParticipant({
1862
- participantId: [(_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.participantId],
1863
- conferenceId: (_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.conferenceId,
1864
+ participantId: [(_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.participantId],
1865
+ conferenceId: (_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.conferenceId,
1864
1866
  hold: false,
1865
- mute: ((_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.mute) || false,
1866
- conference: (_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.isConference
1867
+ mute: ((_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.mute) || false,
1868
+ conference: (_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.isConference
1867
1869
  });
1868
1870
  }
1869
- else if (((_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.isHold) && ((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.isConference)) {
1871
+ else if (((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.isHold) && ((_q = this.currentCall) === null || _q === void 0 ? void 0 : _q.isConference)) {
1870
1872
  let conferenceCalllist = this.currentCallList.filter((item) => { var _a; return item.isConference && item.conferenceId == ((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId); });
1871
1873
  if ((conferenceCalllist === null || conferenceCalllist === void 0 ? void 0 : conferenceCalllist.length) > 0) {
1872
1874
  // await this.onholdOrUnholdParticipant({
@@ -1877,11 +1879,11 @@ class CallProgressComponent {
1877
1879
  // conference: this.currentCall?.isConference || false
1878
1880
  // });
1879
1881
  yield this.onholdOrUnholdParticipant({
1880
- participantId: [(_q = this.hostnumber) === null || _q === void 0 ? void 0 : _q.participantId],
1881
- conferenceId: (_r = this.currentCall) === null || _r === void 0 ? void 0 : _r.conferenceId,
1882
+ participantId: [(_r = this.hostnumber) === null || _r === void 0 ? void 0 : _r.participantId],
1883
+ conferenceId: (_s = this.currentCall) === null || _s === void 0 ? void 0 : _s.conferenceId,
1882
1884
  hold: false,
1883
- mute: ((_s = this.currentCall) === null || _s === void 0 ? void 0 : _s.mute) || false,
1884
- conference: (_t = this.currentCall) === null || _t === void 0 ? void 0 : _t.isConference
1885
+ mute: ((_t = this.currentCall) === null || _t === void 0 ? void 0 : _t.mute) || false,
1886
+ conference: (_u = this.currentCall) === null || _u === void 0 ? void 0 : _u.isConference
1885
1887
  });
1886
1888
  this.isConferenceCallHold = false;
1887
1889
  }
@@ -1891,7 +1893,7 @@ class CallProgressComponent {
1891
1893
  this.currentCallList.splice(index, 1);
1892
1894
  }
1893
1895
  if (this.showContactsPanel) {
1894
- this.getAllParticipants((_u = this.currentCall) === null || _u === void 0 ? void 0 : _u.conferenceSid);
1896
+ this.getAllParticipants((_v = this.currentCall) === null || _v === void 0 ? void 0 : _v.conferenceSid);
1895
1897
  this.applyFilter();
1896
1898
  }
1897
1899
  }
@@ -1901,7 +1903,7 @@ class CallProgressComponent {
1901
1903
  }
1902
1904
  else if (!res.isLeft) {
1903
1905
  this.currentCallList.push(Object.assign(Object.assign({}, res), { img: res.direction == "incoming-call" ? res === null || res === void 0 ? void 0 : res.toImage : (res === null || res === void 0 ? void 0 : res.fromImage) || (contact === null || contact === void 0 ? void 0 : contact.image) || 'assets/images/user.jpg', isIncomingCall: res.direction == "incoming-call", isHold: res === null || res === void 0 ? void 0 : res.isHold, isMute: res === null || res === void 0 ? void 0 : res.isMute, 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 === null || callInfo === void 0 ? void 0 : callInfo.conferenceSid, name: (res === null || res === void 0 ? void 0 : res.name) || (res === null || res === void 0 ? void 0 : res.fromName) || (res === null || res === void 0 ? void 0 : res.toName), time: this.getTimeDifference((res === null || res === void 0 ? void 0 : res.joinedAt) || new Date().toUTCString()) }));
1904
- if (((_v = this.currentCallList) === null || _v === void 0 ? void 0 : _v.length) == 1) {
1906
+ if (((_w = this.currentCallList) === null || _w === void 0 ? void 0 : _w.length) == 1) {
1905
1907
  this.currentCall = this.currentCallList[0];
1906
1908
  }
1907
1909
  this.timer = '00:00';
@@ -2636,14 +2638,24 @@ class CallProgressComponent {
2636
2638
  deviceId: this.deviceId,
2637
2639
  conferenceId: (data === null || data === void 0 ? void 0 : data.conferenceId) || 'no'
2638
2640
  };
2639
- // this.extensionService.setIncomingCallStatus(payload).subscribe(async (res: any) => {
2640
- // if (res.status == 200) {
2641
- this.call = yield this.twilioService.connect({ conferenceId: data.conferenceId, conferenceName: `conf_${data.conferenceId}` });
2642
- this.incomeingCallSocketService.isCurrentIncomingCallList.push(data === null || data === void 0 ? void 0 : data.id);
2643
- console.log(this.call, 'callConnect');
2644
- data.isAcceptCall = true;
2645
- this.isIncomingCallBtnDisable = false;
2646
- this.incomeingCallSocketService.pause();
2641
+ this.extensionService.setIncomingCallStatus(payload).subscribe((res) => __awaiter(this, void 0, void 0, function* () {
2642
+ if (res.status == 200) {
2643
+ this.call = yield this.twilioService.connect({ conferenceId: res.conferenceId, conferenceName: res.conferenceName });
2644
+ this.incomeingCallSocketService.isCurrentIncomingCallList.push(data === null || data === void 0 ? void 0 : data.id);
2645
+ console.log(this.call, 'callConnect');
2646
+ data.isAcceptCall = true;
2647
+ this.isIncomingCallBtnDisable = false;
2648
+ this.incomeingCallSocketService.pause();
2649
+ }
2650
+ else {
2651
+ let index = this.currentCallList.findIndex((res) => res.participantId == data.participantId);
2652
+ this.currentCallList.splice(index, 1);
2653
+ swal("Error", res === null || res === void 0 ? void 0 : res.message.join("<br/>"), "error");
2654
+ this.incomeingCallSocketService.pause();
2655
+ this.isIncomingCallBtnDisable = false;
2656
+ this.endCallEvent.emit(data);
2657
+ }
2658
+ }));
2647
2659
  });
2648
2660
  }
2649
2661
  callContact(contact, isUnsavedNumber) {
@@ -2773,7 +2785,7 @@ class CallProgressComponent {
2773
2785
  });
2774
2786
  }
2775
2787
  CallToUnsavedNumber(number, isNewConference) {
2776
- var _a;
2788
+ var _a, _b, _c, _d;
2777
2789
  return __awaiter(this, void 0, void 0, function* () {
2778
2790
  try {
2779
2791
  const isInvalid = yield this.isInvalidNumber(number);
@@ -2845,6 +2857,15 @@ class CallProgressComponent {
2845
2857
  // participentList.push(resData?.participantId)
2846
2858
  // }
2847
2859
  // })
2860
+ let selfInfo = this.allParticipentList.find((resData) => (this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.from) && (resData === null || resData === void 0 ? void 0 : resData.to) == 'c2c_softphone_client') || (this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.to)));
2861
+ console.log(selfInfo, 'selfInfo');
2862
+ yield this.onholdOrUnholdParticipant({
2863
+ participantId: [selfInfo === null || selfInfo === void 0 ? void 0 : selfInfo.participantId],
2864
+ conferenceId: (_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId,
2865
+ hold: true,
2866
+ mute: ((_b = this.currentCall) === null || _b === void 0 ? void 0 : _b.mute) || false,
2867
+ conference: ((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.isConference) || false
2868
+ });
2848
2869
  if (participentList === null || participentList === void 0 ? void 0 : participentList.length) {
2849
2870
  // await this.onholdOrUnholdParticipant({
2850
2871
  // participantId: participentList,
@@ -2853,7 +2874,12 @@ class CallProgressComponent {
2853
2874
  // mute: this.currentCall?.mute || false,
2854
2875
  // conference: this.currentCall?.isConference || false
2855
2876
  // });
2856
- if ((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.isConference) {
2877
+ this.newIncomingCallsList.forEach((resData) => {
2878
+ if (resData === null || resData === void 0 ? void 0 : resData.participantId) {
2879
+ participentList.push(resData === null || resData === void 0 ? void 0 : resData.participantId);
2880
+ }
2881
+ });
2882
+ if ((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.isConference) {
2857
2883
  this.isConferenceCallHold = true;
2858
2884
  }
2859
2885
  this.startCall(callData, isNewConference);