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