@vgroup/dialbox 0.7.88 → 0.7.90
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 +3 -3
- package/esm2020/lib/dialbox.component.mjs +11 -3
- package/esm2020/lib/service/twilio.service.mjs +6 -1
- package/fesm2015/vgroup-dialbox.mjs +21 -8
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +17 -4
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1650,6 +1650,11 @@ class TwilioService {
|
|
|
1650
1650
|
};
|
|
1651
1651
|
this.currentDeviceErrorHandler = onDeviceError;
|
|
1652
1652
|
device.on('error', onDeviceError);
|
|
1653
|
+
device.on('disconnect', () => {
|
|
1654
|
+
console.log('Twilio Device disconnected');
|
|
1655
|
+
this.isShowIncomingCall = false;
|
|
1656
|
+
this.scheduleDeviceRecovery();
|
|
1657
|
+
});
|
|
1653
1658
|
const onDeviceUnregistered = () => {
|
|
1654
1659
|
// Stale event from a device we've already intentionally replaced — ignore.
|
|
1655
1660
|
if (this.device !== device)
|
|
@@ -2631,7 +2636,7 @@ class CallProgressComponent {
|
|
|
2631
2636
|
if (!this.currentConferenceCall?.conferenceId && this.currentCall?.conferenceId) {
|
|
2632
2637
|
this.timer = this.getTimeDifference(this.currentCall?.joinedAt);
|
|
2633
2638
|
}
|
|
2634
|
-
if (this.selectedUserInfo?.
|
|
2639
|
+
if (this.selectedUserInfo?.id) {
|
|
2635
2640
|
let selectedUser = this.currentCallList.find((item) => item?.id == this.selectedUserInfo?.id);
|
|
2636
2641
|
if (selectedUser && (selectedUser?.conferenceId == this.currentConferenceCall?.conferenceId || this.isClickExpand)) {
|
|
2637
2642
|
selectedUser.IsUserInfoShow = true;
|
|
@@ -3414,7 +3419,7 @@ class CallProgressComponent {
|
|
|
3414
3419
|
if (!this.C2ConfoList[userInfo?.participantId] && !this.C2ConfoList[userInfo?.businessParticipantId]) {
|
|
3415
3420
|
this.extensionService.getUserInformation(participantID).subscribe({
|
|
3416
3421
|
next: (resInfo) => {
|
|
3417
|
-
let index = this.currentCallList.findIndex((item) => item?.participantId ==
|
|
3422
|
+
let index = this.currentCallList.findIndex((item) => item?.participantId == participantID);
|
|
3418
3423
|
this.currentCallList[index] = this.mapUserInfo(this.currentCallList[index], resInfo?.c2cInformation);
|
|
3419
3424
|
this.selectedUserInfo = this.currentCallList[index];
|
|
3420
3425
|
this.C2ConfoList[participantID] = this.currentCallList[index];
|
|
@@ -4834,6 +4839,7 @@ class DialboxComponent {
|
|
|
4834
4839
|
incomingCallData = incomingCallData?.length > 0
|
|
4835
4840
|
? incomingCallData.filter((item) => item.participants?.length > 0)
|
|
4836
4841
|
: [];
|
|
4842
|
+
console.log('244', incomingCallData);
|
|
4837
4843
|
// All conferenceIds received from socket this tick
|
|
4838
4844
|
const socketConferenceIds = incomingCallData.map((c) => c.conferenceId);
|
|
4839
4845
|
incomingCallData.forEach((callInfo) => {
|
|
@@ -4861,11 +4867,14 @@ class DialboxComponent {
|
|
|
4861
4867
|
}
|
|
4862
4868
|
}
|
|
4863
4869
|
});
|
|
4870
|
+
console.log('incomingCallsList 275', this.incomingCallsList);
|
|
4864
4871
|
// Remove active-call entries whose conferenceId is no longer in the socket
|
|
4865
4872
|
// but keep incoming-call notifications (they are managed by notificationCallList expiry)
|
|
4866
4873
|
this.incomingCallsList = this.incomingCallsList.filter((res) => socketConferenceIds.includes(res.conferenceId) || res.direction === 'incoming-call');
|
|
4874
|
+
console.log('incomingCallsList 281', this.incomingCallsList);
|
|
4867
4875
|
// Remove expired notification entries
|
|
4868
4876
|
this.notificationCallList = this.notificationCallList.filter((res) => res.endTime >= new Date().getTime());
|
|
4877
|
+
console.log('notificationCallList 286', this.notificationCallList, this.incomingCallsList);
|
|
4869
4878
|
// Merge notificationCallList ONCE (not inside forEach). A pending incoming-call
|
|
4870
4879
|
// notification is identified by its OWN participantId — never by conferenceId —
|
|
4871
4880
|
// because it can legitimately share the conferenceId of a conference we are already
|
|
@@ -4874,8 +4883,10 @@ class DialboxComponent {
|
|
|
4874
4883
|
const existingNotificationParticipantIds = new Set(this.incomingCallsList
|
|
4875
4884
|
.filter((r) => r?._isNotification)
|
|
4876
4885
|
.map((r) => r?.participantId));
|
|
4886
|
+
console.log('existingNotificationParticipantIds 296', existingNotificationParticipantIds);
|
|
4877
4887
|
const notificationsToAdd = this.notificationCallList.filter((n) => !existingNotificationParticipantIds.has(n?.participantId));
|
|
4878
4888
|
this.incomingCallsList = [...this.incomingCallsList, ...notificationsToAdd];
|
|
4889
|
+
console.log('incomingCallsList 305', this.incomingCallsList, notificationsToAdd);
|
|
4879
4890
|
// Final deduplication. Active conference entries are keyed by conferenceId (socket data
|
|
4880
4891
|
// wins — last write wins). Pending incoming-call notifications are keyed in a SEPARATE
|
|
4881
4892
|
// namespace by participantId, so a notification and an active conference that share the
|
|
@@ -4887,11 +4898,13 @@ class DialboxComponent {
|
|
|
4887
4898
|
: `conf:${item?.conferenceId}`;
|
|
4888
4899
|
seen.set(key, item);
|
|
4889
4900
|
}
|
|
4901
|
+
console.log('incomingCallsList 320', this.incomingCallsList, Array.from(seen.values()));
|
|
4890
4902
|
let finalList = Array.from(seen.values());
|
|
4891
4903
|
// Remove any notification entry if an active conference with the same conferenceId already exists
|
|
4892
4904
|
// added for 7472 bug
|
|
4893
4905
|
const activeConferenceIds = new Set(finalList.filter((item) => !item._isNotification).map((item) => item.conferenceId));
|
|
4894
4906
|
finalList = finalList.filter((item) => !(item._isNotification && activeConferenceIds.has(item.conferenceId)));
|
|
4907
|
+
console.log('incomingCallsList 33=0', this.incomingCallsList, finalList);
|
|
4895
4908
|
this.incomingCallsList = finalList;
|
|
4896
4909
|
if (this.incomingCallsList?.length && incomingCallData?.length) {
|
|
4897
4910
|
this.isCallInProgress = true;
|
|
@@ -4919,9 +4932,9 @@ class DialboxComponent {
|
|
|
4919
4932
|
}, 2000);
|
|
4920
4933
|
}
|
|
4921
4934
|
}
|
|
4922
|
-
if (!this.incomingCallsList?.length
|
|
4935
|
+
if (!this.incomingCallsList?.length) {
|
|
4923
4936
|
setTimeout(() => {
|
|
4924
|
-
if (!this.incomingCallsList?.length
|
|
4937
|
+
if (!this.incomingCallsList?.length) {
|
|
4925
4938
|
this.isCallInProgress = false;
|
|
4926
4939
|
this.twilioService.device?.disconnectAll();
|
|
4927
4940
|
this.twilioService.spareDevice?.disconnectAll();
|