@vgroup/dialbox 0.6.4 → 0.6.5
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.
|
@@ -3715,6 +3715,27 @@ class DialboxComponent {
|
|
|
3715
3715
|
}
|
|
3716
3716
|
}
|
|
3717
3717
|
console.log('notificationCallList', this.notificationCallList);
|
|
3718
|
+
let parentCall = [];
|
|
3719
|
+
if (this.notificationCallList?.length) {
|
|
3720
|
+
this.notificationCallList = this.notificationCallList.filter((res) => res.endTime >= (new Date().getTime()));
|
|
3721
|
+
this.notificationCallList.forEach((call) => {
|
|
3722
|
+
this.incomingCallsList.forEach((item) => {
|
|
3723
|
+
let info = item.participants.find((resInfo) => resInfo?.id === call?.participantId);
|
|
3724
|
+
// return info?.id
|
|
3725
|
+
if (info) {
|
|
3726
|
+
parentCall.push(info.id);
|
|
3727
|
+
}
|
|
3728
|
+
});
|
|
3729
|
+
});
|
|
3730
|
+
}
|
|
3731
|
+
if (parentCall?.length > 0) {
|
|
3732
|
+
this.notificationCallList = this.notificationCallList.filter((item) => !parentCall.includes(item?.participantId));
|
|
3733
|
+
this.incomingCallsList = [...this.incomingCallsList, ...this.notificationCallList];
|
|
3734
|
+
console.log('.....', this.notificationCallList);
|
|
3735
|
+
}
|
|
3736
|
+
else {
|
|
3737
|
+
this.incomingCallsList = [...this.incomingCallsList, ...this.notificationCallList];
|
|
3738
|
+
}
|
|
3718
3739
|
this.cdk.detectChanges();
|
|
3719
3740
|
}
|
|
3720
3741
|
if (changes['deviceId']) {
|
|
@@ -3930,7 +3951,7 @@ class DialboxComponent {
|
|
|
3930
3951
|
// this.dialInputRef.nativeElement.focus();
|
|
3931
3952
|
}
|
|
3932
3953
|
else if (num === 'voicemail') {
|
|
3933
|
-
|
|
3954
|
+
this.showDedicatedPopup = true;
|
|
3934
3955
|
this.router.navigate(['extension/voicemail/' + this.token]);
|
|
3935
3956
|
}
|
|
3936
3957
|
}
|
|
@@ -4080,232 +4101,6 @@ class DialboxComponent {
|
|
|
4080
4101
|
this.endCallEvent.emit();
|
|
4081
4102
|
}
|
|
4082
4103
|
}
|
|
4083
|
-
// async initiateCall() {
|
|
4084
|
-
// try {
|
|
4085
|
-
// console.log('Initiating call with number:', this.dialedNumber);
|
|
4086
|
-
// if (!this.dialedNumber && this.lastDialed) {
|
|
4087
|
-
// console.log('Using last dialed number:', this.lastDialed.number);
|
|
4088
|
-
// this.sanitizedNum = this.lastDialed.number;
|
|
4089
|
-
// }
|
|
4090
|
-
// const isInvalid = await this.isInvalidNumber();
|
|
4091
|
-
// if (isInvalid) {
|
|
4092
|
-
// console.error('Invalid number format');
|
|
4093
|
-
// return false;
|
|
4094
|
-
// }
|
|
4095
|
-
// this.saveLastDialed();
|
|
4096
|
-
// this.isSavedContactDialled();
|
|
4097
|
-
// // Check payment status
|
|
4098
|
-
// this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
|
|
4099
|
-
// if (this.isPaymentDue) {
|
|
4100
|
-
// console.warn('Payment is due');
|
|
4101
|
-
// swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
|
|
4102
|
-
// return false;
|
|
4103
|
-
// }
|
|
4104
|
-
// // Check if dialing own number
|
|
4105
|
-
// if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
|
|
4106
|
-
// console.error('Attempted to dial own number');
|
|
4107
|
-
// swal('Error', 'You cannot dial your own number');
|
|
4108
|
-
// return false;
|
|
4109
|
-
// }
|
|
4110
|
-
// // Check microphone permissions
|
|
4111
|
-
// const hasPermission = await this.checkMicrophonePermission();
|
|
4112
|
-
// if (!hasPermission) {
|
|
4113
|
-
// console.warn('Microphone permission not granted');
|
|
4114
|
-
// await this.askForMicrophonePermission();
|
|
4115
|
-
// return false;
|
|
4116
|
-
// }
|
|
4117
|
-
// if (!this.selectedCallerId) {
|
|
4118
|
-
// console.error('No caller ID selected');
|
|
4119
|
-
// this.shakeDedicatedBtn = true;
|
|
4120
|
-
// this.showDialAlert('Please select a C2C number to call from');
|
|
4121
|
-
// setTimeout(() => {
|
|
4122
|
-
// this.shakeDedicatedBtn = false;
|
|
4123
|
-
// }, 3000);
|
|
4124
|
-
// return false;
|
|
4125
|
-
// }
|
|
4126
|
-
// console.log('Getting number with country code...');
|
|
4127
|
-
// this.callData.displayNum = '';
|
|
4128
|
-
// try {
|
|
4129
|
-
// await this.getToNumber(this.sanitizedNum);
|
|
4130
|
-
// } catch (error) {
|
|
4131
|
-
// console.error('Error getting number with country code:', error);
|
|
4132
|
-
// this.showDialAlert('Error processing number. Please try again.');
|
|
4133
|
-
// return false;
|
|
4134
|
-
// }
|
|
4135
|
-
// if (this.terminateCall) {
|
|
4136
|
-
// console.log('Call terminated by user');
|
|
4137
|
-
// this.terminateCall = false;
|
|
4138
|
-
// return false;
|
|
4139
|
-
// }
|
|
4140
|
-
// // Prepare call data
|
|
4141
|
-
// this.callData = {
|
|
4142
|
-
// ...this.callData,
|
|
4143
|
-
// phone: this.sanitizedNum,
|
|
4144
|
-
// isIncomingCall: false,
|
|
4145
|
-
// dial: true,
|
|
4146
|
-
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
4147
|
-
// timestamp: new Date().toISOString()
|
|
4148
|
-
// };
|
|
4149
|
-
// console.log('Initiating call with data:', this.callData);
|
|
4150
|
-
// this.isCallInProgress = true;
|
|
4151
|
-
// this.callInitiated.emit({ ...this.callData });
|
|
4152
|
-
// return true;
|
|
4153
|
-
// } catch (error) {
|
|
4154
|
-
// console.error('Error in initiateCall:', error);
|
|
4155
|
-
// this.showDialAlert('Failed to initiate call. Please try again.');
|
|
4156
|
-
// this.isCallInProgress = false;
|
|
4157
|
-
// return false;
|
|
4158
|
-
// }
|
|
4159
|
-
// //this.clearAllDialed();
|
|
4160
|
-
// // } else {
|
|
4161
|
-
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
4162
|
-
// // }
|
|
4163
|
-
// }
|
|
4164
|
-
// async initiateCall() {
|
|
4165
|
-
// if (!this.dialedNumber && this.lastDialed) {
|
|
4166
|
-
// this.sanitizedNum = this.lastDialed.number;
|
|
4167
|
-
// }
|
|
4168
|
-
// const isInvalid = await this.isInvalidNumber();
|
|
4169
|
-
// if (isInvalid) {
|
|
4170
|
-
// return false;
|
|
4171
|
-
// }
|
|
4172
|
-
// this.saveLastDialed();
|
|
4173
|
-
// this.isSavedContactDialled();
|
|
4174
|
-
// //let isCallerIdSet = await this.isCallerIdSet();
|
|
4175
|
-
// this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
|
|
4176
|
-
// if (this.isPaymentDue) {
|
|
4177
|
-
// swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
|
|
4178
|
-
// return;
|
|
4179
|
-
// }
|
|
4180
|
-
// this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
|
|
4181
|
-
// // if (!this.isTrialPeriodOver) {
|
|
4182
|
-
// if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
|
|
4183
|
-
// swal('Error', 'You can not dial this number');
|
|
4184
|
-
// return;
|
|
4185
|
-
// }
|
|
4186
|
-
// const hasPermission = await this.checkMicrophonePermission();
|
|
4187
|
-
// if (hasPermission) {
|
|
4188
|
-
// if (this.selectedCallerId) {
|
|
4189
|
-
// //clear displayNum if value is binded from previous call
|
|
4190
|
-
// this.callData.displayNum = '';
|
|
4191
|
-
// // get number to be dialled from backend
|
|
4192
|
-
// await this.getToNumber(this.sanitizedNum);
|
|
4193
|
-
// if (this.terminateCall) {
|
|
4194
|
-
// this.terminateCall = false;
|
|
4195
|
-
// return;
|
|
4196
|
-
// }
|
|
4197
|
-
// this.callData.phone = this.sanitizedNum;
|
|
4198
|
-
// this.callData.isIncomingCall = false;
|
|
4199
|
-
// this.callData.dial = true;
|
|
4200
|
-
// if (!this.isSmartDialCall) {
|
|
4201
|
-
// this.callData.from = this.selectedCallerId.number;
|
|
4202
|
-
// }
|
|
4203
|
-
// this.isCallInProgress = true;
|
|
4204
|
-
// this.callData = {
|
|
4205
|
-
// ...this.callData,
|
|
4206
|
-
// phone: this.sanitizedNum,
|
|
4207
|
-
// isIncomingCall: false,
|
|
4208
|
-
// dial: true,
|
|
4209
|
-
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
4210
|
-
// timestamp: new Date().toISOString()
|
|
4211
|
-
// };
|
|
4212
|
-
// console.log('Initiating call with data:', this.callData);
|
|
4213
|
-
// this.isCallInProgress = true;
|
|
4214
|
-
// this.callInitiated.emit({ ...this.callData });
|
|
4215
|
-
// return true;
|
|
4216
|
-
// } else {
|
|
4217
|
-
// this.shakeDedicatedBtn = true;
|
|
4218
|
-
// this.showDialAlert('Select a C2C number to call');
|
|
4219
|
-
// setTimeout(() => {
|
|
4220
|
-
// this.shakeDedicatedBtn = false;
|
|
4221
|
-
// }, 3000);
|
|
4222
|
-
// return false;
|
|
4223
|
-
// }
|
|
4224
|
-
// //this.callingOpenEvent.emit({ phone: this.dialedNumber });
|
|
4225
|
-
// } else {
|
|
4226
|
-
// await this.askForMicrophonePermission();
|
|
4227
|
-
// }
|
|
4228
|
-
// //this.clearAllDialed();
|
|
4229
|
-
// // } else {
|
|
4230
|
-
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
4231
|
-
// // }
|
|
4232
|
-
// }
|
|
4233
|
-
// async initiateCall() {
|
|
4234
|
-
// try{
|
|
4235
|
-
// if (!this.dialedNumber && this.lastDialed) {
|
|
4236
|
-
// this.sanitizedNum = this.lastDialed.number;
|
|
4237
|
-
// }
|
|
4238
|
-
// const isInvalid = await this.isInvalidNumber();
|
|
4239
|
-
// if (isInvalid) {
|
|
4240
|
-
// return false;
|
|
4241
|
-
// }
|
|
4242
|
-
// this.saveLastDialed();
|
|
4243
|
-
// this.isSavedContactDialled();
|
|
4244
|
-
// //let isCallerIdSet = await this.isCallerIdSet();
|
|
4245
|
-
// this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
|
|
4246
|
-
// if (this.isPaymentDue) {
|
|
4247
|
-
// swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
|
|
4248
|
-
// return false;
|
|
4249
|
-
// }
|
|
4250
|
-
// this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
|
|
4251
|
-
// // if (!this.isTrialPeriodOver) {
|
|
4252
|
-
// if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
|
|
4253
|
-
// swal('Error', 'You can not dial this number');
|
|
4254
|
-
// return false;
|
|
4255
|
-
// }
|
|
4256
|
-
// const hasPermission = await this.checkMicrophonePermission();
|
|
4257
|
-
// if (hasPermission) {
|
|
4258
|
-
// if (this.selectedCallerId) {
|
|
4259
|
-
// //clear displayNum if value is binded from previous call
|
|
4260
|
-
// this.callData.displayNum = '';
|
|
4261
|
-
// // get number to be dialled from backend
|
|
4262
|
-
// await this.getToNumber(this.sanitizedNum);
|
|
4263
|
-
// if (this.terminateCall) {
|
|
4264
|
-
// this.terminateCall = false;
|
|
4265
|
-
// return;
|
|
4266
|
-
// }
|
|
4267
|
-
// this.callData.phone = this.sanitizedNum;
|
|
4268
|
-
// this.callData.isIncomingCall = false;
|
|
4269
|
-
// this.callData.dial = true;
|
|
4270
|
-
// if (!this.isSmartDialCall) {
|
|
4271
|
-
// this.callData.from = this.selectedCallerId.number;
|
|
4272
|
-
// }
|
|
4273
|
-
// this.isCallInProgress = true;
|
|
4274
|
-
// this.callData = {
|
|
4275
|
-
// ...this.callData,
|
|
4276
|
-
// phone: this.sanitizedNum,
|
|
4277
|
-
// isIncomingCall: false,
|
|
4278
|
-
// dial: true,
|
|
4279
|
-
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
4280
|
-
// timestamp: new Date().toISOString()
|
|
4281
|
-
// };
|
|
4282
|
-
// console.log('Initiating call with data:', this.callData);
|
|
4283
|
-
// this.isCallInProgress = true;
|
|
4284
|
-
// this.callInitiated.emit({ ...this.callData });
|
|
4285
|
-
// return true;
|
|
4286
|
-
// } else {
|
|
4287
|
-
// this.shakeDedicatedBtn = true;
|
|
4288
|
-
// this.showDialAlert('Select a C2C number to call');
|
|
4289
|
-
// setTimeout(() => {
|
|
4290
|
-
// this.shakeDedicatedBtn = false;
|
|
4291
|
-
// }, 3000);
|
|
4292
|
-
// return false;
|
|
4293
|
-
// }
|
|
4294
|
-
// //this.callingOpenEvent.emit({ phone: this.dialedNumber });
|
|
4295
|
-
// } else {
|
|
4296
|
-
// await this.askForMicrophonePermission();
|
|
4297
|
-
// }
|
|
4298
|
-
// //this.clearAllDialed();
|
|
4299
|
-
// // } else {
|
|
4300
|
-
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
4301
|
-
// // }
|
|
4302
|
-
// }catch(e){
|
|
4303
|
-
// console.error('Error in initiateCall:', e);
|
|
4304
|
-
// this.showDialAlert('Failed to initiate call. Please try again.');
|
|
4305
|
-
// this.isCallInProgress = false;
|
|
4306
|
-
// return false;
|
|
4307
|
-
// }
|
|
4308
|
-
// }
|
|
4309
4104
|
async initiateCall() {
|
|
4310
4105
|
try {
|
|
4311
4106
|
if (!this.dialedNumber && this.lastDialed) {
|