@vgroup/dialbox 0.3.78 → 0.3.79
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.
|
@@ -1805,11 +1805,56 @@ class CallProgressComponent {
|
|
|
1805
1805
|
try {
|
|
1806
1806
|
if (this.newIncomingCallsList.length) {
|
|
1807
1807
|
// Check if there's an active ongoing call
|
|
1808
|
-
this.newIncomingCallsList.forEach((res) => {
|
|
1809
|
-
|
|
1808
|
+
this.newIncomingCallsList.forEach((res) => __awaiter(this, void 0, void 0, function* () {
|
|
1809
|
+
var _d, _e, _f, _g, _h;
|
|
1810
|
+
if (this.currentCallList.length > 0) {
|
|
1811
|
+
let index = this.currentCallList.findIndex((item) => item.id == res.id);
|
|
1812
|
+
if (index == -1 && !res.isLeft) {
|
|
1813
|
+
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: this.getStatus(res), 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, name: res.name }));
|
|
1814
|
+
}
|
|
1815
|
+
else if (index != -1 && res.isLeft) {
|
|
1816
|
+
if (this.currentCallList[index].id == this.currentCall.id) {
|
|
1817
|
+
this.currentCallList.splice(index, 1);
|
|
1818
|
+
this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
|
|
1819
|
+
if (((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.isHold) && !((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.isConference)) {
|
|
1820
|
+
yield this.onholdOrUnholdParticipant({
|
|
1821
|
+
participantId: [(_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.participantId],
|
|
1822
|
+
conferenceId: this.conferenceId,
|
|
1823
|
+
hold: false
|
|
1824
|
+
});
|
|
1825
|
+
this.currentCallList[0].isHold = false;
|
|
1826
|
+
}
|
|
1827
|
+
else if (((_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.isHold) && ((_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.isConference)) {
|
|
1828
|
+
let conferenceCalllist = this.currentCallList.filter((item) => item.isConference);
|
|
1829
|
+
if (conferenceCalllist.length > 0) {
|
|
1830
|
+
yield this.onholdOrUnholdParticipant({
|
|
1831
|
+
participantId: conferenceCalllist.map((item) => item.participantId),
|
|
1832
|
+
conferenceId: this.conferenceId,
|
|
1833
|
+
hold: false
|
|
1834
|
+
});
|
|
1835
|
+
this.currentCallList.forEach((item) => {
|
|
1836
|
+
if (item.isConference) {
|
|
1837
|
+
item.isHold = false;
|
|
1838
|
+
}
|
|
1839
|
+
else {
|
|
1840
|
+
item.isHold = true;
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
else {
|
|
1847
|
+
this.currentCallList.splice(index, 1);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
else {
|
|
1851
|
+
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: this.getStatus(res), 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, name: res.name });
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1810
1855
|
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: this.getStatus(res), 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, name: res.name }));
|
|
1811
1856
|
}
|
|
1812
|
-
});
|
|
1857
|
+
}));
|
|
1813
1858
|
}
|
|
1814
1859
|
else if (!this.newIncomingCallsList.length) {
|
|
1815
1860
|
this.isConcurrentIncoming = false;
|
|
@@ -1830,7 +1875,7 @@ class CallProgressComponent {
|
|
|
1830
1875
|
}
|
|
1831
1876
|
getStatus(res) {
|
|
1832
1877
|
if (res.direction == "incoming-call") {
|
|
1833
|
-
if (res.status == "
|
|
1878
|
+
if (res.status == "answered" || res.status == "participant-hold" || res.status == "participant-mute" || res.status == "participant-join") {
|
|
1834
1879
|
return true;
|
|
1835
1880
|
}
|
|
1836
1881
|
else {
|
|
@@ -1838,7 +1883,7 @@ class CallProgressComponent {
|
|
|
1838
1883
|
}
|
|
1839
1884
|
}
|
|
1840
1885
|
else if (res.direction == "outgoing-call") {
|
|
1841
|
-
if (res.status == "
|
|
1886
|
+
if (res.status == "answered" || res.status == "participant-hold" || res.status == "participant-mute" || res.status == "participant-join") {
|
|
1842
1887
|
return true;
|
|
1843
1888
|
}
|
|
1844
1889
|
else {
|