@vgroup/dialbox 0.8.24 → 0.8.26
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 +45 -8
- package/esm2020/lib/dialbox.component.mjs +2 -2
- package/esm2020/lib/environments/environments.mjs +12 -12
- package/fesm2015/vgroup-dialbox.mjs +59 -22
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +56 -19
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +2 -0
- package/package.json +1 -1
- package/vgroup-dialbox-0.8.20.tgz +0 -0
|
@@ -62,23 +62,23 @@ const keypad = [
|
|
|
62
62
|
];
|
|
63
63
|
|
|
64
64
|
const environment = {
|
|
65
|
-
abb: "
|
|
65
|
+
abb: "u",
|
|
66
66
|
production: false,
|
|
67
67
|
secureCookies: true,
|
|
68
|
-
feUrl: 'https://
|
|
69
|
-
apiUrl: 'https://
|
|
70
|
-
websocketUrl: 'wss://
|
|
68
|
+
feUrl: 'https://c2c-uat.contexttocall.com:85/',
|
|
69
|
+
apiUrl: 'https://c2c-uatapi-t10.contexttocall.com/uat_softphone',
|
|
70
|
+
websocketUrl: 'wss://c2c-uatapi-t10.contexttocall.com/uat_softphone/',
|
|
71
71
|
captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
|
|
72
|
-
stripePublishableKey: "
|
|
72
|
+
stripePublishableKey: "pk_live_51NbMVaA3guus6fhl85gdcvAWHzfHba5LdGlsnV7DxBT9spHghn4IHT9rDCjSRgFh2ijTiZn9qeazdciY1PbreOuB00t1GdQAZJ",
|
|
73
73
|
sessionTimeout: 15,
|
|
74
74
|
deviceType: "web",
|
|
75
|
-
appVersion: "2.
|
|
76
|
-
channelId: '
|
|
75
|
+
appVersion: "2.9",
|
|
76
|
+
channelId: '6511738039ee10367cbde2e9',
|
|
77
77
|
c2c_support_point_id: '60424735f74ac306c1bfa900',
|
|
78
|
-
c2c_support_channel_id: '
|
|
79
|
-
c2c_point_url: 'https://
|
|
80
|
-
c2c_call_label_id: '
|
|
81
|
-
c2c_email_label_id: '
|
|
78
|
+
c2c_support_channel_id: '677f68fcbe93ab507fbbfe0b',
|
|
79
|
+
c2c_point_url: 'https://bit.ly/3blWnPv',
|
|
80
|
+
c2c_call_label_id: '5M4taT8xzAg9pPIUADOW',
|
|
81
|
+
c2c_email_label_id: 'MUUC4NV5bLqHixXyhmok',
|
|
82
82
|
radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
|
|
83
83
|
firebase: {
|
|
84
84
|
apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
|
|
@@ -2322,6 +2322,8 @@ class CallProgressComponent {
|
|
|
2322
2322
|
this.conferenceCallList = [];
|
|
2323
2323
|
this.isIncomingCallBtnDisable = false;
|
|
2324
2324
|
this.isConnecting = false;
|
|
2325
|
+
// Incoming calls the user already ended – blocks a quick Green click from accepting them again
|
|
2326
|
+
this.rejectedIncomingCallIds = new Set();
|
|
2325
2327
|
this.isNewAddedCall = false;
|
|
2326
2328
|
this.deviceNumberList = [];
|
|
2327
2329
|
this.ourNumberInfo = {};
|
|
@@ -3775,6 +3777,10 @@ class CallProgressComponent {
|
|
|
3775
3777
|
}
|
|
3776
3778
|
}
|
|
3777
3779
|
async acceptIncomingCall(data, ourNumberInfo, capturedCall) {
|
|
3780
|
+
// Call already ended by the user, or this call is already connecting – ignore the click
|
|
3781
|
+
if (!data?.id || this.rejectedIncomingCallIds.has(data.id) || this.isConnectingIncomingCallId == data.id) {
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3778
3784
|
if (!this.currentCallList?.length) {
|
|
3779
3785
|
this.twilioService.setIncomingMuted(false);
|
|
3780
3786
|
}
|
|
@@ -3783,8 +3789,15 @@ class CallProgressComponent {
|
|
|
3783
3789
|
this.twilioService.isConnectingIncomingCallId.next(data?.id);
|
|
3784
3790
|
this.isIncomingCallBtnDisable = true;
|
|
3785
3791
|
this.cdr.detectChanges();
|
|
3792
|
+
const acceptStartTime = Date.now();
|
|
3786
3793
|
let intervalId = setInterval(() => {
|
|
3787
3794
|
const callToAccept = this.twilioService.getIncomingCallById(data?.clientSid);
|
|
3795
|
+
// Twilio call never showed up (ended meanwhile) – don't leave the UI stuck on Connecting
|
|
3796
|
+
if (!callToAccept?.parameters?.CallSid && (this.rejectedIncomingCallIds.has(data.id) || Date.now() - acceptStartTime >= 15000)) {
|
|
3797
|
+
clearInterval(intervalId);
|
|
3798
|
+
this.resetIncomingConnectingState(data);
|
|
3799
|
+
return;
|
|
3800
|
+
}
|
|
3788
3801
|
if (callToAccept?.parameters?.CallSid) {
|
|
3789
3802
|
clearInterval(intervalId);
|
|
3790
3803
|
const acceptedEntry = {
|
|
@@ -3886,17 +3899,18 @@ class CallProgressComponent {
|
|
|
3886
3899
|
this.acceptedCallList = this.acceptedCallList.filter(c => c.callSid !== sid);
|
|
3887
3900
|
this.twilioService.acceptedCallList = this.twilioService.acceptedCallList.filter((c) => c.parameters?.CallSid !== sid);
|
|
3888
3901
|
this.twilioService.isConnectingIncomingCallId.next('');
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
this.currentCallList.splice(index, 1);
|
|
3892
|
-
}
|
|
3902
|
+
this.isConnectingIncomingCallId = '';
|
|
3903
|
+
this.currentCallList = this.currentCallList.filter((res) => res?.id != data?.id);
|
|
3893
3904
|
this.twilioService.isShowIncomingCall = false;
|
|
3894
3905
|
this.isConnecting = false;
|
|
3895
3906
|
this.isIncomingCallBtnDisable = false;
|
|
3896
3907
|
this.incomeingCallSocketService.pause();
|
|
3897
3908
|
this.endCallEvent.emit(data);
|
|
3898
3909
|
this.cdr.detectChanges();
|
|
3899
|
-
|
|
3910
|
+
// User already ended this call – the "already answered" error is expected, don't show it
|
|
3911
|
+
if (!this.rejectedIncomingCallIds.has(data?.id)) {
|
|
3912
|
+
swal("Error", res?.message?.join?.("<br/>") || 'Internal Server Error', "error");
|
|
3913
|
+
}
|
|
3900
3914
|
}
|
|
3901
3915
|
setTimeout(() => {
|
|
3902
3916
|
this.isUnholdConferenceCall = false;
|
|
@@ -3906,9 +3920,9 @@ class CallProgressComponent {
|
|
|
3906
3920
|
callToAccept.accept();
|
|
3907
3921
|
this.cdr.detectChanges();
|
|
3908
3922
|
}
|
|
3909
|
-
else if (this.missCallInfo?.data?.data?.recordId == data?.id && !callToAccept
|
|
3923
|
+
else if (this.missCallInfo?.data?.data?.recordId == data?.id && !callToAccept?.parameters?.CallSid) {
|
|
3910
3924
|
clearInterval(intervalId);
|
|
3911
|
-
const sid = callToAccept
|
|
3925
|
+
const sid = callToAccept?.parameters?.CallSid;
|
|
3912
3926
|
this.twilioService.isConnectingIncomingCallId.next('');
|
|
3913
3927
|
this.isConnectingIncomingCallId = '';
|
|
3914
3928
|
this.acceptedCallList = this.acceptedCallList.filter(c => c.callSid !== sid);
|
|
@@ -3934,6 +3948,21 @@ class CallProgressComponent {
|
|
|
3934
3948
|
}
|
|
3935
3949
|
}, 1000);
|
|
3936
3950
|
}
|
|
3951
|
+
// Accept could not start (Twilio call gone / timed out): drop the Connecting state and go back to idle
|
|
3952
|
+
resetIncomingConnectingState(data) {
|
|
3953
|
+
this.twilioService.isConnectingIncomingCallId.next('');
|
|
3954
|
+
this.isConnectingIncomingCallId = '';
|
|
3955
|
+
this.currentCallList = this.currentCallList.filter((res) => res?.id != data?.id);
|
|
3956
|
+
this.twilioService.isShowIncomingCall = false;
|
|
3957
|
+
this.isConnecting = false;
|
|
3958
|
+
this.isIncomingCallBtnDisable = false;
|
|
3959
|
+
this.incomeingCallSocketService.pause();
|
|
3960
|
+
this.endCallEvent.emit(data);
|
|
3961
|
+
this.cdr.detectChanges();
|
|
3962
|
+
setTimeout(() => {
|
|
3963
|
+
this.isUnholdConferenceCall = false;
|
|
3964
|
+
}, 500);
|
|
3965
|
+
}
|
|
3937
3966
|
async callContact(contact, isUnsavedNumber, options, participantInfo) {
|
|
3938
3967
|
let phoneNumber = isUnsavedNumber ? contact : contact?.numbersList?.[0]?.number || contact?.phone;
|
|
3939
3968
|
if (!options?.alreadyNormalized) {
|
|
@@ -4653,6 +4682,14 @@ class CallProgressComponent {
|
|
|
4653
4682
|
return (hours * 60) + minutes;
|
|
4654
4683
|
}
|
|
4655
4684
|
onRejectCall(callInfo) {
|
|
4685
|
+
if (!callInfo?.id || this.rejectedIncomingCallIds.has(callInfo.id)) {
|
|
4686
|
+
return;
|
|
4687
|
+
}
|
|
4688
|
+
// Mark ended right away and hide the ringing screen so a quick Green click can't accept it
|
|
4689
|
+
this.rejectedIncomingCallIds.add(callInfo.id);
|
|
4690
|
+
setTimeout(() => this.rejectedIncomingCallIds.delete(callInfo.id), 60000);
|
|
4691
|
+
this.currentCallList = this.currentCallList.filter((res) => res?.id != callInfo?.id);
|
|
4692
|
+
this.cdr.detectChanges();
|
|
4656
4693
|
let payload = {
|
|
4657
4694
|
channelId: environment.channelId,
|
|
4658
4695
|
recordId: callInfo?.id,
|
|
@@ -5591,7 +5628,7 @@ class DialboxComponent {
|
|
|
5591
5628
|
if (this.twilioService.incomingCallToken != this.updatedTwilioToken) {
|
|
5592
5629
|
this.twilioService.incomingCallToken = this.updatedTwilioToken;
|
|
5593
5630
|
this.twilioService.tokenInitialized = true;
|
|
5594
|
-
this.twilioService.initializeTwilioDevice(
|
|
5631
|
+
this.twilioService.initializeTwilioDevice(localStorage.getItem('deviceId'));
|
|
5595
5632
|
}
|
|
5596
5633
|
}
|
|
5597
5634
|
if (changes['userId']?.currentValue && this.userId) {
|