@vgroup/dialbox 0.6.3-0.10 → 0.6.3-0.12

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.
@@ -1835,40 +1835,40 @@ class CallProgressComponent {
1835
1835
  console.log(ourNumber, 'ourNumber');
1836
1836
  if (ourNumber === null || ourNumber === void 0 ? void 0 : ourNumber.id) {
1837
1837
  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;
1839
- if ((res === null || res === void 0 ? void 0 : res.to) == 'c2c_softphone_client' && this.deviceNumberList.includes(res === null || res === void 0 ? void 0 : res.from)) {
1838
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
1839
+ if ((res === null || res === void 0 ? void 0 : res.to) == 'c2c_softphone_client') {
1840
1840
  this.hostnumber = res;
1841
1841
  }
1842
1842
  else {
1843
1843
  let contact = {};
1844
1844
  if ((_a = this.contacts) === null || _a === void 0 ? void 0 : _a.length) {
1845
- 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); });
1845
+ 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
1846
  }
1847
- if (this.currentCallList.length > 0) {
1847
+ if (((_b = this.currentCallList) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1848
1848
  let index = this.currentCallList.findIndex((item) => item.id == res.id);
1849
1849
  if (index == -1 && !res.isLeft) {
1850
- 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.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()) }));
1850
+ 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
1851
  if (this.showContactsPanel) {
1852
- this.getAllParticipants(this.currentCall.conferenceSid);
1852
+ this.getAllParticipants((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.conferenceSid);
1853
1853
  this.applyFilter();
1854
1854
  }
1855
1855
  }
1856
- else if (index != -1 && res.isLeft) {
1857
- if (((_b = this.currentCallList[index]) === null || _b === void 0 ? void 0 : _b.id) == ((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.id)) {
1856
+ 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)) {
1858
1858
  this.currentCallList.splice(index, 1);
1859
- this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
1860
- if (((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.isHold) && !((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.isConference)) {
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
1861
  yield this.onholdOrUnholdParticipant({
1862
- participantId: [(_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.participantId],
1863
- conferenceId: (_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.conferenceId,
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
1864
  hold: false,
1865
- mute: ((_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.mute) || false,
1866
- conference: (_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.isConference
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
1867
  });
1868
1868
  }
1869
- else if (((_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.isHold) && ((_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.isConference)) {
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)) {
1870
1870
  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
- if (conferenceCalllist.length > 0) {
1871
+ if ((conferenceCalllist === null || conferenceCalllist === void 0 ? void 0 : conferenceCalllist.length) > 0) {
1872
1872
  // await this.onholdOrUnholdParticipant({
1873
1873
  // participantId: conferenceCalllist.map((item: any) => item.participantId),
1874
1874
  // conferenceId: conferenceCalllist[0]?.conferenceId,
@@ -1877,11 +1877,11 @@ class CallProgressComponent {
1877
1877
  // conference: this.currentCall?.isConference || false
1878
1878
  // });
1879
1879
  yield this.onholdOrUnholdParticipant({
1880
- participantId: [(_m = this.hostnumber) === null || _m === void 0 ? void 0 : _m.participantId],
1881
- conferenceId: (_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.conferenceId,
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
1882
  hold: false,
1883
- mute: ((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.mute) || false,
1884
- conference: (_q = this.currentCall) === null || _q === void 0 ? void 0 : _q.isConference
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
1885
  });
1886
1886
  this.isConferenceCallHold = false;
1887
1887
  }
@@ -1891,17 +1891,17 @@ class CallProgressComponent {
1891
1891
  this.currentCallList.splice(index, 1);
1892
1892
  }
1893
1893
  if (this.showContactsPanel) {
1894
- this.getAllParticipants(this.currentCall.conferenceSid);
1894
+ this.getAllParticipants((_u = this.currentCall) === null || _u === void 0 ? void 0 : _u.conferenceSid);
1895
1895
  this.applyFilter();
1896
1896
  }
1897
1897
  }
1898
1898
  else if (index != -1) {
1899
- this.currentCallList[index] = 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.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()) });
1899
+ this.currentCallList[index] = 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: res === null || res === void 0 ? void 0 : res.isMute, isConference: res === null || res === void 0 ? void 0 : res.isConference, isAcceptCall: 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()) });
1900
1900
  }
1901
1901
  }
1902
1902
  else if (!res.isLeft) {
1903
- 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.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()) }));
1904
- if (((_r = this.currentCallList) === null || _r === void 0 ? void 0 : _r.length) == 1) {
1903
+ 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) {
1905
1905
  this.currentCall = this.currentCallList[0];
1906
1906
  }
1907
1907
  this.timer = '00:00';
@@ -3885,12 +3885,17 @@ class DialboxComponent {
3885
3885
  // so we can auto-open on incoming calls.
3886
3886
  this.initializeTwilio();
3887
3887
  this.incomeingCallSocketService.connect(this.deviceId);
3888
+ let deviceNumberList = this.callerIdList.map((res) => res.number);
3888
3889
  try {
3889
3890
  this.incomeingCallSocketService.listen().subscribe((incomingCallData) => __awaiter(this, void 0, void 0, function* () {
3890
3891
  var _a, _b;
3891
3892
  this.twilioService.conferenceCallInfo = incomingCallData;
3892
3893
  incomingCallData = (incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length) > 0 ? incomingCallData.filter((item) => { var _a; return ((_a = item.participants) === null || _a === void 0 ? void 0 : _a.length) > 0; }) : [];
3893
- if (!!(incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length)) {
3894
+ let ourNumber = {};
3895
+ this.incomingCallData.forEach((callInfo, i) => {
3896
+ ourNumber = callInfo.participants.find((resData) => ((deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.from) && (resData === null || resData === void 0 ? void 0 : resData.to) == 'c2c_softphone_client') || (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));
3897
+ });
3898
+ if (!!(incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length) && (ourNumber === null || ourNumber === void 0 ? void 0 : ourNumber.id)) {
3894
3899
  // this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
3895
3900
  this.incomingCallsList = incomingCallData || [];
3896
3901
  let parentCall = [];