@vgroup/dialbox 0.4.60 → 0.4.62
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.
- package/esm2020/lib/components/call-progress/call-progress.component.mjs +138 -145
- package/fesm2015/vgroup-dialbox.mjs +113 -120
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +137 -144
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1816,11 +1816,11 @@ class CallProgressComponent {
|
|
|
1816
1816
|
this.GetContactsList();
|
|
1817
1817
|
}
|
|
1818
1818
|
ngOnChanges(changes) {
|
|
1819
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1819
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1820
1820
|
if (changes['callData']) {
|
|
1821
1821
|
if ((_a = changes['callData'].currentValue) === null || _a === void 0 ? void 0 : _a.isIncomingCall) {
|
|
1822
1822
|
this.incomingCallDiv = true;
|
|
1823
|
-
this.call['callInfo'] = JSON.parse(JSON.stringify(this.callData));
|
|
1823
|
+
// this.call['callInfo'] = JSON.parse(JSON.stringify(this.callData));
|
|
1824
1824
|
this.cdr.detectChanges();
|
|
1825
1825
|
}
|
|
1826
1826
|
else if (((_b = changes['callData'].currentValue) === null || _b === void 0 ? void 0 : _b.displayNum) || ((_c = changes['callData'].currentValue) === null || _c === void 0 ? void 0 : _c.from)) {
|
|
@@ -1830,141 +1830,134 @@ class CallProgressComponent {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
if (changes['newIncomingCallsList']) {
|
|
1833
|
-
try {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
}
|
|
1833
|
+
// try {
|
|
1834
|
+
if ((_h = this.newIncomingCallsList) === null || _h === void 0 ? void 0 : _h.length) {
|
|
1835
|
+
// Check if there's an active ongoing call
|
|
1836
|
+
this.conferenceId = this.newIncomingCallsList[0].conferenceId;
|
|
1837
|
+
this.newIncomingCallsList.forEach((res) => __awaiter(this, void 0, void 0, function* () {
|
|
1838
|
+
var _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1839
|
+
if (this.currentCallList.length > 0) {
|
|
1840
|
+
let index = this.currentCallList.findIndex((item) => item.id == res.id);
|
|
1841
|
+
if (index == -1 && !res.isLeft) {
|
|
1842
|
+
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, 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()) }));
|
|
1843
|
+
if (this.showContactsPanel) {
|
|
1844
|
+
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1845
|
+
this.applyFilter();
|
|
1847
1846
|
}
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1847
|
+
}
|
|
1848
|
+
else if (index != -1 && res.isLeft) {
|
|
1849
|
+
if (((_l = this.currentCallList[index]) === null || _l === void 0 ? void 0 : _l.id) == ((_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.id)) {
|
|
1850
|
+
this.currentCallList.splice(index, 1);
|
|
1851
|
+
this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
|
|
1852
|
+
if (((_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.isHold) && !((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.isConference)) {
|
|
1853
|
+
yield this.onholdOrUnholdParticipant({
|
|
1854
|
+
participantId: [(_q = this.currentCall) === null || _q === void 0 ? void 0 : _q.participantId],
|
|
1855
|
+
conferenceId: this.conferenceId,
|
|
1856
|
+
hold: false,
|
|
1857
|
+
conference: (_r = this.currentCall) === null || _r === void 0 ? void 0 : _r.isConference
|
|
1858
|
+
});
|
|
1859
|
+
// this.currentCallList[0].isHold = false;
|
|
1860
|
+
}
|
|
1861
|
+
else if (((_s = this.currentCall) === null || _s === void 0 ? void 0 : _s.isHold) && ((_t = this.currentCall) === null || _t === void 0 ? void 0 : _t.isConference)) {
|
|
1862
|
+
let conferenceCalllist = this.currentCallList.filter((item) => item.isConference);
|
|
1863
|
+
if (conferenceCalllist.length > 0) {
|
|
1853
1864
|
yield this.onholdOrUnholdParticipant({
|
|
1854
|
-
participantId:
|
|
1865
|
+
participantId: conferenceCalllist.map((item) => item.participantId),
|
|
1855
1866
|
conferenceId: this.conferenceId,
|
|
1856
1867
|
hold: false,
|
|
1857
|
-
conference: (
|
|
1868
|
+
conference: (_u = this.currentCall) === null || _u === void 0 ? void 0 : _u.isConference
|
|
1858
1869
|
});
|
|
1859
|
-
// this.currentCallList
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
hold: false,
|
|
1868
|
-
conference: (_s = this.currentCall) === null || _s === void 0 ? void 0 : _s.isConference
|
|
1869
|
-
});
|
|
1870
|
-
// this.currentCallList.forEach((item: any) => {
|
|
1871
|
-
// if (item.isConference) {
|
|
1872
|
-
// item.isHold = false;
|
|
1873
|
-
// } else {
|
|
1874
|
-
// item.isHold = true;
|
|
1875
|
-
// }
|
|
1876
|
-
// })
|
|
1877
|
-
this.isConferenceCallHold = false;
|
|
1878
|
-
}
|
|
1870
|
+
// this.currentCallList.forEach((item: any) => {
|
|
1871
|
+
// if (item.isConference) {
|
|
1872
|
+
// item.isHold = false;
|
|
1873
|
+
// } else {
|
|
1874
|
+
// item.isHold = true;
|
|
1875
|
+
// }
|
|
1876
|
+
// })
|
|
1877
|
+
this.isConferenceCallHold = false;
|
|
1879
1878
|
}
|
|
1880
1879
|
}
|
|
1881
|
-
else {
|
|
1882
|
-
this.currentCallList.splice(index, 1);
|
|
1883
|
-
}
|
|
1884
|
-
if (this.showContactsPanel) {
|
|
1885
|
-
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1886
|
-
this.applyFilter();
|
|
1887
|
-
}
|
|
1888
1880
|
}
|
|
1889
|
-
else
|
|
1890
|
-
this.currentCallList
|
|
1881
|
+
else {
|
|
1882
|
+
this.currentCallList.splice(index, 1);
|
|
1891
1883
|
}
|
|
1892
|
-
if (this.
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
this.onholdOrUnholdParticipant({
|
|
1896
|
-
participantId: [this.currentCallList[0].participantId],
|
|
1897
|
-
conferenceId: this.conferenceId,
|
|
1898
|
-
hold: false,
|
|
1899
|
-
conference: this.currentCallList[0].isConference
|
|
1900
|
-
});
|
|
1901
|
-
}
|
|
1902
|
-
}, 1000);
|
|
1884
|
+
if (this.showContactsPanel) {
|
|
1885
|
+
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1886
|
+
this.applyFilter();
|
|
1903
1887
|
}
|
|
1904
1888
|
}
|
|
1905
|
-
else {
|
|
1906
|
-
this.currentCallList
|
|
1907
|
-
this.timer = '00:00';
|
|
1908
|
-
this.startTimer();
|
|
1909
|
-
}
|
|
1910
|
-
}));
|
|
1911
|
-
let currentCall = this.currentCallList.find((item) => item.isAcceptCall && !item.isHold);
|
|
1912
|
-
if (currentCall === null || currentCall === void 0 ? void 0 : currentCall.id) {
|
|
1913
|
-
this.currentCall = currentCall;
|
|
1914
|
-
}
|
|
1915
|
-
if ((_h = this.selectedUserInfo) === null || _h === void 0 ? void 0 : _h.participantId) {
|
|
1916
|
-
let selectedUser = this.currentCallList.find((item) => item.id == this.selectedUserInfo.participantId);
|
|
1917
|
-
if (selectedUser) {
|
|
1918
|
-
selectedUser.IsUserInfoShow = true;
|
|
1919
|
-
this.selectedUserInfo = selectedUser;
|
|
1920
|
-
this.checkTextHeight();
|
|
1889
|
+
else if (index != -1) {
|
|
1890
|
+
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, 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()) });
|
|
1921
1891
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1892
|
+
if (this.currentCallList.length == 1 && this.currentCallList[0].isHold) {
|
|
1893
|
+
setTimeout(() => {
|
|
1894
|
+
if (this.currentCallList.length == 1 && this.currentCallList[0].isHold) {
|
|
1895
|
+
this.onholdOrUnholdParticipant({
|
|
1896
|
+
participantId: [this.currentCallList[0].participantId],
|
|
1897
|
+
conferenceId: this.conferenceId,
|
|
1898
|
+
hold: false,
|
|
1899
|
+
conference: this.currentCallList[0].isConference
|
|
1900
|
+
});
|
|
1928
1901
|
}
|
|
1929
|
-
}
|
|
1930
|
-
else {
|
|
1931
|
-
this.selectedUserInfo = {};
|
|
1932
|
-
this.isClickExpand = false;
|
|
1933
|
-
}
|
|
1902
|
+
}, 1000);
|
|
1934
1903
|
}
|
|
1935
1904
|
}
|
|
1936
1905
|
else {
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
this.currentCallList[resIndex].IsUserInfoShow = true;
|
|
1941
|
-
this.selectedUserInfo = this.currentCallList[resIndex];
|
|
1942
|
-
this.checkTextHeight();
|
|
1943
|
-
}
|
|
1906
|
+
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, 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()) }));
|
|
1907
|
+
this.timer = '00:00';
|
|
1908
|
+
this.startTimer();
|
|
1944
1909
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1910
|
+
}));
|
|
1911
|
+
let currentCall = this.currentCallList.find((item) => item.isAcceptCall && !item.isHold);
|
|
1912
|
+
if (currentCall === null || currentCall === void 0 ? void 0 : currentCall.id) {
|
|
1913
|
+
this.currentCall = currentCall;
|
|
1947
1914
|
}
|
|
1948
|
-
|
|
1949
|
-
this.
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1915
|
+
if ((_j = this.selectedUserInfo) === null || _j === void 0 ? void 0 : _j.participantId) {
|
|
1916
|
+
let selectedUser = this.currentCallList.find((item) => item.id == this.selectedUserInfo.participantId);
|
|
1917
|
+
if (selectedUser) {
|
|
1918
|
+
selectedUser.IsUserInfoShow = true;
|
|
1919
|
+
this.selectedUserInfo = selectedUser;
|
|
1920
|
+
this.checkTextHeight();
|
|
1921
|
+
}
|
|
1922
|
+
else {
|
|
1923
|
+
let incomingCall = this.currentCallList.find((item) => item === null || item === void 0 ? void 0 : item.businessNumber);
|
|
1924
|
+
if (incomingCall === null || incomingCall === void 0 ? void 0 : incomingCall.participantId) {
|
|
1925
|
+
this.selectedUserInfo = incomingCall;
|
|
1926
|
+
if (this.isClickExpand) {
|
|
1927
|
+
this.checkTextHeight();
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
else {
|
|
1931
|
+
this.selectedUserInfo = {};
|
|
1932
|
+
this.isClickExpand = false;
|
|
1933
|
+
}
|
|
1959
1934
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1935
|
+
}
|
|
1936
|
+
else {
|
|
1937
|
+
let resIndex = this.currentCallList.findIndex((item) => !!(item === null || item === void 0 ? void 0 : item.businessNumber));
|
|
1938
|
+
if (resIndex > -1) {
|
|
1939
|
+
this.isClickExpand = true;
|
|
1940
|
+
this.currentCallList[resIndex].IsUserInfoShow = true;
|
|
1941
|
+
this.selectedUserInfo = this.currentCallList[resIndex];
|
|
1942
|
+
this.checkTextHeight();
|
|
1962
1943
|
}
|
|
1963
1944
|
}
|
|
1945
|
+
this.cdr.detectChanges();
|
|
1946
|
+
console.log('currentCallList', this.currentCallList);
|
|
1964
1947
|
}
|
|
1965
|
-
|
|
1966
|
-
|
|
1948
|
+
else if (!((_k = this.newIncomingCallsList) === null || _k === void 0 ? void 0 : _k.length)) {
|
|
1949
|
+
this.isConcurrentIncoming = false;
|
|
1950
|
+
this.incomingCallDiv = false;
|
|
1951
|
+
this.cdr.detectChanges();
|
|
1952
|
+
this.currentCallList = [];
|
|
1953
|
+
this.currentCall = {};
|
|
1954
|
+
this.isCallInProgress = false;
|
|
1955
|
+
this.isConferenceCallHold = false;
|
|
1956
|
+
this.stopTimer();
|
|
1967
1957
|
}
|
|
1958
|
+
// } catch (e) {
|
|
1959
|
+
// console.log(e);
|
|
1960
|
+
// }
|
|
1968
1961
|
}
|
|
1969
1962
|
}
|
|
1970
1963
|
getStatus(res) {
|
|
@@ -2338,13 +2331,13 @@ class CallProgressComponent {
|
|
|
2338
2331
|
toggleMute(isConference) {
|
|
2339
2332
|
var _a;
|
|
2340
2333
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
})
|
|
2334
|
+
// await this.onMuteParticipant({
|
|
2335
|
+
// participantId: [this.currentCall?.participantId],
|
|
2336
|
+
// conferenceId: this.conferenceId,
|
|
2337
|
+
// mute: !this.isMute,
|
|
2338
|
+
// })
|
|
2346
2339
|
this.isMute = !this.isMute;
|
|
2347
|
-
|
|
2340
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.mute(this.isMute);
|
|
2348
2341
|
// if (isConference) {
|
|
2349
2342
|
this.currentCall.isMute = this.isMute;
|
|
2350
2343
|
});
|