@vgroup/dialbox 0.7.92 → 0.7.93
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 +41 -15
- package/esm2020/lib/dialbox.component.mjs +10 -17
- package/esm2020/lib/environments/environments.mjs +12 -12
- package/fesm2015/vgroup-dialbox.mjs +62 -43
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +60 -41
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export const environment = {
|
|
2
|
-
abb: "
|
|
2
|
+
abb: "u",
|
|
3
3
|
production: false,
|
|
4
4
|
secureCookies: true,
|
|
5
|
-
feUrl: 'https://
|
|
6
|
-
apiUrl: 'https://
|
|
7
|
-
websocketUrl: 'wss://
|
|
5
|
+
feUrl: 'https://c2c-uat.contexttocall.com:85/',
|
|
6
|
+
apiUrl: 'https://c2c-uatapi-t10.contexttocall.com/uat_softphone',
|
|
7
|
+
websocketUrl: 'wss://c2c-uatapi-t10.contexttocall.com/uat_softphone/',
|
|
8
8
|
captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
|
|
9
|
-
stripePublishableKey: "
|
|
9
|
+
stripePublishableKey: "pk_live_51NbMVaA3guus6fhl85gdcvAWHzfHba5LdGlsnV7DxBT9spHghn4IHT9rDCjSRgFh2ijTiZn9qeazdciY1PbreOuB00t1GdQAZJ",
|
|
10
10
|
sessionTimeout: 15,
|
|
11
11
|
deviceType: "web",
|
|
12
|
-
appVersion: "2.
|
|
13
|
-
channelId: '
|
|
12
|
+
appVersion: "2.9",
|
|
13
|
+
channelId: '6511738039ee10367cbde2e9',
|
|
14
14
|
c2c_support_point_id: '60424735f74ac306c1bfa900',
|
|
15
|
-
c2c_support_channel_id: '
|
|
16
|
-
c2c_point_url: 'https://
|
|
17
|
-
c2c_call_label_id: '
|
|
18
|
-
c2c_email_label_id: '
|
|
15
|
+
c2c_support_channel_id: '677f68fcbe93ab507fbbfe0b',
|
|
16
|
+
c2c_point_url: 'https://bit.ly/3blWnPv',
|
|
17
|
+
c2c_call_label_id: '5M4taT8xzAg9pPIUADOW',
|
|
18
|
+
c2c_email_label_id: 'MUUC4NV5bLqHixXyhmok',
|
|
19
19
|
radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
|
|
20
20
|
firebase: {
|
|
21
21
|
apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
|
|
@@ -32,4 +32,4 @@ export const environment = {
|
|
|
32
32
|
keycloakRealm: 'vgroup-test',
|
|
33
33
|
keycloakClientId: 'c2c-softphone-app'
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW52aXJvbm1lbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZGlhbGJveC9zcmMvbGliL2Vudmlyb25tZW50cy9lbnZpcm9ubWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sV0FBVyxHQUFHO0lBQ3pCLEdBQUcsRUFBRSxHQUFHO0lBQ1IsVUFBVSxFQUFFLEtBQUs7SUFDakIsYUFBYSxFQUFFLElBQUk7SUFDbkIsS0FBSyxFQUFDLHVDQUF1QztJQUM3QyxNQUFNLEVBQUUsd0RBQXdEO0lBQ2hFLFlBQVksRUFBRSx1REFBdUQ7SUFDckUsVUFBVSxFQUFFLDBDQUEwQztJQUN0RCxvQkFBb0IsRUFBRSw2R0FBNkc7SUFDbkksY0FBYyxFQUFFLEVBQUU7SUFDbEIsVUFBVSxFQUFFLEtBQUs7SUFDakI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Nzc3LmZpcmViYXNlYXBwLmNvbVwiLFxyXG4gICAgICBwcm9qZWN0SWQ6IFwic29mdHBob25lLWQ1Nzc3XCIsXHJcbiAgICAgIHN0b3JhZ2VCdWNrZXQ6IFwic29mdHBob25lLWQ1Nzc3LmFwcHNwb3QuY29tXCIsXHJcbiAgICAgIG1lc3NhZ2luZ1NlbmRlcklkOiBcIjg1MDgxMjQ5NDUzOFwiLFxyXG4gICAgICBhcHBJZDogXCIxOjg1MDgxMjQ5NDUzODp3ZWI6NzRmOGEzMGZjMThlMjhkZWQ3OGEzM1wiLFxyXG4gICAgICBtZWFzdXJlbWVudElkOiBcIkctTkdYVFNWOVNIM1wiLFxyXG4gICAgICB2YXBpZEtleTpcIkJENkVnY1FnYlpUak9RZmxlRzNZbEVjMF9TYWpCMDNwcnFUZER5LXFHSmt4VHhlemJxLUFfcXR1WEUxbDN5VDQ3bzhoblRBYlRLQmNIMTVEMkFKQjJUb1wiXHJcbiAgfSxcclxuICBwZXJzcGVjdGl2ZUFwaUtleTogJ0FJemFTeUNsZjMybHZMSDRRT3ktdk9uekx6d1NObnRLSWdhcEg4cycsXHJcbiAga2V5Y2xvYWtVUkw6ICdodHRwczovL3Rlc3Qta2V5Y2xvYWsudmdyb3VwaW5jLmNvbS8nLFxyXG4gIGtleWNsb2FrUmVhbG06ICd2Z3JvdXAtdGVzdCcsXHJcbiAga2V5Y2xvYWtDbGllbnRJZDogJ2MyYy1zb2Z0cGhvbmUtYXBwJ1xyXG59O1xyXG4iXX0=
|
|
@@ -63,23 +63,23 @@ const keypad = [
|
|
|
63
63
|
];
|
|
64
64
|
|
|
65
65
|
const environment = {
|
|
66
|
-
abb: "
|
|
66
|
+
abb: "u",
|
|
67
67
|
production: false,
|
|
68
68
|
secureCookies: true,
|
|
69
|
-
feUrl: 'https://
|
|
70
|
-
apiUrl: 'https://
|
|
71
|
-
websocketUrl: 'wss://
|
|
69
|
+
feUrl: 'https://c2c-uat.contexttocall.com:85/',
|
|
70
|
+
apiUrl: 'https://c2c-uatapi-t10.contexttocall.com/uat_softphone',
|
|
71
|
+
websocketUrl: 'wss://c2c-uatapi-t10.contexttocall.com/uat_softphone/',
|
|
72
72
|
captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
|
|
73
|
-
stripePublishableKey: "
|
|
73
|
+
stripePublishableKey: "pk_live_51NbMVaA3guus6fhl85gdcvAWHzfHba5LdGlsnV7DxBT9spHghn4IHT9rDCjSRgFh2ijTiZn9qeazdciY1PbreOuB00t1GdQAZJ",
|
|
74
74
|
sessionTimeout: 15,
|
|
75
75
|
deviceType: "web",
|
|
76
|
-
appVersion: "2.
|
|
77
|
-
channelId: '
|
|
76
|
+
appVersion: "2.9",
|
|
77
|
+
channelId: '6511738039ee10367cbde2e9',
|
|
78
78
|
c2c_support_point_id: '60424735f74ac306c1bfa900',
|
|
79
|
-
c2c_support_channel_id: '
|
|
80
|
-
c2c_point_url: 'https://
|
|
81
|
-
c2c_call_label_id: '
|
|
82
|
-
c2c_email_label_id: '
|
|
79
|
+
c2c_support_channel_id: '677f68fcbe93ab507fbbfe0b',
|
|
80
|
+
c2c_point_url: 'https://bit.ly/3blWnPv',
|
|
81
|
+
c2c_call_label_id: '5M4taT8xzAg9pPIUADOW',
|
|
82
|
+
c2c_email_label_id: 'MUUC4NV5bLqHixXyhmok',
|
|
83
83
|
radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
|
|
84
84
|
firebase: {
|
|
85
85
|
apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
|
|
@@ -2355,7 +2355,6 @@ class CallProgressComponent {
|
|
|
2355
2355
|
if (!((_p = this.deviceNumberList) === null || _p === void 0 ? void 0 : _p.length)) {
|
|
2356
2356
|
this.deviceNumberList = this.callerIdList.map((res) => res.number);
|
|
2357
2357
|
}
|
|
2358
|
-
console.log('newIncomingCallsList', this.newIncomingCallsList);
|
|
2359
2358
|
this.newIncomingCallsList.forEach((callInfo, i) => {
|
|
2360
2359
|
var _a, _b, _c;
|
|
2361
2360
|
this.conferenceId = i == 0 ? this.newIncomingCallsList[i].conferenceId : this.conferenceId;
|
|
@@ -2420,7 +2419,6 @@ class CallProgressComponent {
|
|
|
2420
2419
|
this.startTimer((_p = this.currentCall) === null || _p === void 0 ? void 0 : _p.joinedAt);
|
|
2421
2420
|
}
|
|
2422
2421
|
else if (index != -1 && !(res === null || res === void 0 ? void 0 : res.isLeft)) {
|
|
2423
|
-
//console.log(res);
|
|
2424
2422
|
const participantId = res.id;
|
|
2425
2423
|
// Check if a mute update is pending for this participant
|
|
2426
2424
|
const isMutePending = this.pendingMuteParticipants.has(participantId);
|
|
@@ -2945,7 +2943,7 @@ class CallProgressComponent {
|
|
|
2945
2943
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
2946
2944
|
var _c, _d, _e, _f, _g;
|
|
2947
2945
|
try {
|
|
2948
|
-
let addClientParticipantRes = this.addClientParticipant({
|
|
2946
|
+
let addClientParticipantRes = yield this.addClientParticipant({
|
|
2949
2947
|
from: callData === null || callData === void 0 ? void 0 : callData.from,
|
|
2950
2948
|
route: "OUTGOING",
|
|
2951
2949
|
participantNumber: callData === null || callData === void 0 ? void 0 : callData.phone,
|
|
@@ -2956,9 +2954,9 @@ class CallProgressComponent {
|
|
|
2956
2954
|
deviceId: this.deviceId,
|
|
2957
2955
|
clientSid: (_d = this.call) === null || _d === void 0 ? void 0 : _d.parameters['CallSid']
|
|
2958
2956
|
});
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2957
|
+
if ((addClientParticipantRes === null || addClientParticipantRes === void 0 ? void 0 : addClientParticipantRes.status) != 200) {
|
|
2958
|
+
swal("Error", addClientParticipantRes === null || addClientParticipantRes === void 0 ? void 0 : addClientParticipantRes.message, "error");
|
|
2959
|
+
}
|
|
2962
2960
|
this.addRes = yield this.addParticipantToCall({
|
|
2963
2961
|
from: callData === null || callData === void 0 ? void 0 : callData.from,
|
|
2964
2962
|
route: "OUTGOING",
|
|
@@ -2996,14 +2994,34 @@ class CallProgressComponent {
|
|
|
2996
2994
|
this.unholdPendingConference();
|
|
2997
2995
|
}
|
|
2998
2996
|
else {
|
|
2997
|
+
console.log(896);
|
|
2998
|
+
this.endCallEvent.emit();
|
|
2999
2999
|
this.endCall(); // regular call failure – disconnect everything
|
|
3000
3000
|
}
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
3003
|
catch (error) {
|
|
3004
3004
|
this.showRingAnimation = false;
|
|
3005
|
-
|
|
3006
|
-
this
|
|
3005
|
+
// Whatever failed above (backend call, Twilio connect, etc.), the "Connecting..."
|
|
3006
|
+
// loader must always come down — previously this was left to endCall()/the socket
|
|
3007
|
+
// feed, and if either of those didn't run (or threw), the loader stayed on screen
|
|
3008
|
+
// forever with no way back to the dialpad.
|
|
3009
|
+
this.extensionService.isLoadershow.next(false);
|
|
3010
|
+
this.isLoadershown.emit(false);
|
|
3011
|
+
if (isNewConference) {
|
|
3012
|
+
this.unholdPendingConference();
|
|
3013
|
+
}
|
|
3014
|
+
else {
|
|
3015
|
+
console.log(896);
|
|
3016
|
+
this.endCallEvent.emit();
|
|
3017
|
+
try {
|
|
3018
|
+
this.endCall(); // regular call failure – disconnect everything
|
|
3019
|
+
}
|
|
3020
|
+
catch (cleanupError) {
|
|
3021
|
+
console.error('Error during call failure cleanup:', cleanupError);
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
this.handleError('Call not initiating due to a technical issue. Please try again.');
|
|
3007
3025
|
return false;
|
|
3008
3026
|
}
|
|
3009
3027
|
});
|
|
@@ -3105,15 +3123,25 @@ class CallProgressComponent {
|
|
|
3105
3123
|
});
|
|
3106
3124
|
}
|
|
3107
3125
|
onEndCall(c, isAllCallEnd, isContect) {
|
|
3108
|
-
var _a;
|
|
3126
|
+
var _a, _b;
|
|
3109
3127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3110
|
-
let participantId = isAllCallEnd ? 'all' : c.participantId || (c === null || c === void 0 ? void 0 : c.id);
|
|
3128
|
+
let participantId = isAllCallEnd ? 'all' : (c === null || c === void 0 ? void 0 : c.participantId) || (c === null || c === void 0 ? void 0 : c.id);
|
|
3111
3129
|
const currentConferenceCallInfo = this.getCurrentCallInfo();
|
|
3112
|
-
|
|
3130
|
+
// A call that failed/aborted before the backend ever created a conference for it
|
|
3131
|
+
// (e.g. initiateCall()/connectToDevice() threw) has no `c` and no matching entry
|
|
3132
|
+
// here — there is nothing to remove server-side, so just fall through to the
|
|
3133
|
+
// local cleanup below instead of throwing on `undefined.participants`.
|
|
3134
|
+
if (!(c === null || c === void 0 ? void 0 : c.conferenceId) && !isAllCallEnd) {
|
|
3135
|
+
this.conferenceCallIDForParticipantList = currentConferenceCallInfo === null || currentConferenceCallInfo === void 0 ? void 0 : currentConferenceCallInfo.conferenceId;
|
|
3136
|
+
this.incomeingCallSocketService.pause();
|
|
3137
|
+
this.cdr.detectChanges();
|
|
3138
|
+
return false;
|
|
3139
|
+
}
|
|
3140
|
+
const participantList = ((_a = this.newIncomingCallsList.find((callInfo) => (callInfo === null || callInfo === void 0 ? void 0 : callInfo.conferenceId) == (c === null || c === void 0 ? void 0 : c.conferenceId))) === null || _a === void 0 ? void 0 : _a.participants.filter((resData) => !(resData === null || resData === void 0 ? void 0 : resData.isLeft))) || [];
|
|
3113
3141
|
if ((participantList === null || participantList === void 0 ? void 0 : participantList.length) <= 2 && !isContect) {
|
|
3114
3142
|
participantId = 'all';
|
|
3115
3143
|
}
|
|
3116
|
-
if (((
|
|
3144
|
+
if (((_b = this.newIncomingCallsList) === null || _b === void 0 ? void 0 : _b.length) == 2) {
|
|
3117
3145
|
this.pendingAutoUnhold = true;
|
|
3118
3146
|
}
|
|
3119
3147
|
let conferenceId = c.conferenceId || (currentConferenceCallInfo === null || currentConferenceCallInfo === void 0 ? void 0 : currentConferenceCallInfo.conferenceId);
|
|
@@ -3617,7 +3645,7 @@ class CallProgressComponent {
|
|
|
3617
3645
|
else if (((_d = (_c = (_b = this.missCallInfo) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.recordId) == (data === null || data === void 0 ? void 0 : data.id) && !((_e = callToAccept.parameters) === null || _e === void 0 ? void 0 : _e.CallSid)) {
|
|
3618
3646
|
clearInterval(intervalId);
|
|
3619
3647
|
const sid = (_f = callToAccept.parameters) === null || _f === void 0 ? void 0 : _f.CallSid;
|
|
3620
|
-
this.isConnectingIncomingCallId
|
|
3648
|
+
this.twilioService.isConnectingIncomingCallId.next('');
|
|
3621
3649
|
this.isConnectingIncomingCallId = '';
|
|
3622
3650
|
this.acceptedCallList = this.acceptedCallList.filter(c => c.callSid !== sid);
|
|
3623
3651
|
this.twilioService.acceptedCallList = this.twilioService.acceptedCallList.filter((c) => { var _a; return ((_a = c.parameters) === null || _a === void 0 ? void 0 : _a.CallSid) !== sid; });
|
|
@@ -3762,7 +3790,7 @@ class CallProgressComponent {
|
|
|
3762
3790
|
catch (error) {
|
|
3763
3791
|
console.error('Error adding participant:', error);
|
|
3764
3792
|
this.showRingAnimation = false;
|
|
3765
|
-
this.handleError(
|
|
3793
|
+
this.handleError('Failed to add participant. Please try again.');
|
|
3766
3794
|
}
|
|
3767
3795
|
});
|
|
3768
3796
|
}
|
|
@@ -4119,9 +4147,7 @@ class CallProgressComponent {
|
|
|
4119
4147
|
console.log(ev);
|
|
4120
4148
|
try {
|
|
4121
4149
|
let selfCall = (_a = this.newIncomingCallsList.find((res) => { var _a; return (res === null || res === void 0 ? void 0 : res.conferenceId) == ((_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.conferenceId); })) === null || _a === void 0 ? void 0 : _a.participants.find((resData) => ((this.deviceNumberList.includes(resData === null || resData === void 0 ? void 0 : resData.from) && (resData === null || resData === void 0 ? void 0 : resData.client)) || (this.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.host))) && !(resData === null || resData === void 0 ? void 0 : resData.isLeft));
|
|
4122
|
-
console.log(selfCall);
|
|
4123
4150
|
let device = this.twilioService.getIncomingCallById((selfCall === null || selfCall === void 0 ? void 0 : selfCall.callSid) || (selfCall === null || selfCall === void 0 ? void 0 : selfCall.clientSid));
|
|
4124
|
-
console.log(device);
|
|
4125
4151
|
if (device && (device === null || device === void 0 ? void 0 : device._status) == 'open') {
|
|
4126
4152
|
device.sendDigits(String(ev.key));
|
|
4127
4153
|
}
|
|
@@ -4924,7 +4950,6 @@ class DialboxComponent {
|
|
|
4924
4950
|
incomingCallData = (incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length) > 0
|
|
4925
4951
|
? incomingCallData.filter((item) => { var _a; return ((_a = item.participants) === null || _a === void 0 ? void 0 : _a.length) > 0; })
|
|
4926
4952
|
: [];
|
|
4927
|
-
console.log('244', incomingCallData);
|
|
4928
4953
|
// All conferenceIds received from socket this tick
|
|
4929
4954
|
const socketConferenceIds = incomingCallData.map((c) => c.conferenceId);
|
|
4930
4955
|
incomingCallData.forEach((callInfo) => {
|
|
@@ -4953,14 +4978,11 @@ class DialboxComponent {
|
|
|
4953
4978
|
}
|
|
4954
4979
|
}
|
|
4955
4980
|
});
|
|
4956
|
-
console.log('incomingCallsList 275', this.incomingCallsList);
|
|
4957
4981
|
// Remove active-call entries whose conferenceId is no longer in the socket
|
|
4958
4982
|
// but keep incoming-call notifications (they are managed by notificationCallList expiry)
|
|
4959
|
-
this.incomingCallsList = this.incomingCallsList.filter((res) => socketConferenceIds.includes(res.conferenceId) || res.
|
|
4960
|
-
console.log('incomingCallsList 281', this.incomingCallsList);
|
|
4983
|
+
this.incomingCallsList = this.incomingCallsList.filter((res) => socketConferenceIds.includes(res.conferenceId) || res.callDirection === 'incoming-call');
|
|
4961
4984
|
// Remove expired notification entries
|
|
4962
4985
|
this.notificationCallList = this.notificationCallList.filter((res) => res.endTime >= new Date().getTime());
|
|
4963
|
-
console.log('notificationCallList 286', this.notificationCallList, this.incomingCallsList);
|
|
4964
4986
|
// Merge notificationCallList ONCE (not inside forEach). A pending incoming-call
|
|
4965
4987
|
// notification is identified by its OWN participantId — never by conferenceId —
|
|
4966
4988
|
// because it can legitimately share the conferenceId of a conference we are already
|
|
@@ -4969,10 +4991,8 @@ class DialboxComponent {
|
|
|
4969
4991
|
const existingNotificationParticipantIds = new Set(this.incomingCallsList
|
|
4970
4992
|
.filter((r) => r === null || r === void 0 ? void 0 : r._isNotification)
|
|
4971
4993
|
.map((r) => r === null || r === void 0 ? void 0 : r.participantId));
|
|
4972
|
-
console.log('existingNotificationParticipantIds 296', existingNotificationParticipantIds);
|
|
4973
4994
|
const notificationsToAdd = this.notificationCallList.filter((n) => !existingNotificationParticipantIds.has(n === null || n === void 0 ? void 0 : n.participantId));
|
|
4974
4995
|
this.incomingCallsList = [...this.incomingCallsList, ...notificationsToAdd];
|
|
4975
|
-
console.log('incomingCallsList 305', this.incomingCallsList, notificationsToAdd);
|
|
4976
4996
|
// Final deduplication. Active conference entries are keyed by conferenceId (socket data
|
|
4977
4997
|
// wins — last write wins). Pending incoming-call notifications are keyed in a SEPARATE
|
|
4978
4998
|
// namespace by participantId, so a notification and an active conference that share the
|
|
@@ -4984,13 +5004,11 @@ class DialboxComponent {
|
|
|
4984
5004
|
: `conf:${item === null || item === void 0 ? void 0 : item.conferenceId}`;
|
|
4985
5005
|
seen.set(key, item);
|
|
4986
5006
|
}
|
|
4987
|
-
console.log('incomingCallsList 320', this.incomingCallsList, Array.from(seen.values()));
|
|
4988
5007
|
let finalList = Array.from(seen.values());
|
|
4989
5008
|
// Remove any notification entry if an active conference with the same conferenceId already exists
|
|
4990
5009
|
// added for 7472 bug
|
|
4991
5010
|
const activeConferenceIds = new Set(finalList.filter((item) => !item._isNotification).map((item) => item.conferenceId));
|
|
4992
5011
|
finalList = finalList.filter((item) => !(item._isNotification && activeConferenceIds.has(item.conferenceId)));
|
|
4993
|
-
console.log('incomingCallsList 33=0', this.incomingCallsList, finalList);
|
|
4994
5012
|
this.incomingCallsList = finalList;
|
|
4995
5013
|
if (((_b = this.incomingCallsList) === null || _b === void 0 ? void 0 : _b.length) && (incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length)) {
|
|
4996
5014
|
this.isCallInProgress = true;
|
|
@@ -5000,7 +5018,7 @@ class DialboxComponent {
|
|
|
5000
5018
|
this.cdk.detectChanges();
|
|
5001
5019
|
}
|
|
5002
5020
|
else {
|
|
5003
|
-
const hasPendingNotifications = this.incomingCallsList.some((res) => (res === null || res === void 0 ? void 0 : res._isNotification) || (res === null || res === void 0 ? void 0 : res.
|
|
5021
|
+
const hasPendingNotifications = this.incomingCallsList.some((res) => (res === null || res === void 0 ? void 0 : res._isNotification) || (res === null || res === void 0 ? void 0 : res.callDirection) === 'incoming-call');
|
|
5004
5022
|
const hasAcceptedCalls = ((_c = this.twilioService.acceptedCallList) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
|
5005
5023
|
if ((hasAcceptedCalls || hasPendingNotifications) && ((_d = this.incomingCallsList) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
5006
5024
|
this.isCallInProgress = true;
|
|
@@ -5045,12 +5063,12 @@ class DialboxComponent {
|
|
|
5045
5063
|
if (acceptedParticipantId != null) {
|
|
5046
5064
|
this.notificationCallList = this.notificationCallList.filter((call) => (call === null || call === void 0 ? void 0 : call.participantId) != acceptedParticipantId);
|
|
5047
5065
|
this.incomingCallsList = this.incomingCallsList.filter((call) => !(((call === null || call === void 0 ? void 0 : call.participantId) == acceptedParticipantId || (call === null || call === void 0 ? void 0 : call.id) == acceptedParticipantId) &&
|
|
5048
|
-
(call === null || call === void 0 ? void 0 : call.
|
|
5066
|
+
(call === null || call === void 0 ? void 0 : call.callDirection) == 'incoming-call'));
|
|
5049
5067
|
}
|
|
5050
5068
|
else {
|
|
5051
5069
|
// Legacy fallback: remove by conferenceId.
|
|
5052
5070
|
this.notificationCallList = this.notificationCallList.filter((call) => (call === null || call === void 0 ? void 0 : call.conferenceId) != acceptedConferenceId);
|
|
5053
|
-
this.incomingCallsList = this.incomingCallsList.filter((call) => (call === null || call === void 0 ? void 0 : call.conferenceId) != acceptedConferenceId || (call === null || call === void 0 ? void 0 : call.
|
|
5071
|
+
this.incomingCallsList = this.incomingCallsList.filter((call) => (call === null || call === void 0 ? void 0 : call.conferenceId) != acceptedConferenceId || (call === null || call === void 0 ? void 0 : call.callDirection) != 'incoming-call');
|
|
5054
5072
|
}
|
|
5055
5073
|
});
|
|
5056
5074
|
this.getUserCallSetting();
|
|
@@ -5222,7 +5240,7 @@ class DialboxComponent {
|
|
|
5222
5240
|
else if (((_j = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _j === void 0 ? void 0 : _j.content) == "Missed Call" || ((_l = (_k = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _k === void 0 ? void 0 : _k.data) === null || _l === void 0 ? void 0 : _l.status) == "rejected" || ((_o = (_m = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.status) == "accepted") {
|
|
5223
5241
|
this.notificationCallList = this.notificationCallList.filter((call) => { var _a, _b, _c, _d; return (call === null || call === void 0 ? void 0 : call.participantId) != ((_b = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.recordId) && (call === null || call === void 0 ? void 0 : call.participantId) != ((_d = (_c = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.participantId); });
|
|
5224
5242
|
this.missCallInfo = snapshot;
|
|
5225
|
-
let incomingCallIndex = this.incomingCallsList.findIndex((call) => { var _a, _b, _c, _d; return ((call === null || call === void 0 ? void 0 : call.participantId) == ((_b = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.recordId) || call.participantId == ((_d = (_c = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.participantId)) && (call === null || call === void 0 ? void 0 : call.
|
|
5243
|
+
let incomingCallIndex = this.incomingCallsList.findIndex((call) => { var _a, _b, _c, _d; return ((call === null || call === void 0 ? void 0 : call.participantId) == ((_b = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.recordId) || call.participantId == ((_d = (_c = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.participantId)) && (call === null || call === void 0 ? void 0 : call.callDirection) == 'incoming-call'; });
|
|
5226
5244
|
if (incomingCallIndex > -1) {
|
|
5227
5245
|
console.log('incomingCallIndex', incomingCallIndex, snapshot);
|
|
5228
5246
|
this.incomingCallsList.splice(incomingCallIndex, 1);
|
|
@@ -5254,7 +5272,7 @@ class DialboxComponent {
|
|
|
5254
5272
|
this.notificationCallList = this.notificationCallList.filter((res) => res.endTime >= (new Date().getTime()));
|
|
5255
5273
|
this.notificationCallList.forEach((call) => {
|
|
5256
5274
|
this.incomingCallsList.forEach((item) => {
|
|
5257
|
-
let info = item.participants.find((resInfo) => (resInfo === null || resInfo === void 0 ? void 0 : resInfo.id) === (call === null || call === void 0 ? void 0 : call.participantId) && (call === null || call === void 0 ? void 0 : call.
|
|
5275
|
+
let info = item.participants.find((resInfo) => (resInfo === null || resInfo === void 0 ? void 0 : resInfo.id) === (call === null || call === void 0 ? void 0 : call.participantId) && (call === null || call === void 0 ? void 0 : call.callDirection) !== 'incoming');
|
|
5258
5276
|
if (info) {
|
|
5259
5277
|
parentCall.push(info.id);
|
|
5260
5278
|
}
|
|
@@ -5281,7 +5299,7 @@ class DialboxComponent {
|
|
|
5281
5299
|
if (this.twilioService.incomingCallToken != this.updatedTwilioToken) {
|
|
5282
5300
|
this.twilioService.incomingCallToken = this.updatedTwilioToken;
|
|
5283
5301
|
this.twilioService.tokenInitialized = true;
|
|
5284
|
-
this.twilioService.initializeTwilioDevice(
|
|
5302
|
+
this.twilioService.initializeTwilioDevice(localStorage.getItem('deviceId'));
|
|
5285
5303
|
}
|
|
5286
5304
|
}
|
|
5287
5305
|
if (((_x = changes['userId']) === null || _x === void 0 ? void 0 : _x.currentValue) && this.userId) {
|
|
@@ -5448,7 +5466,7 @@ class DialboxComponent {
|
|
|
5448
5466
|
// so a notification can coexist with an active conference that shares its conferenceId.
|
|
5449
5467
|
_isNotification: true,
|
|
5450
5468
|
participantId: notification === null || notification === void 0 ? void 0 : notification.participantId,
|
|
5451
|
-
|
|
5469
|
+
callDirection: "incoming-call",
|
|
5452
5470
|
participants: [
|
|
5453
5471
|
{
|
|
5454
5472
|
direction: "incoming-call", businessNumber: notification.c2cBusiness, img: notification.fromImage || notification.image || 'assets/images/user.jpg', isIncomingCall: true, isHold: false, isConference: false, isAcceptCall: false, dial: true, phone: notification.fromNumber, to: notification.toNumber,
|
|
@@ -6026,6 +6044,7 @@ class DialboxComponent {
|
|
|
6026
6044
|
this.incomingCallsList = [];
|
|
6027
6045
|
// Clean up Twilio device when component is destroyed
|
|
6028
6046
|
if (this.twilioService['device']) {
|
|
6047
|
+
console.log('Destroying Twilio device...');
|
|
6029
6048
|
this.twilioService['device'].disconnectAll();
|
|
6030
6049
|
this.twilioService['device'].destroy();
|
|
6031
6050
|
}
|