@vgroup/dialbox 0.4.156 → 0.4.159
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 +166 -169
- package/esm2020/lib/dialbox.component.mjs +8 -5
- package/fesm2015/vgroup-dialbox.mjs +163 -160
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +172 -172
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1787,11 +1787,11 @@ class CallProgressComponent {
|
|
|
1787
1787
|
this.isConcurrentIncoming = true;
|
|
1788
1788
|
this.incomingCallDiv = true;
|
|
1789
1789
|
// Add to list if not present
|
|
1790
|
-
const exists = (this.newIncomingCallsList || []).some((c) =>
|
|
1791
|
-
if (!exists) {
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
}
|
|
1790
|
+
// const exists = (this.newIncomingCallsList || []).some((c: any) => c?.parameters?.CallSid === incoming?.parameters?.CallSid);
|
|
1791
|
+
// if (!exists) {
|
|
1792
|
+
// this.newIncomingCallsList = [...(this.newIncomingCallsList || []), incoming];
|
|
1793
|
+
// this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
1794
|
+
// }
|
|
1795
1795
|
this.cdr.detectChanges();
|
|
1796
1796
|
// }
|
|
1797
1797
|
});
|
|
@@ -1802,7 +1802,7 @@ class CallProgressComponent {
|
|
|
1802
1802
|
this.GetContactsList();
|
|
1803
1803
|
}
|
|
1804
1804
|
ngOnChanges(changes) {
|
|
1805
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
1805
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1806
1806
|
if (this.userId) {
|
|
1807
1807
|
this.extensionService.userId = this.userId;
|
|
1808
1808
|
}
|
|
@@ -1822,108 +1822,111 @@ class CallProgressComponent {
|
|
|
1822
1822
|
// try {
|
|
1823
1823
|
if ((_h = this.newIncomingCallsList) === null || _h === void 0 ? void 0 : _h.length) {
|
|
1824
1824
|
// Check if there's an active ongoing call
|
|
1825
|
-
this.
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
if (
|
|
1831
|
-
this.currentCallList.
|
|
1832
|
-
if (
|
|
1833
|
-
this.
|
|
1834
|
-
this.
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
else if (index != -1 && res.isLeft) {
|
|
1838
|
-
if (((_l = this.currentCallList[index]) === null || _l === void 0 ? void 0 : _l.id) == ((_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.id)) {
|
|
1839
|
-
this.currentCallList.splice(index, 1);
|
|
1840
|
-
this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
|
|
1841
|
-
if (((_o = this.currentCall) === null || _o === void 0 ? void 0 : _o.isHold) && !((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.isConference)) {
|
|
1842
|
-
yield this.onholdOrUnholdParticipant({
|
|
1843
|
-
participantId: [(_q = this.currentCall) === null || _q === void 0 ? void 0 : _q.participantId],
|
|
1844
|
-
conferenceId: this.conferenceId,
|
|
1845
|
-
hold: false,
|
|
1846
|
-
conference: (_r = this.currentCall) === null || _r === void 0 ? void 0 : _r.isConference
|
|
1847
|
-
});
|
|
1848
|
-
// this.currentCallList[0].isHold = false;
|
|
1825
|
+
this.newIncomingCallsList.forEach((callInfo, i) => {
|
|
1826
|
+
var _a;
|
|
1827
|
+
this.conferenceId = i == 0 ? this.newIncomingCallsList[i].conferenceId : this.conferenceId;
|
|
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;
|
|
1830
|
+
if (this.currentCallList.length > 0) {
|
|
1831
|
+
let index = this.currentCallList.findIndex((item) => item.id == res.id);
|
|
1832
|
+
if (index == -1 && !res.isLeft) {
|
|
1833
|
+
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()) }));
|
|
1834
|
+
if (this.showContactsPanel) {
|
|
1835
|
+
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1836
|
+
this.applyFilter();
|
|
1849
1837
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1838
|
+
}
|
|
1839
|
+
else if (index != -1 && res.isLeft) {
|
|
1840
|
+
if (((_b = this.currentCallList[index]) === null || _b === void 0 ? void 0 : _b.id) == ((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
1841
|
+
this.currentCallList.splice(index, 1);
|
|
1842
|
+
this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
|
|
1843
|
+
if (((_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.isHold) && !((_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.isConference)) {
|
|
1853
1844
|
yield this.onholdOrUnholdParticipant({
|
|
1854
|
-
participantId:
|
|
1855
|
-
conferenceId: this.conferenceId,
|
|
1845
|
+
participantId: [(_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.participantId],
|
|
1846
|
+
conferenceId: (_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.conferenceId,
|
|
1856
1847
|
hold: false,
|
|
1857
|
-
conference: (
|
|
1848
|
+
conference: (_h = this.currentCall) === null || _h === void 0 ? void 0 : _h.isConference
|
|
1858
1849
|
});
|
|
1859
|
-
this.
|
|
1850
|
+
// this.currentCallList[0].isHold = false;
|
|
1851
|
+
}
|
|
1852
|
+
else if (((_j = this.currentCall) === null || _j === void 0 ? void 0 : _j.isHold) && ((_k = this.currentCall) === null || _k === void 0 ? void 0 : _k.isConference)) {
|
|
1853
|
+
let conferenceCalllist = this.currentCallList.filter((item) => item.isConference);
|
|
1854
|
+
if (conferenceCalllist.length > 0) {
|
|
1855
|
+
yield this.onholdOrUnholdParticipant({
|
|
1856
|
+
participantId: conferenceCalllist.map((item) => item.participantId),
|
|
1857
|
+
conferenceId: (_l = conferenceCalllist[0]) === null || _l === void 0 ? void 0 : _l.conferenceId,
|
|
1858
|
+
hold: false,
|
|
1859
|
+
conference: (_m = this.currentCall) === null || _m === void 0 ? void 0 : _m.isConference
|
|
1860
|
+
});
|
|
1861
|
+
this.isConferenceCallHold = false;
|
|
1862
|
+
}
|
|
1860
1863
|
}
|
|
1861
1864
|
}
|
|
1865
|
+
else {
|
|
1866
|
+
this.currentCallList.splice(index, 1);
|
|
1867
|
+
}
|
|
1868
|
+
if (this.showContactsPanel) {
|
|
1869
|
+
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1870
|
+
this.applyFilter();
|
|
1871
|
+
}
|
|
1862
1872
|
}
|
|
1863
|
-
else {
|
|
1864
|
-
this.currentCallList.
|
|
1865
|
-
}
|
|
1866
|
-
if (this.showContactsPanel) {
|
|
1867
|
-
this.getAllParticipants(this.twilioService.conferenceCallInfo.conferenceSid);
|
|
1868
|
-
this.applyFilter();
|
|
1873
|
+
else if (index != -1) {
|
|
1874
|
+
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()) });
|
|
1869
1875
|
}
|
|
1870
1876
|
}
|
|
1871
|
-
else if (
|
|
1872
|
-
this.currentCallList
|
|
1877
|
+
else if (!res.isLeft) {
|
|
1878
|
+
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()) }));
|
|
1879
|
+
this.timer = '00:00';
|
|
1880
|
+
this.startTimer();
|
|
1873
1881
|
}
|
|
1882
|
+
}));
|
|
1883
|
+
let currentCall = this.currentCallList.find((item) => item.isAcceptCall && !item.isHold);
|
|
1884
|
+
if (currentCall === null || currentCall === void 0 ? void 0 : currentCall.id) {
|
|
1885
|
+
this.currentCall = currentCall;
|
|
1874
1886
|
}
|
|
1875
|
-
|
|
1876
|
-
this.currentCallList.
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
let currentCall = this.currentCallList.find((item) => item.isAcceptCall && !item.isHold);
|
|
1882
|
-
if (currentCall === null || currentCall === void 0 ? void 0 : currentCall.id) {
|
|
1883
|
-
this.currentCall = currentCall;
|
|
1884
|
-
}
|
|
1885
|
-
if ((_j = this.selectedUserInfo) === null || _j === void 0 ? void 0 : _j.participantId) {
|
|
1886
|
-
let selectedUser = this.currentCallList.find((item) => item.id == this.selectedUserInfo.participantId);
|
|
1887
|
-
if (selectedUser) {
|
|
1888
|
-
selectedUser.IsUserInfoShow = true;
|
|
1889
|
-
this.selectedUserInfo = selectedUser;
|
|
1890
|
-
this.checkTextHeight();
|
|
1891
|
-
}
|
|
1892
|
-
else {
|
|
1893
|
-
let incomingCall = this.currentCallList.find((item) => item === null || item === void 0 ? void 0 : item.businessNumber);
|
|
1894
|
-
if (incomingCall === null || incomingCall === void 0 ? void 0 : incomingCall.participantId) {
|
|
1895
|
-
this.selectedUserInfo = incomingCall;
|
|
1896
|
-
if (this.isClickExpand) {
|
|
1897
|
-
this.checkTextHeight();
|
|
1898
|
-
}
|
|
1887
|
+
if ((_a = this.selectedUserInfo) === null || _a === void 0 ? void 0 : _a.participantId) {
|
|
1888
|
+
let selectedUser = this.currentCallList.find((item) => item.id == this.selectedUserInfo.participantId);
|
|
1889
|
+
if (selectedUser) {
|
|
1890
|
+
selectedUser.IsUserInfoShow = true;
|
|
1891
|
+
this.selectedUserInfo = selectedUser;
|
|
1892
|
+
this.checkTextHeight();
|
|
1899
1893
|
}
|
|
1900
1894
|
else {
|
|
1901
|
-
this.
|
|
1902
|
-
|
|
1895
|
+
let incomingCall = this.currentCallList.find((item) => item === null || item === void 0 ? void 0 : item.businessNumber);
|
|
1896
|
+
if (incomingCall === null || incomingCall === void 0 ? void 0 : incomingCall.participantId) {
|
|
1897
|
+
this.selectedUserInfo = incomingCall;
|
|
1898
|
+
if (this.isClickExpand) {
|
|
1899
|
+
this.checkTextHeight();
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
else {
|
|
1903
|
+
this.selectedUserInfo = {};
|
|
1904
|
+
this.isClickExpand = false;
|
|
1905
|
+
}
|
|
1903
1906
|
}
|
|
1904
1907
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1908
|
+
else {
|
|
1909
|
+
let resIndex = this.currentCallList.findIndex((item) => !!(item === null || item === void 0 ? void 0 : item.businessNumber));
|
|
1910
|
+
if (resIndex > -1) {
|
|
1911
|
+
this.isClickExpand = true;
|
|
1912
|
+
this.currentCallList[resIndex].IsUserInfoShow = true;
|
|
1913
|
+
this.selectedUserInfo = this.currentCallList[resIndex];
|
|
1914
|
+
this.checkTextHeight();
|
|
1915
|
+
}
|
|
1913
1916
|
}
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1917
|
+
this.cdr.detectChanges();
|
|
1918
|
+
let incomingData = this.currentCallList.find((res) => res.isIncomingCall && !res.isAcceptCall);
|
|
1919
|
+
if ((incomingData === null || incomingData === void 0 ? void 0 : incomingData.id) && !this.isRinging) {
|
|
1920
|
+
this.isRinging = this.incomeingCallSocketService.play();
|
|
1921
|
+
}
|
|
1922
|
+
else if (!(incomingData === null || incomingData === void 0 ? void 0 : incomingData.id) && this.isRinging) {
|
|
1923
|
+
this.isRinging = this.incomeingCallSocketService.pause();
|
|
1924
|
+
}
|
|
1925
|
+
console.log(this.isRinging, incomingData);
|
|
1926
|
+
console.log('currentCallList', this.currentCallList);
|
|
1927
|
+
});
|
|
1925
1928
|
}
|
|
1926
|
-
else if (!((
|
|
1929
|
+
else if (!((_j = this.newIncomingCallsList) === null || _j === void 0 ? void 0 : _j.length)) {
|
|
1927
1930
|
console.log('test null');
|
|
1928
1931
|
if (this.isRinging) {
|
|
1929
1932
|
this.incomeingCallSocketService.pause();
|
|
@@ -1943,9 +1946,6 @@ class CallProgressComponent {
|
|
|
1943
1946
|
this.stopTimer();
|
|
1944
1947
|
this.endCallEvent.emit();
|
|
1945
1948
|
}
|
|
1946
|
-
// } catch (e) {
|
|
1947
|
-
// console.log(e);
|
|
1948
|
-
// }
|
|
1949
1949
|
}
|
|
1950
1950
|
// if(changes['conferenceCallInfo']?.currentValue && this.conferenceCallInfo && changes['conferenceCallInfo']?.previousValue?.conferenceSid != changes['conferenceCallInfo']?.currentValue?.conferenceSid) {
|
|
1951
1951
|
// this.isConference = true
|
|
@@ -2086,18 +2086,18 @@ class CallProgressComponent {
|
|
|
2086
2086
|
yield this.connectToDevice(tokenData.token, callData);
|
|
2087
2087
|
yield this.pollCallStatus(callAuthId);
|
|
2088
2088
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
2089
|
-
var _b;
|
|
2089
|
+
var _b, _c;
|
|
2090
2090
|
try {
|
|
2091
2091
|
this.addRes = yield this.addParticipantToCall({
|
|
2092
2092
|
from: callData === null || callData === void 0 ? void 0 : callData.from,
|
|
2093
2093
|
route: "OUTGOING",
|
|
2094
2094
|
participantNumber: callData === null || callData === void 0 ? void 0 : callData.phone,
|
|
2095
|
-
conferenceId: this.conferenceId,
|
|
2095
|
+
conferenceId: this.conferenceId || ((_b = response === null || response === void 0 ? void 0 : response.callauth) === null || _b === void 0 ? void 0 : _b.id),
|
|
2096
2096
|
userId: this.userId || localStorage.getItem('userId'),
|
|
2097
2097
|
proxy: '',
|
|
2098
2098
|
countrycode: '',
|
|
2099
2099
|
});
|
|
2100
|
-
console.log('Initial participantId:', (
|
|
2100
|
+
console.log('Initial participantId:', (_c = this.addRes) === null || _c === void 0 ? void 0 : _c.participantId);
|
|
2101
2101
|
}
|
|
2102
2102
|
catch (e) {
|
|
2103
2103
|
console.error('Error adding initial participant:', e);
|
|
@@ -2124,7 +2124,7 @@ class CallProgressComponent {
|
|
|
2124
2124
|
console.log(c, 'dsdsdsdsdsdsadsa');
|
|
2125
2125
|
this.onholdOrUnholdParticipant({
|
|
2126
2126
|
participantId: [c.participantId],
|
|
2127
|
-
conferenceId:
|
|
2127
|
+
conferenceId: c === null || c === void 0 ? void 0 : c.conferenceId,
|
|
2128
2128
|
hold: !c.hold,
|
|
2129
2129
|
conference: c.isConference
|
|
2130
2130
|
});
|
|
@@ -2135,7 +2135,7 @@ class CallProgressComponent {
|
|
|
2135
2135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2136
2136
|
console.log(c, 'dsdsdsdsdsdsadsa');
|
|
2137
2137
|
let participantId = isAllCallEnd ? 'all' : c.participantId || c.participantId;
|
|
2138
|
-
let res = yield this.getRemoveParticipants(participantId,
|
|
2138
|
+
let res = yield this.getRemoveParticipants(participantId, c === null || c === void 0 ? void 0 : c.conferenceId);
|
|
2139
2139
|
if ((res === null || res === void 0 ? void 0 : res.status) == 201 && (res === null || res === void 0 ? void 0 : res.message) == 'participant already left') {
|
|
2140
2140
|
// this.currentCallList = this.currentCallList.filter((item: any) => item.participantId !== c.participantId);
|
|
2141
2141
|
// this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : null;
|
|
@@ -2335,7 +2335,7 @@ class CallProgressComponent {
|
|
|
2335
2335
|
// }
|
|
2336
2336
|
// }
|
|
2337
2337
|
endCall(isAllCallEnd) {
|
|
2338
|
-
var _a, _b;
|
|
2338
|
+
var _a, _b, _c;
|
|
2339
2339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2340
2340
|
console.log('endCall() called');
|
|
2341
2341
|
// console.log('Current call:', this.call?.parameters['From']);
|
|
@@ -2357,9 +2357,9 @@ class CallProgressComponent {
|
|
|
2357
2357
|
// this.currentCall = this.currentCallList[0];
|
|
2358
2358
|
yield this.onholdOrUnholdParticipant({
|
|
2359
2359
|
participantId: [(_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.participantId],
|
|
2360
|
-
conferenceId: this.conferenceId,
|
|
2360
|
+
conferenceId: (_b = this.currentCall) === null || _b === void 0 ? void 0 : _b.conferenceId,
|
|
2361
2361
|
hold: false,
|
|
2362
|
-
isConference: (
|
|
2362
|
+
isConference: (_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.isConference
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
|
2365
2365
|
else {
|
|
@@ -2444,7 +2444,7 @@ class CallProgressComponent {
|
|
|
2444
2444
|
// res.isHold = true;
|
|
2445
2445
|
this.onholdOrUnholdParticipant({
|
|
2446
2446
|
participantId: [res.participantId],
|
|
2447
|
-
conferenceId:
|
|
2447
|
+
conferenceId: res === null || res === void 0 ? void 0 : res.conferenceId,
|
|
2448
2448
|
hold: true,
|
|
2449
2449
|
conference: res.isConference
|
|
2450
2450
|
});
|
|
@@ -2459,7 +2459,7 @@ class CallProgressComponent {
|
|
|
2459
2459
|
// }
|
|
2460
2460
|
yield this.onholdOrUnholdParticipant({
|
|
2461
2461
|
participantId: ((_c = this.currentCall) === null || _c === void 0 ? void 0 : _c.isIncomingCall) ? [(_d = this.currentCall) === null || _d === void 0 ? void 0 : _d.id] : [(_e = this.currentCall) === null || _e === void 0 ? void 0 : _e.participantId],
|
|
2462
|
-
conferenceId:
|
|
2462
|
+
conferenceId: data === null || data === void 0 ? void 0 : data.conferenceId,
|
|
2463
2463
|
hold: true,
|
|
2464
2464
|
conference: (_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.isConference
|
|
2465
2465
|
});
|
|
@@ -2486,7 +2486,7 @@ class CallProgressComponent {
|
|
|
2486
2486
|
ipCountry: '',
|
|
2487
2487
|
callStatus: 'answered',
|
|
2488
2488
|
deviceId: this.deviceId,
|
|
2489
|
-
conferenceId: this.conferenceId || data.conferenceId || 'no'
|
|
2489
|
+
conferenceId: this.conferenceId || (data === null || data === void 0 ? void 0 : data.conferenceId) || 'no'
|
|
2490
2490
|
};
|
|
2491
2491
|
this.extensionService.setIncomingCallStatus(payload).subscribe((res) => __awaiter(this, void 0, void 0, function* () {
|
|
2492
2492
|
this.call = yield this.twilioService.connect(res.conferenceId);
|
|
@@ -2499,7 +2499,7 @@ class CallProgressComponent {
|
|
|
2499
2499
|
});
|
|
2500
2500
|
}
|
|
2501
2501
|
callContact(contact) {
|
|
2502
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2502
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2503
2503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2504
2504
|
console.log('Adding participant:', contact);
|
|
2505
2505
|
console.log('this.call', this.call);
|
|
@@ -2522,14 +2522,14 @@ class CallProgressComponent {
|
|
|
2522
2522
|
from: ((_c = this.callData) === null || _c === void 0 ? void 0 : _c.from) ? (_d = this.callData) === null || _d === void 0 ? void 0 : _d.from : (_e = this.selectedCallerId) === null || _e === void 0 ? void 0 : _e.number,
|
|
2523
2523
|
route: "OUTGOING",
|
|
2524
2524
|
participantNumber: phoneNumber,
|
|
2525
|
-
conferenceId: this.conferenceId,
|
|
2525
|
+
conferenceId: (_f = this.currentCall) === null || _f === void 0 ? void 0 : _f.conferenceId,
|
|
2526
2526
|
userId: this.userId,
|
|
2527
2527
|
proxy: '',
|
|
2528
2528
|
countrycode: '',
|
|
2529
2529
|
});
|
|
2530
2530
|
this.onholdOrUnholdParticipant({
|
|
2531
2531
|
participantId: [data === null || data === void 0 ? void 0 : data.participantId],
|
|
2532
|
-
conferenceId: this.conferenceId,
|
|
2532
|
+
conferenceId: (_g = this.currentCall) === null || _g === void 0 ? void 0 : _g.conferenceId,
|
|
2533
2533
|
hold: false,
|
|
2534
2534
|
conference: true
|
|
2535
2535
|
});
|
|
@@ -2540,7 +2540,7 @@ class CallProgressComponent {
|
|
|
2540
2540
|
name: (contact === null || contact === void 0 ? void 0 : contact.name) || `${contact === null || contact === void 0 ? void 0 : contact.firstName} ${contact === null || contact === void 0 ? void 0 : contact.lastName}` || phoneNumber,
|
|
2541
2541
|
img: (contact === null || contact === void 0 ? void 0 : contact.img) || 'assets/images/user.jpg',
|
|
2542
2542
|
participantId: data === null || data === void 0 ? void 0 : data.participantId,
|
|
2543
|
-
from: (
|
|
2543
|
+
from: (_h = this.selectedCallerId) === null || _h === void 0 ? void 0 : _h.number,
|
|
2544
2544
|
isIncomingCall: false,
|
|
2545
2545
|
isHold: false,
|
|
2546
2546
|
isLeft: false,
|
|
@@ -2561,7 +2561,7 @@ class CallProgressComponent {
|
|
|
2561
2561
|
// c.isHold = true;
|
|
2562
2562
|
yield this.onholdOrUnholdParticipant({
|
|
2563
2563
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2564
|
-
conferenceId:
|
|
2564
|
+
conferenceId: c.conferenceId,
|
|
2565
2565
|
hold: true,
|
|
2566
2566
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2567
2567
|
});
|
|
@@ -2583,18 +2583,18 @@ class CallProgressComponent {
|
|
|
2583
2583
|
// this.call['callInfo'] = JSON.parse(JSON.stringify(this.callData));
|
|
2584
2584
|
// Get the conference ID from the current call or use the stored one
|
|
2585
2585
|
// const conferenceId = this.conferenceId;
|
|
2586
|
-
if (!this.conferenceId) {
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
}
|
|
2586
|
+
// if (!this.conferenceId) {
|
|
2587
|
+
// console.error("No conferenceId found for active call");
|
|
2588
|
+
// swal("Error", "Cannot add participant: conference not found", "error");
|
|
2589
|
+
// this.showRingAnimation = false;
|
|
2590
|
+
// return;
|
|
2591
|
+
// }
|
|
2592
2592
|
// Add participant to the conference
|
|
2593
2593
|
let data = yield this.addParticipantToCall({
|
|
2594
|
-
from: ((
|
|
2594
|
+
from: ((_j = this.callData) === null || _j === void 0 ? void 0 : _j.from) || ((_k = this.selectedCallerId) === null || _k === void 0 ? void 0 : _k.number),
|
|
2595
2595
|
route: "OUTGOING",
|
|
2596
2596
|
participantNumber: phoneNumber,
|
|
2597
|
-
conferenceId: this.conferenceId,
|
|
2597
|
+
conferenceId: (_l = this.currentCall) === null || _l === void 0 ? void 0 : _l.conferenceId,
|
|
2598
2598
|
userId: this.userId,
|
|
2599
2599
|
proxy: '',
|
|
2600
2600
|
countrycode: '',
|
|
@@ -2610,7 +2610,7 @@ class CallProgressComponent {
|
|
|
2610
2610
|
name: (contact === null || contact === void 0 ? void 0 : contact.name) || `${contact === null || contact === void 0 ? void 0 : contact.firstName} ${contact === null || contact === void 0 ? void 0 : contact.lastName}` || phoneNumber,
|
|
2611
2611
|
img: (contact === null || contact === void 0 ? void 0 : contact.img) || 'assets/images/user.jpg',
|
|
2612
2612
|
participantId: data === null || data === void 0 ? void 0 : data.participantId,
|
|
2613
|
-
from: (
|
|
2613
|
+
from: (_m = this.selectedCallerId) === null || _m === void 0 ? void 0 : _m.number,
|
|
2614
2614
|
isIncomingCall: false,
|
|
2615
2615
|
isHold: false,
|
|
2616
2616
|
isLeft: false,
|
|
@@ -2718,7 +2718,7 @@ class CallProgressComponent {
|
|
|
2718
2718
|
// c.isHold = true;
|
|
2719
2719
|
yield this.onholdOrUnholdParticipant({
|
|
2720
2720
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2721
|
-
conferenceId:
|
|
2721
|
+
conferenceId: c.conferenceId,
|
|
2722
2722
|
hold: true,
|
|
2723
2723
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2724
2724
|
});
|
|
@@ -2727,7 +2727,7 @@ class CallProgressComponent {
|
|
|
2727
2727
|
// c.isHold = false;
|
|
2728
2728
|
yield this.onholdOrUnholdParticipant({
|
|
2729
2729
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2730
|
-
conferenceId:
|
|
2730
|
+
conferenceId: c.conferenceId,
|
|
2731
2731
|
hold: false,
|
|
2732
2732
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2733
2733
|
});
|
|
@@ -2743,7 +2743,7 @@ class CallProgressComponent {
|
|
|
2743
2743
|
// c.isHold = false;
|
|
2744
2744
|
yield this.onholdOrUnholdParticipant({
|
|
2745
2745
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2746
|
-
conferenceId:
|
|
2746
|
+
conferenceId: c.conferenceId,
|
|
2747
2747
|
hold: false,
|
|
2748
2748
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2749
2749
|
});
|
|
@@ -2752,7 +2752,7 @@ class CallProgressComponent {
|
|
|
2752
2752
|
// c.isHold = true;
|
|
2753
2753
|
yield this.onholdOrUnholdParticipant({
|
|
2754
2754
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2755
|
-
conferenceId:
|
|
2755
|
+
conferenceId: c.conferenceId,
|
|
2756
2756
|
hold: true,
|
|
2757
2757
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2758
2758
|
});
|
|
@@ -2766,7 +2766,7 @@ class CallProgressComponent {
|
|
|
2766
2766
|
// c.isHold = true;
|
|
2767
2767
|
yield this.onholdOrUnholdParticipant({
|
|
2768
2768
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2769
|
-
conferenceId:
|
|
2769
|
+
conferenceId: c.conferenceId,
|
|
2770
2770
|
hold: true,
|
|
2771
2771
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2772
2772
|
});
|
|
@@ -2775,7 +2775,7 @@ class CallProgressComponent {
|
|
|
2775
2775
|
// c.isHold = false;
|
|
2776
2776
|
yield this.onholdOrUnholdParticipant({
|
|
2777
2777
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2778
|
-
conferenceId:
|
|
2778
|
+
conferenceId: c.conferenceId,
|
|
2779
2779
|
hold: false,
|
|
2780
2780
|
conference: c === null || c === void 0 ? void 0 : c.isConference
|
|
2781
2781
|
});
|
|
@@ -2831,7 +2831,7 @@ class CallProgressComponent {
|
|
|
2831
2831
|
// c.isHold = false;
|
|
2832
2832
|
yield this.onholdOrUnholdParticipant({
|
|
2833
2833
|
participantId: [c === null || c === void 0 ? void 0 : c.participantId],
|
|
2834
|
-
conferenceId:
|
|
2834
|
+
conferenceId: c.conferenceId,
|
|
2835
2835
|
hold: false,
|
|
2836
2836
|
conference: true
|
|
2837
2837
|
});
|
|
@@ -2919,24 +2919,22 @@ class CallProgressComponent {
|
|
|
2919
2919
|
// console.error('Error starting recording', error);
|
|
2920
2920
|
// });
|
|
2921
2921
|
// }
|
|
2922
|
-
rejectConcurrentCall(incomingCall) {
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
this.cdr.detectChanges();
|
|
2939
|
-
}
|
|
2922
|
+
// rejectConcurrentCall(incomingCall: any) {
|
|
2923
|
+
// if (!incomingCall) return;
|
|
2924
|
+
// if (incomingCall.reject) {
|
|
2925
|
+
// incomingCall.reject();
|
|
2926
|
+
// }
|
|
2927
|
+
// if (incomingCall.disconnect) incomingCall.disconnect();
|
|
2928
|
+
// // Remove from list
|
|
2929
|
+
// this.newIncomingCallsList = (this.newIncomingCallsList || []).filter((c: any) => c?.parameters?.CallSid !== incomingCall?.parameters?.CallSid);
|
|
2930
|
+
// this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
2931
|
+
// // If no more incoming, hide banner
|
|
2932
|
+
// if (!this.newIncomingCallsList || this.newIncomingCallsList.length === 0) {
|
|
2933
|
+
// this.isConcurrentIncoming = false;
|
|
2934
|
+
// this.incomingCallDiv = false;
|
|
2935
|
+
// }
|
|
2936
|
+
// this.cdr.detectChanges();
|
|
2937
|
+
// }
|
|
2940
2938
|
onCallInputs(num) {
|
|
2941
2939
|
var _a;
|
|
2942
2940
|
try {
|
|
@@ -3020,7 +3018,7 @@ class CallProgressComponent {
|
|
|
3020
3018
|
}
|
|
3021
3019
|
}
|
|
3022
3020
|
startRecording() {
|
|
3023
|
-
var _a;
|
|
3021
|
+
var _a, _b;
|
|
3024
3022
|
let sid;
|
|
3025
3023
|
const details = this.extensionService.getCallSid();
|
|
3026
3024
|
this.incomingCallSid = details.callSid;
|
|
@@ -3030,7 +3028,7 @@ class CallProgressComponent {
|
|
|
3030
3028
|
// return;
|
|
3031
3029
|
// }
|
|
3032
3030
|
let payload = {
|
|
3033
|
-
"conferenceId": this.conferenceId,
|
|
3031
|
+
"conferenceId": (_b = this.currentCall) === null || _b === void 0 ? void 0 : _b.conferenceId,
|
|
3034
3032
|
};
|
|
3035
3033
|
this.extensionService.getCallRecording(payload).subscribe(response => {
|
|
3036
3034
|
this.isRecording = true;
|
|
@@ -3052,7 +3050,8 @@ class CallProgressComponent {
|
|
|
3052
3050
|
}
|
|
3053
3051
|
}
|
|
3054
3052
|
pauseRecording() {
|
|
3055
|
-
|
|
3053
|
+
var _a;
|
|
3054
|
+
this.extensionService.pauseOrResumeRecording((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId, 'pause').subscribe(response => {
|
|
3056
3055
|
this.stopRecordingTimer();
|
|
3057
3056
|
this.isPaused = true;
|
|
3058
3057
|
}, (error) => {
|
|
@@ -3061,10 +3060,11 @@ class CallProgressComponent {
|
|
|
3061
3060
|
});
|
|
3062
3061
|
}
|
|
3063
3062
|
resumeRecording() {
|
|
3063
|
+
var _a;
|
|
3064
3064
|
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
3065
3065
|
// return; // Skip if recording is not enabled
|
|
3066
3066
|
// }
|
|
3067
|
-
this.extensionService.pauseOrResumeRecording(this.conferenceId, 'resume').subscribe(response => {
|
|
3067
|
+
this.extensionService.pauseOrResumeRecording((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId, 'resume').subscribe(response => {
|
|
3068
3068
|
this.isPaused = false;
|
|
3069
3069
|
this.startTimer1();
|
|
3070
3070
|
}, error => {
|
|
@@ -3145,11 +3145,11 @@ class CallProgressComponent {
|
|
|
3145
3145
|
console.error('Error starting recording', error);
|
|
3146
3146
|
});
|
|
3147
3147
|
}
|
|
3148
|
-
incomingCallsNewList(data) {
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
}
|
|
3148
|
+
// incomingCallsNewList(data: any) {
|
|
3149
|
+
// console.log(data, 'newIncomingCallsListOUR')
|
|
3150
|
+
// this.newIncomingCallsList = data;
|
|
3151
|
+
// this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
3152
|
+
// }
|
|
3153
3153
|
selectedIncomingCallInfo(data) {
|
|
3154
3154
|
this.selectedIncomingCall = data;
|
|
3155
3155
|
}
|
|
@@ -3184,13 +3184,14 @@ class CallProgressComponent {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
3186
|
setIncomingCallStatus(data) {
|
|
3187
|
+
var _a;
|
|
3187
3188
|
let payload = {
|
|
3188
3189
|
recordId: data === null || data === void 0 ? void 0 : data.id,
|
|
3189
3190
|
ipAddress: '',
|
|
3190
3191
|
ipCountry: '',
|
|
3191
3192
|
callStatus: 'answered',
|
|
3192
3193
|
deviceId: this.deviceId,
|
|
3193
|
-
conferenceId: this.conferenceId || data.conferenceId || 'no'
|
|
3194
|
+
conferenceId: ((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId) || data.conferenceId || 'no'
|
|
3194
3195
|
};
|
|
3195
3196
|
this.extensionService.setIncomingCallStatus(payload).subscribe((res) => {
|
|
3196
3197
|
console.log(res);
|
|
@@ -3308,6 +3309,7 @@ class DialboxComponent {
|
|
|
3308
3309
|
this._isDialpadHidden = true;
|
|
3309
3310
|
// Let the library decide to auto-open on incoming call without host wiring
|
|
3310
3311
|
this.autoOpenOnIncoming = true;
|
|
3312
|
+
this.isIncomingCallnotification = false;
|
|
3311
3313
|
this.conferenceCallInfo = {
|
|
3312
3314
|
"createdAt": "Tue Dec 30 07:53:51 UTC 2025",
|
|
3313
3315
|
"conferenceName": "conf_6953850f1522800c4f3cc715",
|
|
@@ -3547,14 +3549,13 @@ class DialboxComponent {
|
|
|
3547
3549
|
this.incomeingCallSocketService.connect(this.deviceId);
|
|
3548
3550
|
try {
|
|
3549
3551
|
this.incomeingCallSocketService.listen().subscribe((incomingCallData) => __awaiter(this, void 0, void 0, function* () {
|
|
3550
|
-
var _a, _b;
|
|
3551
3552
|
// const data = JSON.parse(incomingCallData.data);
|
|
3552
3553
|
// console.log("WS Event Received:", incomingCallData);
|
|
3553
3554
|
// console.log("WS Event Received:", incomingCallData.data);
|
|
3554
3555
|
this.twilioService.conferenceCallInfo = incomingCallData;
|
|
3555
|
-
if (!!(
|
|
3556
|
+
if (!!(incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length)) {
|
|
3556
3557
|
// this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
|
|
3557
|
-
this.incomingCallsList = incomingCallData
|
|
3558
|
+
this.incomingCallsList = incomingCallData || [];
|
|
3558
3559
|
this.isCallInProgress = true;
|
|
3559
3560
|
this.isDialpadHidden = false;
|
|
3560
3561
|
this.isIncomingCallnotification = false;
|
|
@@ -3687,7 +3688,7 @@ class DialboxComponent {
|
|
|
3687
3688
|
else {
|
|
3688
3689
|
incomingCallData['isFirstCall'] = true;
|
|
3689
3690
|
console.log('dd1');
|
|
3690
|
-
this.isCallInProgress = true;
|
|
3691
|
+
// this.isCallInProgress = true;
|
|
3691
3692
|
this.isDialpadHidden = false;
|
|
3692
3693
|
this.callData.phone = incomingCallData.parameters['From'];
|
|
3693
3694
|
console.log('dd2');
|
|
@@ -3744,7 +3745,7 @@ class DialboxComponent {
|
|
|
3744
3745
|
this.registerDragElement();
|
|
3745
3746
|
}
|
|
3746
3747
|
ngOnChanges(changes) {
|
|
3747
|
-
var _a, _b, _c, _d;
|
|
3748
|
+
var _a, _b, _c, _d, _e;
|
|
3748
3749
|
if (changes['incomingCallnotification']) {
|
|
3749
3750
|
console.log('incomingCallnotification', changes['incomingCallnotification'].currentValue);
|
|
3750
3751
|
this.isIncomingCallnotification = true;
|
|
@@ -3756,8 +3757,10 @@ class DialboxComponent {
|
|
|
3756
3757
|
// deviceId: this.deviceId,
|
|
3757
3758
|
// conferenceId: this.incomingCallnotification.data.data.conferenceId || 'no'
|
|
3758
3759
|
// }
|
|
3759
|
-
this.isCallInProgress = true;
|
|
3760
3760
|
this.incomingCallsList.push({ direction: "incoming-call", img: 'assets/images/user.jpg', isIncomingCall: true, isHold: false, isConference: false, isAcceptCall: false, dial: true, phone: (_a = this.incomingCallnotification.data.data) === null || _a === void 0 ? void 0 : _a.fromNumber, participantId: (_b = this.incomingCallnotification.data.data) === null || _b === void 0 ? void 0 : _b.participantId, name: (_c = this.incomingCallnotification.data.data) === null || _c === void 0 ? void 0 : _c.fromName, time: '', id: (_d = this.incomingCallnotification.data.data) === null || _d === void 0 ? void 0 : _d.participantId });
|
|
3761
|
+
if ((_e = this.incomingCallnotification.data.data) === null || _e === void 0 ? void 0 : _e.participantId) {
|
|
3762
|
+
this.isCallInProgress = true;
|
|
3763
|
+
}
|
|
3761
3764
|
// this.extensionService.setIncomingCallStatus(payload).subscribe((res: any) => {
|
|
3762
3765
|
// console.log(res)
|
|
3763
3766
|
// })
|